prem_ibm
New User
Joined: 15 Sep 2007 Posts: 31 Location: Chennai
|
|
|
|
Hi All,
Hope every one doing good...
i faced one complexity as below :--
First : Input file contain Header/Detail/Trail records..it means start
with (11/00/99).
Second : Input file contain Normal records..without Header/Detail/Trailer.
As per the SORT JOIN KEY.....we can get the matching records present in both the files...
1) But the Header & Trailer records not having comparison field,so in this
case these two records that is HEADER & TRAILER records will be
excluded.
is there any way to get those reocrds in o/p file as well...bcz this file
will be using in some other appliation too..
2) First input file is Fixed length.....this is not an issue.
2nd input file is Variable file......current maximum length is 1696...but
it can be diffrent next time.....importent thing is we are intrested entire
lenth of the reocrd.
3) How the O/p file length we need to specify if its creating new
1) can we referback the DCB & SPACE parameter of 2nd input file.
4) Input file may be having Hudgge records....to avoid SB37 abend for
O/P file creation what are precaution needs to be considerd apart from
maximum space..SORTWORK FILE...etc.
please provide u r suggestion/advise on the Point 1 ,2 and 4.
Thanks
Prem |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
prem_ibm,
The following DFSORT JCL will give you the desired results. I assumed that your VB file also have header and trailer in pos 5 ( after 4 byte rdw). The matching key in VB file is at 70 (considering the RDW)
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//FBFILE DD DSN=your input fb file with key at pos 10,DISP=SHR
//VBFILE DD DSN=your input vb file with key at pos 70,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=FBFILE,FIELDS=(1,2,A,10,8,A)
JOINKEYS F2=VBFILE,FIELDS=(5,2,A,07,8,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F2:1,4,?,F2:15)
OUTFIL INCLUDE=(5,1,CH,EQ,C'B'),BUILD=(1,4,6)
//JNF1CNTL DD *
INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'11'),OVERLAY=(1:2X))
//JNF2CNTL DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5,2,70,8,5)),
IFTHEN=(WHEN=(15,2,CH,EQ,C'11'),OVERLAY=(5:2X))
//* |
|
|