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 Browse screen:

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)

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

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

F  Mode:

F11 displays the next record.

V Mode:

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:

Selection Criteria Usage for better filtering of the displayed records:

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.

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

Selection criteria Menu:

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).

2 Formatted:

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

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:

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.

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.

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:

 

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.

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.

Press enter it shows the below screen

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

 

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/

Leave a Reply

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

Bitnami