Hi,
I need small assistance regarding Sort :
My requirements are as below:
Input File:
Code: Select all
NAA0010000
NAA0020000
NAA003NEWA
NAA0010001
NAA0020000
NAA003
NAA0010000
NAA0020000
NAA003
Type 1 :Starts with NAA001
Type 2 :Starts with NAA002
Type 3 Starts with :NAA003
Desired Output:
Code: Select all
"Record 1 -160bytes record"|"Record Type 2" - 160 byte|"Record Type 3"
"Record 1 -160bytes record"|"Record Type 2" - 160 byte|"Record Type 3"
There are also some conditions as below:
1.)IF all three records Rec1, rec2, rec3 are present consecutively they should be together in the output.
2.) If rec1 is present and rec 2 (or rec3) not present, we should have 160 spaces for that record at their respective place.
3.) If rec1 is not present there should be 160 spaces at the rec1 place and whatever record is present next it should be available at the particular row.
I have also managed to get all the three records (but without condition):
for checking the records and giving the spaces.
Code:
Code: Select all
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=XXXX.AAA,DISP=SHR
//OUT DD DSN=XXXX.BBB,
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=480,BLKSIZE=0),
// UNIT=PRODA,
// SPACE=(CYL,(100,50),RLSE)
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(481,8,CH) KEEPNODUPS WITHEACH -
WITH(161,160) WITH(321,160) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=GROUP,RECORDS=3,PUSH=(481:ID=8,SEQ=1)),
IFTHEN=(WHEN=(489,1,ZD,EQ,2),BUILD=(161:1,160,481:481,8)),
IFTHEN=(WHEN=(489,1,ZD,EQ,3),BUILD=(321:1,160,481:481,8))
OUTFIL FNAMES=OUT,BUILD=(1,480)
/*
Thanks,
Deception