Examples of customer uses of File-AID/Batch
//STEP1 EXEC PGM=FILEAID
//STEPLIB DD (REQUIRED ONLY IF FILEAID IS NOT ON THE LINK LIST)
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=OLD.JCL.LIB,DISP=OLD
//DD01O DD DSN=NEW.JCL.LIB,DISP=OLD
//SYSIN DD *
$$DD01 COPYALL MEMBERS=ALL,FORM=JCL, CONTROL PARAMETERS COMMENT
EDIT=(3,0,C'UNIT=DISK,UNIT=SYSDA,UNIT=3350',C'UNIT=3380'),
REPL=(3,0,C'SPACE=(CYL',C'SPACE=(TRK')
The following JCL considerations apply to this example:
- A SYSPRINT DD statement is used for all hardcopy output, control card analysis, and log of actions taken.
- Statement DD01 defines the input dataset.
- Statement DD01O defines the output dataset.
- SYSIN DD statement specifies control statements.
- Control statements use the $$DD01 dataset identifier to identify the file(s) to be acted on (DD01 and DD01O).
The following control statement considerations apply to this example:
- The COPYALL function directs File-AID/Batch to copy all records from the input file (DD01) to the output file (DD01O).
- The MEMBERS=ALL parameter directs File-AID/Batch to include all input PDS members.
- The FORM=JCL parameter tells File-AID/Batch that the data being processed is JCL. File-AID/Batch interprets JOB, EXEC, and DD statements and handles continuations and syntax correctly.
- The EDIT parameter directs a search of each JCL statement beginning in position 3 (after the //). It searches all characters until the end of the JCL statement is found (length 0) and looks for any of the three strings:
- UNIT=DISK
- UNIT=SYSDA
- UNIT=3350
- If any of the three strings are found, File-AID/Batch changes the string to UNIT=3380 and adjusts the JCL if needed.
- The REPL (replace) parameter is also applied to each JCL statement as it is copied. The REPL parameter tells File-AID/Batch to search for the string SPACE=(CYL, then change the string to SPACE=(TRK. When changing JCL, the EDIT parameter is preferred over the REPL parameter unless the data that is searched for and the replacement data are the same length.
You can continue File-AID/Batch control statements as needed by placing a comma at the end of a parameter and continuing after column 1 and before column 26 of the next line. Comments may be entered on any control statement after one space following a parame-ter. You can also code them on a control card by placing an asterisk (*) in location 1.
Copying from one input file to create multiple output files
A large company collects file selection requests through the week and creates File-AID/Batch control cards on the weekend. This example illustrates how you can make a single pass through a master file (in this case 34 reels of tape) to create two extract output files that contain different subsets of data.
File-AID/Batch lets you create up to 99 output files. While the COPY function copies records to a single target file, the USER function can copy records to multiple target files. Use the WRITE parameter with the USER function to indicate the DDNAME to which you want to write a record.
//STEPLIB DD (REQUIRED ONLY IF FILEAID IS NOT ON THE LINK LIST)
//SYSPRINT DD SYSOUT=*
//DD01 DD DSN=MASTER.FILE.REELS34,DISP=OLD
//SELECT1 DD DSN=SELECT1.FILE,DISP=OLD
//SELECT2 DD DSN=SELECT2.FILE,DISP=OLD
//SYSIN DD *
$$DD01 USER IF=(27,EQ,X'15'),
WRITE=SELECT1,
IF=(14,EQ,C'20,21,22'), IF 14 EQUAL 20 OR 21 OR 22,
WRITE=SELECT2
Scanning and printing data in a load library
XYZ Corporation changed its name. The following control statement determines which programs must be changed to reflect the new company name.
File-AID scans the production load library for XYZ CORP. Because a MOVE parameter is used with a PRINT function, File-AID interprets PRINT as a request to print only the data that is moved, regardless of the length of the input record. Therefore, only the member name and XYZ CORP are printed. Code PARM=TSO on the EXEC statement to eliminate needless page skipping for each member.