File AID Tutorial and useful commands

File aid is having two types one which is used for File operations and second one is used for DB2 (file aid for DB2). Here we are going to discuss about the file aid for files.

Fileaid is a very useful tool in the mainframes, it can be used to browse (PS, VSAM), EDIT the files basically. Fileaid makes it easy to browse/edit by providing the number of user friendly options. For ex: we can browse a file by using its layout, the number of records in a file can be limited according to our requirement ( By using the selection criteria option). Here we will see some basic options of file aid with examples.

File aid main screen:

File-AID 9.2.0 ------------- Primary Option Menu -----------------------
OPTION ===

0 PARAMETERS- Specify ISPF and File-AID parameters USERID - MG9908 
1 BROWSE - Display file contents PF KEYS - 24 
2 EDIT - Create or change file contents TERMINAL - 3278 
3 UTILITIES - File-AID/SPF extended utilities TIME - 19:58 
5 PRINT - Print file contents JULIAN - 11.209 
6 SELECTION - Create or change selection criteria DATE - 09/07/28
7 XREF - Create or change layout cross reference CCSID - 00037 
8 VIEW - View interpreted record layout 
9 REFORMAT - Convert file from one format to another 
10 COMPARE - Compare file contents 
C CHANGES - Display summary of File-AID changes 
T TUTORIAL - Display information about File-AID 
X EXIT - Terminate File-AID and return to ISPF 

Use END to terminate File-AID 

Online Technical Support available at: frontline.compuware.com 

Copyright (c) 1982 - 2009, by Compuware Corporation. All rights reserved.
Unpublished rights reserved under the Copyright Laws of the United States.
Type LEGAL on the command line for Copyright/Trade Secret Notice. 

File aid Browse screen:

File-AID -------------- Browse - Dataset Specification ---------------------
COMMAND ===

Browse Mode ===F (F=Fmt; C=Char; V=Vfmt; U=Unfmt) 

Specify Browse Information: 
Dataset name or HFS path ==='MG9908.BOTS.TEST.INPUT' 
Member name ===(Blank or pattern for member list)
Volume serial ===(If dataset is not cataloged) 


Specify Record Layout and XREF Information: 
Record layout usage ===S (S = Single; X = XREF; N = None) 
Record layout dataset ==='MG9908.BOTS.TEST.COPYBOOK' 
Member name ===INLAY1 (Blank or pattern for member list)
XREF dataset name === 
Member name ===(Blank or pattern for member list)

Specify Selection Criteria Information: (E = Existing; T = Temporary; 
Selection criteria usage ===N M = Modify; Q = Quick; N = None) 
Selection dataset name ===
Member name ===(Blank or pattern for member list)

Browse screen can be used to browse the data sets, here the advantage is file aid contains 4 different browse modes (F=Fmt; C=Char; V=Vfmt; U=Unfmt) through which the data can be displayed in more readable format.
U (Unformatted) and C (character) formats do not require any input file lay out data sets. Where as other two requires a file layout.

Let us see how each of the above formats looks:

C Mode:
It looks like the normal file browsing (3.4 option)

File-AID - Browse - MG9908.BOTS.TEST.INPUT --------------
COMMAND ===
----+----1----+----2----+----3----+----4----+----5----+----6-
********************************* TOP OF DATA ***************
0001MAHENDER 020000
0002VISHU 030000
0003REDDY 040000
0004SANNA 050000
******************************** BOTTOM OF DATA *************

U=Unfmt:
It displays the records in the same row one by one…

COMMAND ===
RECORD: 1 LENGTH: 80
----+----1----+----2----+----3----+----4----+----5----+----6----+--7
1 0001MAHENDER 020000
----+----*----+----*----+----*----+----*----+----*----+----*----+--*
RECORD: 2 LENGTH: 80
----+----1----+----2----+----3----+----4----+----5----+----6----+--7
1 0002VISHU 030000
----+----*----+----*----+----*----+----*----+-+--* RECORD: 3 LENGTH: 80
----+----1----+----2----+----3----+----4----+----5------6----+----7
1 0003REDDY 040000
----+----*----+----*----+----*----+----*----+----*------*----+----*
RECORD: 4 LENGTH: 80
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
1 0004SANNA 050000
----+----*----+----*----+----*----+----*----+----*----+----*----+----*

In F and V mode file lay out needs to be specified as below

Browse Mode === f F=Fmt; C=Char; V=Vfmt; U=Unfmt)

Specify Browse Information:
Dataset name or HFS path === 'MG9908.BOTS.TEST.INPUT'
Member name === (Blank or pattern for member list)
Volume serial === (If dataset is not cataloged)

