MFwhiz
New User
Joined: 21 May 2009 Posts: 5 Location: Philadelphia
|
|
|
|
Hello,
The following sort of two fixed width files creates three output files; one with paired file1/file2 records, one with unpaired file1 records, and one with unpaired file2 records. This uses what is known as the "indicator method":
Code: |
//JKE5 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=TCK401.INPUT1,DISP=SHR
//SORTJNF2 DD DSN=TCK401.INPUT2,DISP=SHR
//YESONLY DD DSN=TCK401.MAS.YESONLY,
// UNIT=(SYSDA,4),SPACE=(CYL,(100,60),RLSE),
// DISP=(NEW,CATLG,CATLG),
// DCB=(RECFM=FB,LRECL=4235,BLKSIZE=0)
//TODONLY DD DSN=TCK401.MAS.TODONLY,
// UNIT=(SYSDA,4),SPACE=(CYL,(100,60),RLSE),
// DISP=(NEW,CATLG,CATLG),
// DCB=(RECFM=FB,LRECL=4235,BLKSIZE=0)
//BOTH DD DSN=TCK401.MAS.BOTH,
// UNIT=(SYSDA,4),SPACE=(CYL,(100,60),RLSE),
// DISP=(NEW,CATLG,CATLG),
// DCB=(RECFM=FB,LRECL=4235,BLKSIZE=0)
//SYSIN DD *
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION
JOINKEYS FILE=F1,FIELDS=(1,80,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(1,80,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,4235,F2:1,4235,?)
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)
OPTION COPY
OUTFIL FNAMES=YESONLY,INCLUDE=(8471,1,CH,EQ,C'1'),
BUILD=(1,4235)
OUTFIL FNAMES=TODONLY,INCLUDE=(8471,1,CH,EQ,C'2'),
BUILD=(4236,4235)
OUTFIL FNAMES=BOTH,INCLUDE=(8471,1,CH,EQ,C'B'),
BUILD=(1,4235,/,4236,4235)
/*
|
My problem now is that the input files have changed to variably blocked. Does anyone know how to convert this sort so that it will work with VB input/output files? Or is there a different sorting method that could be used to produce the same output files (now VB)? The input file keys are still the same. Thank you so much in advance for any help with this. |
|