Merge 2 records into single, involves reformating too
Posted: Thu Oct 09, 2014 7:18 pm
Hi Team,
I need to merge 2 records into one single record. Could you please help
INPUT: (VB/120)
First record:
There are 59 bytes which remain as spaces from position 50. And we will have date at the end.
second record:
This record will have data (non spaces ex:HH) for those 59 bytes.
Output expected: (VB/120)
These 2 input records are to be merged to get the complete merged single record
Code I tried which dint work yet:
Program used:
The job ran fine but output is not as expected. Could someone pls check and advise us back.
I need to merge 2 records into one single record. Could you please help
INPUT: (VB/120)
First record:
There are 59 bytes which remain as spaces from position 50. And we will have date at the end.
second record:
This record will have data (non spaces ex:HH) for those 59 bytes.
********************************* Top of Data **********************************
DTL,XXXXXXXX.XXXXXXXX.CXXXX.ITEXXXX.INPXX , 20141004,
HHHHHHHHHHHHHH,
******************************** Bottom of Data ********************************
DTL,XXXXXXXX.XXXXXXXX.CXXXX.ITEXXXX.INPXX , 20141004,
HHHHHHHHHHHHHH,
******************************** Bottom of Data ********************************
Output expected: (VB/120)
These 2 input records are to be merged to get the complete merged single record
********************************* Top of Data **********************************
DTL,XXXXXXXX.XXXXXXXX.CXXXX.ITEXXXX.INPXX , HHHHHHHHHHHHHH, 20141004,
******************************** Bottom of Data ********************************
DTL,XXXXXXXX.XXXXXXXX.CXXXX.ITEXXXX.INPXX , HHHHHHHHHHHHHH, 20141004,
******************************** Bottom of Data ********************************
Code I tried which dint work yet:
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(121:SEQ=1,50,59)),
IFTHEN=(WHEN=(121,1,ZD,EQ,2),BUILD=(1,4,5,45,50:122,59,109,12))
OUTFIL BUILD=(1,120)
INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(121:SEQ=1,50,59)),
IFTHEN=(WHEN=(121,1,ZD,EQ,2),BUILD=(1,4,5,45,50:122,59,109,12))
OUTFIL BUILD=(1,120)
Program used:
//STEP111 EXEC PGM=SORT
The job ran fine but output is not as expected. Could someone pls check and advise us back.