Specify Record Layout and XREF Information:
Record layout usage === S (S = Single; X = XREF; N = None)
Record layout dataset === 'MG9908.BOTS.TEST.COPYBOOK'
Member name === TSTLOT(Blank or pattern for member list)
XREF dataset name ===
Member name === (Blank or pattern for member list)

Specify Selection Criteria Information:(E = Existing; T = Temporary;
Selection criteria usage === N M = Modify; Q = Quick; N = None)
Selection dataset name ===
Member name === (Blank or pattern for member list)

F  Mode:

RECORD: 1 WW-LAYOUT LENGTH: 80
---- FIELD LEVEL/NAME ------- -FORMAT- ----+----1-----------3----+----4
3 WW-EMP-NO 4/NUM 1
3 WW-NAME 10/AN MAHENDER
3 WW-SAL 6/NUM 20000
3 FILLER 60/AN
(POS 41-60)

F11 displays the next record.

RECORD: 2 WW-LAYOUT LENGTH: 80
---- FIELD LEVEL/NAME ------- -FORMAT- ----+----1----+-+----3----+----4
3 WW-EMP-NO 4/NUM 2
3 WW-NAME 10/AN VISHU
3 WW-SAL 6/NUM 30000
3 FILLER 60/AN
(POS 41-60)

V Mode:

WW-EMP-NO WW-NAME WW-SAL FILLER
4/NUM 10/AN 6/NUM 60/AN
(1-4) (5-14) (15-20) (21-70)
1-------- 2--------- 3------- 4------------------------
******************** TOP OF DATA **************-CAPS OF
1 MAHENDER 20000
2 VISHU 30000
3 REDDY 40000
4 SANNA 50000
************* BOTTOM OF DATA *************-CAPS OF

If we are in the V mode and want to change the mode to F, then type in the command line FMT and press enter it changes to the F mode. For reverse to happen type VMFT and press enter as below.

Example:

File-AID - Browse - MG9908.BOTS.TEST.INPUT -------------- COL 1 80
COMMAND === VFMT SCROLL === CSR
RECORD: 1 WW-LAYOUT LENGTH: 80
---- FIELD LEVEL/NAME ------- -FORMAT- ----+----1+---3----+----4
3 WW-EMP-NO 4/NUM 1
3 WW-NAME 10/AN MAHENDER
3 WW-SAL 6/NUM 20000
3 FILLER 60/AN
(POS 41-60)
********************** BOTTOM OF DATA ************************

Selection Criteria Usage for better filtering of the displayed records:

Browse Mode === f (F=Fmt; C=Char; V=Vfmt; U=Unfmt)

Specify Browse Information:
Dataset name or HFS path === 'MG9908.BOTS.TEST.INPUT'
Member name === Blank or pattern for member list)
Volume serial === (If dataset is not cataloged)

Specify Record Layout and XREF Information:
Record layout usage === S (S = Single; X = XREF; N = None)
Record layout dataset === 'MG9908.BOTS.TEST.COPYBOOK'
Member name === TSTLOT (Blank or pattern for member list)
XREF dataset name ===
Member name === (Blank or pattern for member list)

Specify Selection Criteria Information: E = Existing; T = Temporary;
Selection criteria usage === N M = Modify; Q = Quick; N = None)
Selection dataset name ===
Member name === (Blank or pattern for member list)

It has 5 options for the selection criteria E, T, M, Q & N as mentioned above.

T = Temporary:

This can be used to give the selection criteria temporarily; after we exit the browse it will not be there. But if want we can save this temporary criteria to use it in further browsing.

.
.
.
Specify Selection Criteria Information: (E = Existing; T = Temporary;
Selection criteria usage === T M = Modify; Q = Quick; N = None)
Selection dataset name ===
Member name === (Blank or pattern for member list)

Give T in the selection criteria option and press enter it takes you to the below selection criteria main menu

Selection criteria Menu:

File-AID - Selection Criteria Menu - TEMPORARY --------------------
OPTION ===
- Status -
1 OPTIONS - Enter selection criteria options default
G GLOBAL - GLOBAL Fields 0 fields
2 FORMATTED - Edit formatted selection criteria 0 sets
3 UNFORMATTED - Edit unformatted selection criteria 0 sets

Member list description ===__________________________

Long === ___________________________________________
Description ===____________________________________________

Use VIEW command to display selection criteria summary
Use SAVE command to write selection criteria request
Use END to continue processing
Use CANCEL to return to main panel

Selection Criteria Options
1. Option:
Better to keep this with default options as shown below. If we want we can limit the result set by using the below options. But generally we wont use this option to filter the records instead we will use options 2 & 3 (Formatted & Unformatted).

File-AID -------------- Selection Criteria Options ------------
COMMAND ===

