Posted: Wed Apr 22, 2009 1:54 pm Post subject: How to JOIN 2 different file with out any common column.
Can we join the below different Lrecl and record into a single file with out any common column. The thing is File-1 and File-2's counts are same. File-1's first record should map with File-2's first record, then second record should map with second record and so on.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Wed Apr 22, 2009 2:33 pm Post subject:
hisabarinath,
Concatenate a 1 line header between for each as shown and concatenate them together to SORTIN. using Group function we club the File-1's first record should map with File-2's first record, then second record should map with second record and so on.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
HDR
// DD *
A
B
C
D
E
// DD *
HDR
// DD *
X1
X2
X3
X4
X5
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'HDR'),
PUSH=(81:SEQ=8,ID=1)),
IFTHEN=(WHEN=(89,1,ZD,EQ,2),BUILD=(2:1,79,81,9))
SORT FIELDS=(81,8,CH,A)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum