purushottam
New User
Joined: 26 Feb 2007 Posts: 37 Location: pune
|
|
|
|
Please help me with the below task
I need to compare two PS files and get the matching records in output but one of the Input is CSV file. Input records looks something like below
Input1:
000999ABC
263748XYZ
It's a FB file with LREC of 9 and key position is 1 to 6
Input2:
999;ABC;NAME......
263748;XYZ;NAME.....
It's a FB file with LREC of 80. Key position is 1 to 6, But as for the first record it contains only 999 but not the laeding 0's and not even trailing spaces.
Output I need is
000999
263748
Thanks,
Puru |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
purushottam,
The following DFSORT JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD DSN=Your 9 byte input fb file,DISP=SHR
//INB DD DSN=your 80 byte csv file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(1,6,A)
JOINKEYS F2=INB,FIELDS=(1,6,A)
REFORMAT FIELDS=(F1:1,9)
//JNF2CNTL DD *
INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=6)),
BUILD=(%00,UFF,M11,LENGTH=6)
//* |
|
|