Specify Selection Criteria Options:
Start at the following record key
(both blank for start of dataset)
Starting record key ===
- OR - OR at the following RBA or RRN
Starting RBA or RRN ===

Initial records to skip === 0 then skip this many records

Subsequent Selection Interval: then repeat the following
Records to select === 1 - select this many records
Records to skip === 0 - then skip this many records
until
Number of records to search === ALL you have read this many records
Number of records to select === ALL or selected this many records

SEQ/VSAM processing direction === F (F = Forward; B = Backward)

Use ENTER to return to selection criteria menu

2 Formatted:

File-AID --- Formatted Selection Criteria ---------------------------
COMMAND === SCROLL === CSR

SET 1 OF 1 WW-LAYOUT GBL = N
---- FIELD LEVEL/NAME ------- -FORMAT- RO -------+----2----+----3----+--
******************************* TOP OF DATA ****************************
3 WW-EMP-NO 4/NUM  1
3 WW-NAME 10/AN
3 WW-SAL 6/NUM
3 FILLER 60/AN
(POS 38-60)
***************************** BOTTOM OF DATA **************************

Here we can specify our selection criteria, the above example shows only one criterion, but it can be specified for all the remaining variables as well.

The valid Relation Operators (RO) are:
EQ, NE, GT, GE, LT, LE, CO, NC, BT, NB, VA, NV, MX, NO, FM, FF

After giving the selection criteria press F3, it takes you to the previous screen (Selection criteria Menu), there you can save these criteria for future use or you can just press F3 to display the results.

In the result display screen it shows the below message for our reference

|FAMER223 FA223- Records read = 4, selected = 3, error records skipped = 0 |

How to save the selection Criteria to use it in the future processing:

Here the advantage is once we have specified the selection criteria as specified above, we can also save it to the PDS members so that when we want to browse the dataset with same selection criteria, we can just specify the PDS and member name in the main browse screen as shown below:

