Modify segment layout during extract
JCL to modify segment layout during extract
02 //STEPLIB DD DISP=SHR,DSN=BMC.PFP.LOAD
03 // DD DISP=SHR,DSN=IMSVS.RESLIB
04 // DD DISP=SHR,DSN=IMSVS.DFSMDA
05 // DD DISP=SHR,DSN=BMC.DPK.LOAD
06 //$$DPICDS DD DISP=SHR,DSN=PFP.DPK.DPICDS
07 //$$DPITBL DD DISP=SHR,DSN=PFP.DPK.DPITBL
08 //IMSACB DD DISP=SHR,DSN=IMSVS.ACBLIB ---> IMSACB DD is not required in a managed ACB environment instead the active directory is used to refer the current control blocks.
09 //PFPSYSIN DD *
10 EXTRACT DBD=PFPSAMP,
11
INPUT_DSN_MASK='PFP.ICOPY.&DBD.&AREA(0)',
12
EXTRACT_FORMAT=HDUNLOAD,
13
EXPAND=YES
14 OFILECTL OAREA=ALL,
15 DSNAME='PFP.NEW.PFPSAMP.UNLOAD',
16 DISP=(NEW,CATLG),UNIT=SYSDA,
17 SPACE=(CYL,200,15,RLSE)
18
OUTPUT
SEGMENT=SDEP,
19
FIELDS=(3:*,4P'0',8C' ')
20 OUTPUT SEGMENT=SEGC,
21 FIELDS=(3:12,3P'0',15:*)
22 OUTPUT SEGMENT=SEGG,
23 FIELDS=(SEGGKEY,
24 8:9,5:3,
25 :2C :=(18:2 EQ 2X'0000') THEN 2C' ' ELSE 18:2C,
26 20:*)
/*
Line no. | Comments |
---|---|
01-04 | EXEC and STEPLIB statements for Fast Path/EP offline execution. |
05-07 | DD statements that define data sets for the BMC AMI Data Packer for IMS product. These data sets are required because expansion of the data was requested by the EXPAND=YES keyword, and because of data manipulation for compressed fields. |
08 | The DBD from the IMSACB DD statement is used for output areas. |
09 | PFPSYSIN DD for Fast Path/EP control statements. |
10 | Defines DEDB name for EXTRACT process. |
11 | Input for all areas is the zero generation image copy, which is dynamically allocated using the data set name specified with the INPUT_DSN_MASK keyword. |
12 | Data is extracted in HDUNLOAD format, which is suitable for use as input to RELOAD. |
13 | Compressed data is expanded. |
14-17 | All areas are written to a single output file using the provided data set name. |
18-19 | Modify data in SDEP segments, by increasing the output length by 12 bytes. |
19 | Copy the original input segment in its entirety, starting at column 3. Then, append a 4-byte packed field (initialized to zero), and an 8-byte character field (initialized to blanks) |
20-21 | Modify data in SEGC segments by increasing the output length by 3 bytes. Copy the first 12 bytes (columns 3 -14) unchanged, then insert a new 3-byte packed field (initialized to zero), followed by the remainder of the input segment from column 15 to the end. |
22-23 | Modify data in SEGG segments, but the first output field is the segment key. |
24 | The next two fields that are written to the output are swapped from where they were positioned on the input file: Starting at column 8 from the input, copy 9 bytes to the output. Next, starting at column 5 from the input, copy 3 bytes to the output. |
25 | Because the output position in the FIELDS list is the same as the input position of the field being tested, the effect is to conditionally modify the field. If the contents of the two-byte field in column 18 from the input segment is equal to binary zeroes, then write two blanks to the output file. Otherwise, write the input field unchanged. |
26 | Write the remainder of the segment unchanged. |