Need to write the match and unmatched record in the output



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Need to write the match and unmatched record in the output

Postby bodhi » Sun Feb 22, 2009 12:14 pm

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.
bodhi
 
Posts: 53
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need to write the match and unmatched record in the output

 

Re: Need to write the match and unmatched record in the output

Postby dick scherrer » Sun Feb 22, 2009 12:39 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Need to write the match and unmatched record in the output

Postby bodhi » Sun Feb 22, 2009 1:40 pm

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
bodhi
 
Posts: 53
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need to write the match and unmatched record in the output

Postby Alissa Margulies » Wed Feb 25, 2009 2:27 am

Try changing your first OUTFIL INCLUDE statement to the following:

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.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post