.
.
.
Specify Selection Criteria Information: (E = Existing; T = Temporary;
Selection criteria usage === E M = Modify; Q = Quick; N = None)
Selection dataset name === 'MG9908.BOTS.TEST.SLCNCRT'
Member name === SLCNCRT1 (Blank or pattern for member

After giving that if we press ENTER it will directly shows you the result, it won’t again show you the Selection criteria menu.

If we want to Modify the previous selection criteria we can do it M (Modify) option.
Ex:
Change it there and enter SAVE, it will be saved with modified criteria.

File-AID --- Formatted Selection Criteria --------------------------
COMMAND === SAVE SCROLL === CSR

SET 1 OF 1 WW-LAYOUT GBL = N
---- FIELD LEVEL/NAME ------- -FORMAT- RO --1---2----+----3----+--
******************************* TOP OF DATA **********************
3 WW-EMP-NO 4/NUM  2
3 WW-NAME 10/AN
3 WW-SAL 6/NUM
3 FILLER 60/AN
(POS 38-60)
***************************** BOTTOM OF DATA **********************
File-AID --- Formatted Selection Criteria --- Criteria SLCNCRT1 replac
COMMAND === SCROLL === CSR

SET 1 OF 1 WW-LAYOUT GBL = N
---- FIELD LEVEL/NAME ------- -FORMAT- RO ----+----2----+----3----+--
******************************* TOP OF DATA **************************
3 WW-EMP-NO 4/NUM  2
3 WW-NAME 10/AN
3 WW-SAL 6/NUM
3 FILLER 60/AN
(POS 38-60)
***************************** BOTTOM OF DATA ***********************

Saving the selection Criteria:

Two ways that we can do it:
-Enter the selection criteria as shown in the above screen and press F3, there enter SAVE and press ENTER, it will show you the below screen.
– Enter the selection criteria and type SAVE there it self it will bring you to the below screen.

File-AID -------- Selection Criteria Dataset Specification -------
COMMAND ===

Specify Selection Criteria Information:
Criteria dataset name === 'MG9908.BOTS.TEST.SLCNCRT'
Member name === SLCNCRT3 (Blank or pattern for member list)

Use ENTER to save into the specified dataset
Use END to stop save processing and return to selection processing

Press ENTER it will be saved.

NOTE: The criteria dataset (PDS) should exist with the below attributes, otherwise it throws an error.
RECFM=VB, LRECL=300, BLKSIZE=304 or larger

3 UNFORMATTED:

All the selection criteria saving and using the saved dataset is same as formatted criteria. Here the way of using the selection criteria is different. Here it uses the positions instead of the layout variables.

The selection screen looks like below:

File-AID --- Unformatted Selection Criteria ---- Row 1 to 20 of 20
COMMAND === SCROLL === PAGE

Use END to continue, CANCEL to return to main screen.

AND
Cmd /OR Position Length RO Data Value
--- --- -------- ------ -- ----------------------------------
___ _____ _____ EQ __________________________________
___ AND _____ _____ EQ __________________________________
___ AND _____ _____ EQ __________________________________
.
.
.

************************** END OF SELECTION CRITERIA *******
File-AID ---- Unformatted Selection Criteria ---- Row 1 to 20 of 20
COMMAND === SCROLL === PAGE

Use END to continue; CANCEL to return to main screen.

AND
Cmd /OR Position Length RO Data Value
--- --- -------- ------ -- --------------------------------
___ ___6_ 1____ EQ A_______________________________
___ AND _____ _____ EQ ______________________________

 

Give the criteria as shown above and press enter and go back it displays the result. Here we can also give multiple criteria separated by AND or OR.

2.EDIT: Edit also have the same options as B (browse) mentioned above including the selection criteria.

3 UTILITIES – File-AID/SPF extended utilities
It contains all the utilities like copy, create dataset etc as shown below. Most of the options are self explanatory.

File-AID ------------------ Extended Utilities -----------------
OPTION ===

1 LIBRARY - Display and modify directory entries; display load
module CSECT maps; browse, delete, rename PDS members
2 DATASET - Display dataset information; allocate non-VSAM datasets
and GDGs; catalog, uncatalog, delete, or rename datasets
3 COPY - Copy entire datasets; copy selected records; copy PDS
members based on name, statistics and/or content
4 CATALOG - Display generic catalog entries or VSAM datasets on a
volume in list form and do dataset list processing
5 VSAM - Allocate, display, delete, modify, or rename VSAM clusters,
alternate indexes, or paths; manage IAM files
6 SEARCH/UPDATE - FIND and CHANGE across PDS members. Search for and/or
update data globally in any type of dataset.
7 VTOC - Display and process datasets on a volume(s)

8 INTERACTIVE - Execute File-AID/Batch

9 BATCH SUBMIT - Build batch jobstreams

G XMLGEN - Generate an XML tagged document from data file

Copyright (c) 1982 - 2009, by Compuware Corporation. All rights reserved.

6 SELECTION - Create or change selection criteria
This is to create or change the selection criteria data set members as we discussed I above sections.

8 VIEW - View interpreted record layout

This option is used to check the layout of a copy book. This is much useful for checking the layout; find the length, position of each variable in the copybook.

File-AID --- View Record Layout - Dataset Specification -------
COMMAND ===

Specify Record Layout Dataset to View:

Dataset name === 'MG9908.BOTS.TEST.COPYBOOK'
Member name === TSTLOT (Blank or pattern for member list)
Expand Occurrences === Y (Y = Yes; N = No)

Press enter it shows the below screen

File-AID ---------------------- VIEW LAYOUT --------- Row 1 to 5 of 5
COMMAND === SCROLL === CSR
Layout: 'MG9908.BOTS.TEST.COPYBOOK(TSTLOT)
FIELD
--------- FIELD LEVEL/NAME ---PICTURE- -NUMBER START END LENGTH
WW-LAYOUT 1 80 80
3 WW-EMP-NO 9(4) 1 1 4 4
3 WW-NAME X(10) 2 5 14 10
3 WW-SAL 9(6) 3 15 20 6
3 FILLER X(60) 4 21 80 60
****************** Bottom of data *******************************

It also shows you the errors if any in the layout. This is much useful to check any errors in very big file layouts.
Ex: If accidentally I have given 05 level I between 03 levels as below

01 WW-LAYOUT.
   03 WW-EMP-NO PIC 9(4).
   03 WW-NAME PIC X(10).
   03 WW-SAL PIC 9(6)
   03 FILLER PIC X(60).
File-AID -------- SOURCE STATEMENT SELECTION ---- ERROR NEAR LINE 3
COMMAND===

"CURRENT" source dataset: 'MG9908.BOTS.TEST.COPYBOOK(TSTLOT1)

For entire member, enter blanks in top two sections.
For partial member, enter line numbers or beginning and ending string.

Record layout selection by full dataname or full word character string:
Beginning string ===
Ending string ===

Record layout selection by Source Statement line number:
Beginning number ===
Ending number ===
Number type === (Standard ISPF; COBOL; or Relative)

Compiler options:
Language === COBOL (COBOL or PL/1)
Starting level nbr === 01
Use 48 character set === NO (Yes or No; PL/1 only)

 

9 REFORMAT – Convert file from one format to another

We have already discussed about this in detail in my previous posts. Please find the same @ http://www.techtricky.com/file-aid-reformat-option/

Add a Comment

Your email address will not be published. Required fields are marked *