Hello,
I have to create a report in which i need to join two file and put the match record in the output also the unmatched record of the first file must be in output file.I am using the sort but it is not working as per the expectation.First file has the record length 400 and second file has the record length 450.
job and card.
//STEP21 EXEC PGM=SORT
//SORTJNF1 DD DSN=first input file ,DISP=SHR
//SORTJNF2 DD DSN=second input file,DISP=SHR
//SORTOF02 DD DSN=ARCHIVES.YR2009.OUTPUT.UN,DISP=SHR
//SORTOF01 DD DSN=ARCHIVES.YR2009.OUTPUT1,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(109,9,A)
JOINKEYS FILE=F2,FIELDS=(2,9,A)
REFORMAT FIELDS=(F1:1,400,F2:1,450),FILL=X'FF'
JOIN UNPAIRED
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOF01,INCLUDE=(401,1,BI,EQ,X'FF'),OUTREC=(1,400)
OUTFIL FNAMES=SORTOF02,INCLUDE=(1,1,BI,NE,X'FF',AND,97,1,CH,NE,X'FF'),
OUTREC=(1,97,415,30,400:X)
My requirement is that the record count of the first file is equal to record count of output file (match and unmatched records). Could you please help me out of this problem.
Thanks
Bodhi.
Need to write the match and unmatched record in the output
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Need to write the match and unmatched record in the output
Hello,
Post some sample from both input files as well as what you want for output (data, counts, etc).
You don't need to post complete records, only enough data to show your requirement and the rules that are to be followed.
Use copy/paste and the "Code" tag to post code, jcl, data or anything else that you want to make readable (code can preserve alignment). Use Preview to see your post as the forum will see it - when you are satisfied with the appearance, Submit.
Post some sample from both input files as well as what you want for output (data, counts, etc).
You don't need to post complete records, only enough data to show your requirement and the rules that are to be followed.
Use copy/paste and the "Code" tag to post code, jcl, data or anything else that you want to make readable (code can preserve alignment). Use Preview to see your post as the forum will see it - when you are satisfied with the appearance, Submit.
Hope this helps,
d.sch.
d.sch.
Re: Need to write the match and unmatched record in the output
Hello Dick,
First file record: total records (11)
0000023100,93,061214,V3, ,C,BCGFA , 50405.02
0000023100,93,061214,V3, ,C,BCGFA , 50405.02
0000023100,93,061215,V3, ,C,BCGFA , 50405.02
0000023100,93,061215,V3, ,C,BCGFA , 50405.02
0000023100,93,061221,V3, ,C,BCGFA , 50405.02
0000023100,93,061220,V3, ,C,BCGFA , 50405.02
0000023100,93,061220,V3, ,C,BCGFA , 50405.02
0000023100,93,061220,V3, ,C,BCGFA , 50405.02
0000023101,AH,061221,V3, ,C,BCUZA , 48045.41
0000023101,AH,061221,V3, ,C,BCUZC , 48045.41
0000023101,AH,061221,V3, ,C,BCUZA , 48045.41
Second file record: total record(2)
0BCGFA NBRUIN ENGINEERED PARTS INC
0BCUZC NTINNERMAN PALNUT ENGINEERED PRODUCT
Expected output is :total record(11) matched and unmatched both
0000023100,93,061214,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061214,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061215,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061215,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061221,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061220,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061220,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061220,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023101,AH,061221,V3, ,C,BCUZA , 48045.41
0000023101,AH,061221,V3, ,C,BCUZC , 48045.41,NTINNERMAN PALNUT ENGINEERED PRODUCT
0000023101,AH,061221,V3, ,C,BCUZA , 48045.41
hopes this will help
Bodhi
First file record: total records (11)
0000023100,93,061214,V3, ,C,BCGFA , 50405.02
0000023100,93,061214,V3, ,C,BCGFA , 50405.02
0000023100,93,061215,V3, ,C,BCGFA , 50405.02
0000023100,93,061215,V3, ,C,BCGFA , 50405.02
0000023100,93,061221,V3, ,C,BCGFA , 50405.02
0000023100,93,061220,V3, ,C,BCGFA , 50405.02
0000023100,93,061220,V3, ,C,BCGFA , 50405.02
0000023100,93,061220,V3, ,C,BCGFA , 50405.02
0000023101,AH,061221,V3, ,C,BCUZA , 48045.41
0000023101,AH,061221,V3, ,C,BCUZC , 48045.41
0000023101,AH,061221,V3, ,C,BCUZA , 48045.41
Second file record: total record(2)
0BCGFA NBRUIN ENGINEERED PARTS INC
0BCUZC NTINNERMAN PALNUT ENGINEERED PRODUCT
Expected output is :total record(11) matched and unmatched both
0000023100,93,061214,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061214,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061215,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061215,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061221,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061220,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061220,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023100,93,061220,V3, ,C,BCGFA , 50405.02, NBRUIN ENGINEERED PARTS INC
0000023101,AH,061221,V3, ,C,BCUZA , 48045.41
0000023101,AH,061221,V3, ,C,BCUZC , 48045.41,NTINNERMAN PALNUT ENGINEERED PRODUCT
0000023101,AH,061221,V3, ,C,BCUZA , 48045.41
hopes this will help
Bodhi
-
- Global moderator
- Posts: 369
- Joined: Tue Feb 26, 2008 11:15 pm
- Skillset: Syncsort MFX for z/OS
- Referer: Dick Scherrer
- Location: USA
- Contact:
Re: Need to write the match and unmatched record in the output
Try changing your first OUTFIL INCLUDE statement to the following:
Let me know if this gives you the desired output. If not, let me know and I would be happy to assist you further.
Code: Select all
OUTFIL FNAMES=SORTOF01,INCLUDE=(1,1,BI,NE,X'FF'),OUTREC=(1,400)
Let me know if this gives you the desired output. If not, let me know and I would be happy to assist you further.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Copy partial record after a string in a record using SORT.
by Esmayeelhusen » Thu May 04, 2023 3:03 pm » in DFSORT/ICETOOL/ICEGENER - 16
- 4267
-
by Esmayeelhusen
View the latest post
Mon May 22, 2023 3:50 pm
-
-
- 3
- 2708
-
by sergeyken
View the latest post
Sat Nov 16, 2024 11:05 pm
-
-
regarding COBOL WRITE verb (VB File Handling)
by anonguy456 » Mon Jun 28, 2021 5:57 pm » in IBM Cobol - 6
- 3860
-
by Robert Sample
View the latest post
Tue Jun 29, 2021 11:33 pm
-
-
- 3
- 2781
-
by willy jensen
View the latest post
Tue Jun 29, 2021 1:36 pm
-
- 11
- 3689
-
by willy jensen
View the latest post
Thu Oct 15, 2020 1:25 am