File-Aid Tips.

A Mainframe-Tip a Day keeps the bugs away!
Forum rules
All of these Tips/Tuning-suggestions should be tested your own, at your shop, prior to use in Prod.
Previous topicNext topic
User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

File-Aid Tips.

Post by Anuj Dhawan » Sun May 26, 2013 1:13 am

This section on File-Aid Tips provides examples of File-AID control cards that solve specific problems. We try to organized example here as follows:
  1. State the problem
  2. Show the control cards required and the JCL
However, as multiple members can post in here - the above order might distort in between. If you see that's happening have a feedback on it, please post use back here: Follow up on Tips

COBOL and PL/I Data Format Abbreviations
Please go through these data format abbreviations which are used by File-AID when the FPRINT function or parameter is used to print records with the SHOW=FORMAT parameter - you can refer this post when you see FPRINT being used.
Table 1: COBOL data format abbreviations
[attachment=1]COBOL Data Format Abbreviations.jpg[/attachment]

Table 2: PL/I data format abbreviations
[attachment=0]PLI Data Format Abbreviations.jpg[/attachment]
PS.: Click on pictures for a better quality view.
You do not have the required permissions to view the files attached to this post.


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: Frequently used commands in FileAid.

Post by Anuj Dhawan » Fri Jun 07, 2013 10:42 pm

1. Basic skeleton JCL for the File-Aid batch execution:

Code: Select all

