View previous topic :: View next topic
|
Author |
Message |
CICS fan
New User
Joined: 03 Apr 2008 Posts: 82 Location: United States
|
|
|
|
I have two input files. fileA and File B.
Record length and layout are different for these two files.
Both Filea and File B contains carrier code and flight number
For file A, carrier code is at postion 1, length2
for fileB, its pos 120, length 2
for filea, flt number is pos3, length 4
for fileB, its pos 122, length 4
but for file B its in binary format and filea its displayable format
Requirement is whenver flight number AND carrier code of a rec in file B matches flt num AND carrier code of FileB, write fileB rec into fileC .If not matches write into FileD. |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
U can use joinkeys like below. Change the code with ur record position
THIS JCL WILL PRODUCE OUTPUT IF THE RECORD FROM F1 IS NOT FOUND IN F2.
//SORTTOOL EXEC PGM=SORT
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=DEV2.RK.TEST(SSN),DISP=SHR
//SORTJNF2 DD DSN=DEV2.RK.TEST(SSNS17),DISP=SHR
//SORTOUT DD DSN=DEV2.RK.TEST(SSNCMP),DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,9,A)
JOINKEYS FILES=F2,FIELDS=(1,9,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,80)
/*
//*
Regards
R KARTHIK |
|
Back to top |
|
|
CICS fan
New User
Joined: 03 Apr 2008 Posts: 82 Location: United States
|
|
|
|
But I need two output files,one for matched records and another for unmatched |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Hello CICS fan,
Please provide details of how your input and output looks like. ALso which sort product is installed in your site? DFSORT or SYNCSORT?
do search the forums for examples, try and then post the issues/errors that you face. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
CICS fan wrote: |
Reqrmnt is whenver flt number AND carrier code of a rec in file B matches flt num AND carrier code of FileB, write fileB rec into fileC .If not matches write into FileD. |
I assume you mean if both carrier code and flight number from File A matches File B, then write the record from File B to File C. However, I am not clear which records you want written to file D - only the unmatched from file B, or the unmatched from File A and File B written to File D? |
|
Back to top |
|
|
|