kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Feb 06, 2014 3:44 pm Post subject: |
|
|
Vak255,
It would have been good if you had provided the DCB properties of the files involved. I assumed the following
1. File 1 : DCB =(LRECL=80,RECFM=FB)
2. File 2 : DCB=(LRECL=200,RECFM=FB)
3. Both files have the pre-sorted Match ie.
4. File 1 key start position 1 for length of 12
5. File 2 key start position 22 for a length of 2 and position 25 for a length of 5 and position 31 for a length of 5 for a total key length of 12 bytes
6. The match key in the report file has 'STORE' in the first 5 bytes.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD DISP=SHR,DSN=Your input report file FB200
//INB DD *
000000000001 00000 MMM
000000000042 02222 MMM
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(201,12,A),SORTED,NOSEQCK
JOINKEYS F2=INB,FIELDS=(001,12,A),SORTED,NOSEQCK
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,200,?)
INREC IFOUTLEN=200,
IFTHEN=(WHEN=(1,5,CH,EQ,C'STORE',AND,201,1,CH,EQ,C'B'),
OVERLAY=(123:C'*** RANDOM WEIGHT***'))
//*
//JNF1CNTL DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,5,CH,EQ,C'STORE'),
PUSH=(201:22,2,25,5,31,5))
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|