//JOBNAME JOB JOB CARD INFORMATION 
//STEPNAME EXEC PGM=FILEAID,REGION=? 
//STEPLIB DD DSN=File-AID LOAD LIBRARY NAMES  
//STEPCAT DD DSN=CATALOG NAME 
//SYSPRINT DD SYSOUT=* 
//SYSLIST DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//DDxx DD DSN=INPUT DATASET NAME 
//DDxxO DD DSN=OUTPUT DATASET NAME 
//DDxxRF DD DSN=REFORMAT DEFINITION DATASET NAME 
//DDxxRL DD DSN=RECORD LAYOUT DATASET NAME 
//DDxxRLN DD DSN=COMPARE NEW DATASET - RECORD LAYOUT DATASET NAME 
//DDxxXR DD DSN=XREF DATASET NAME (XREF MEMBER) 
//DDxxXRN DD DSN=COMPARE NEW DATASET - XREF DATASET NAME (XREF MEMBER) 
//DDxxSC DD DSN=SELECTION CRITERIA DATASET NAME (SC MEMBER) 
//DDxxSCN DD DSN=COMPARE NEW DATASET - SELECTION CRITERIA DATASET NAME (SC MEMBER) 
//DDxxCP DD DSN=COMPARE CRITERIA DATASET NAME 
//DDxxC DD DSN=NEW COMPARE DATASET NAME 
//DDxxCOn DD DSN=NEW COMPARE OUTPUT FILES 
//ANYNAME DD DSN=OUTPUT DATASET NAME 
//SYSIN DD * (CONTROL CARDS) 
/* 
//


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: Frequently used commands in FileAid.

Post by Anuj Dhawan » Wed Jun 12, 2013 6:10 pm

3. Copy dataset - many to many

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//DD02     DD DSN=T1300AD.INPUT2,DISP=SHR 
//DD02O    DD DSN=T1300AD.OUTPUT2,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01 COPY 
$$DD02 COPY 
/*  


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: Frequently used commands in FileAid.

Post by Anuj Dhawan » Wed Jun 12, 2013 6:30 pm

4. Conditional copy

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01 COPY IF=(534,GE,P'8'),IF=(1234,EQ,C'9')  
/*


The example is self explanatory.


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: Frequently used commands in FileAid.

Post by Anuj Dhawan » Sun Jun 30, 2013 6:31 pm

5. This example show how to use AND and IF together.

This Job copy those records which has character '9999' at location 8 and characters not equal to 'AD' at location 22 or character '123' at location 9 and '1' at location 60.

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01  COPY IF=(8,EQ,C'9999'), 
             AND=(22,2,NE,C'AD'), 
             ORIF=(9,EQ,C'123'), 
             AND=(60,EQ,C'1')
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: Frequently used commands in FileAid.

Post by Anuj Dhawan » Fri Jul 05, 2013 6:55 pm

6. Below JCL shows how to use COPY, IF, OUT and PRINT in File-Aid batch Job. The JCL copies the first 9 records that contain the characters '675' at position 11. It also prints the first 5 selected records, these records are printed in the File-Aid's DD SYSLIST.

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$DD01  COPY IF=(11,EQ,C'675'),OUT=9,PRINT=5 
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Sat Aug 31, 2013 11:25 pm

7. In this File-Aid Batch job an example is shown with using COPY and MOVE. It copies six repetition of the characters 'IBM' to the output.

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01  COPY MOVE=(1,6C'IBM')
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Sun Sep 01, 2013 11:04 am

8. Below Job is a combination of COPY and OUT. It copies the first 60 records to the output data set.

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01  COPY OUT=60
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Sun Sep 01, 2013 11:05 am

9. Below Job is a combination of COPY and PRINT. It copies the input dataset while printing the first 15 records.

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01  COPY PRINT=15
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Sun Sep 01, 2013 11:11 am

10. Below Job is a combination of COPY, SELECT, OUT and IF. It creates an extract file of every fourth input record that contains a value of '123' at location 8. A maximum of 100 such records are copied.

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01 COPY SELECT=4,OUT=100,IF=(8,EQ,C'123')
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Mon Sep 02, 2013 1:26 am

10. This Job will copy input data-set but drop records containing '123' at location 8. Also stop copying after 10 records.

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01 DROP IF=(8,EQ,C'123'),OUT=10
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Mon Sep 02, 2013 1:27 am

11. Using pointer mechanism: The SPACE function is used to position the pointer at a specific record. The first control card places the pointer at the 25th record. The second control card copies the next 6 records.

Code: Select all

//STEPNAME EXEC PGM=FILEAID 
//DD01     DD DSN=INPUT.FILE,DISP=SHR 
//DD01O    DD DSN=OUTPUT.FILE1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01  SPACE  IN=25 
$$DD01  COPY OUT=6
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.


Shahid
Registered Member
Posts: 44
Joined: Sun Aug 25, 2013 1:00 am

Re: File-Aid Tips.

Post by Shahid » Mon Sep 02, 2013 1:28 am

This is an excellent collection and helped me a lot.

Thanks Anuj.



User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Mon Sep 02, 2013 3:07 pm

Great to know that they had been helpful...:)

Regards,


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Mon Sep 02, 2013 8:12 pm

12. Combination of SPACE, STOP, DUMP and IN. it prints the record with '123' at location 8 and the next five records.

Code: Select all

//STEPNAME EXEC PGM=FILEAID 
//DD01     DD DSN=INPUT.FILE,DISP=SHR 
//DD01O    DD DSN=OUTPUT.FILE1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01  SPACE STOP=(8,4,C'123') 
$$DD01  DUMP  IN=6
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Mon Sep 02, 2013 8:13 pm

13. Following Job replaces the string 'AAAA' with the string 'BBBBBBBB'. When the longer new data is inserted then the fields are shifted and when required compressed for spaces.

Code: Select all

//STEPNAME EXEC PGM=FILEAID,PARM=TSO 
//DD01     DD DSN=INPUT.FILE,DISP=SHR 
//DD01O    DD DSN=OUTPUT.FILE1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01 COPY  EDIT=(1,6,C'AAAA',C'BBBBBBBB')
/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Sat Nov 02, 2013 3:41 pm

14. This Job shows the combination of COPY and EDITALL. This eliminates all occurrences of the string 'ABC' and 'GHI' because the new data is a NULL.

Code: Select all

//STEPNAME EXEC PGM=FILEAID,PARM=TSO 
//DD01     DD DSN=INPUT.FILE,DISP=SHR 
//DD01O    DD DSN=OUTPUT.FILE1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01  COPY EDITALL=(1,50,C'ABC,GHI',C' ')


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Sun Nov 03, 2013 3:20 pm

15. When you want to verify a file which has got many fields and you want to check 2 or 3 fields - file-aid provides a means to do that. For example, if you want to check only 1st, 2nd and 8th fields in the file, issue, DISPLAY 1,2,10 ONLY on command line and it'll display only these fields once you are browsing the file using a copybook layout.


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

Re: File-Aid Tips.

Post by Anuj Dhawan » Sun May 17, 2015 7:23 pm

16. Following JCL shows a combination of UPDATE, IN and REPLACE.

This Job will make permanent changes to an existing data set. Two UPDATEs used in the Job - The first update places the pointer at a particular record and the second UPDATE replaces the data.

Code: Select all

//STEPCOPY EXEC PGM=FILEAID 
//DD01     DD DSN=T1300AD.INPUT1,DISP=SHR 
//DD01O    DD DSN=T1300AD.OUTPUT1,DISP=OLD 
//SYSOUT   DD SYSOUT=* 
//SYSPRINT DD SYSOUT=* 
//SYSLIST  DD SYSOUT=* 
//SYSTOTAL DD SYSOUT=* 
//SYSIN    DD * 
$$DD01  UPDATE IN=100 
$$DD01  UPDATE REPL=(65,EQ,C'ANUJDH','DHAWAN')/*
//*


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

Previous topicNext topic

Return to “Tip Of the Day.”