check each record from input1 to mutliple input2 files



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

check each record from input1 to mutliple input2 files

Postby thotlma » Wed Oct 10, 2018 5:05 pm

HI All

i have requirement like this. i have input file1 in that have many records.
i have other 12 input2 files so i have comparae each record from input1 with input2 12 files if any record match then copy to the out out file
i have written below code but it is copying complete records from input2 to out put
i have comparing 1 to 18 lengh from input1 with input2
could you please help me?

STEP001   EXEC PGM=SORT                                        
SORTJNF1  DD DSN=XXX.Q.KR0Z2R99.XXXX.ISA.OUP(0),DISP=SHR  
SORTJNF2  DD DSN=xxx.P.K0101N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K3211N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K2912N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K0618N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K3720N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K4731N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K0242N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K4451N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K1256N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K4560N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K1961N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
          DD DSN=xxx.P.K3290N00.xxxx11P1.xxxxXTO(0),DISP=SHR  
SORTOUT   DD DSN=XXX.Q.KR0Z2R99.XXX.MAT.OUP(+1),          
             DISP=(NEW,CATLG,DELETE),                          
             DCB=(LRECL=261,BLKSIZE=0,RECFM=FB),              
             SPACE=(CYL,(20,10),RLSE)                          
SYSPRINT  DD SYSOUT=*                        
SYSOUT    DD SYSOUT=*                        
SYSIN     DD *                              
 JOINKEYS FILE=F1,FIELDS=(1,18,A)            
 JOINKEYS FILE=F2,FIELDS=(1,18,A)            
 JOIN UNPAIRED,F1,F2                        
 REFORMAT FIELDS=(F2:1,258,F2:264,1,F2:334,2)
 SORT FIELDS=COPY


added the code tags
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: check each record from input1 to mutliple input2 files

Postby enrico-sorichetti » Wed Oct 10, 2018 5:41 pm

help people who spend their time helping You!
good forum manners suggest the use of the code tags when posting mainframe data
( the code tags force the use of a monospaced/fixed font, making code and data snippets more readable )

edited Your post and done it for You
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: check each record from input1 to mutliple input2 files

Postby expat » Wed Oct 10, 2018 5:49 pm

So what have you tried so far and what results have you obtained.
Why do you think that your results are different from expected ?
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: check each record from input1 to mutliple input2 files

Postby thotlma » Wed Oct 10, 2018 9:04 pm

the complete data getting from iput2 to out file ..iam not getting matching records
i will tell the example of my requirement
input1
123456
789456
123789
123458
147852
852963

input2
123789
123458
852963
001245
014789
025847


outfile
123789
123458
852963
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: check each record from input1 to mutliple input2 files

Postby enrico-sorichetti » Thu Oct 11, 2018 2:02 am

what is that You did not understand when I asked You to use the code tags for code and data snippets ?
coded again :evil:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: check each record from input1 to mutliple input2 files

Postby Garry F Carroll » Thu Oct 11, 2018 8:26 pm

Your REFORMAT statement doesn't have the match-marker so you can select which records you want to output. You then don't have control cards to select the records you want to output based on the match-marker.

Garry.
Garry F Carroll
 
Posts: 28
Joined: Wed Sep 19, 2018 8:20 pm
Has thanked: 0 time
Been thanked: 1 time

Re: check each record from input1 to mutliple input2 files

Postby thotlma » Thu Oct 11, 2018 8:55 pm

Hi Gary
see below modfied code..
still not working..the matching records copy to out file

 JOINKEYS FILE=F1,FIELDS=(1,06,A)            
 JOINKEYS FILE=F2,FIELDS=(1,06,A)            
 JOIN UNPAIRED,F1,F2                        
 REFORMAT FIELDS=(f2:1,6)
 SORT FIELDS=COPY


EDITED AGAIN TO USE THE CODE TAGS
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: check each record from input1 to mutliple input2 files

Postby Garry F Carroll » Thu Oct 11, 2018 9:03 pm

you still don't have the match-marker. ( a ? ) in tbe reformat statement & you then need to select the matched records in an outfil statement.

GaRRY.
Garry F Carroll
 
Posts: 28
Joined: Wed Sep 19, 2018 8:20 pm
Has thanked: 0 time
Been thanked: 1 time

Re: check each record from input1 to mutliple input2 files

Postby thotlma » Thu Oct 11, 2018 9:13 pm

please can you send me the code ?
thotlma
 
Posts: 25
Joined: Tue Sep 18, 2018 8:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: check each record from input1 to mutliple input2 files

Postby Garry F Carroll » Fri Oct 12, 2018 1:27 pm

Modify to suit your record length. The '?' is replaced by a '1', '2' or 'B' for file1 only, file2 only or both, respectively in the intermediate record.

REFORMAT FIELDS=(F2:1,6,?)
           OUTFIL INCLUDE=(7,1,CH,EQ,C'2'),BUILD=(1,6)


Garry
Garry F Carroll
 
Posts: 28
Joined: Wed Sep 19, 2018 8:20 pm
Has thanked: 0 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post