File Match problem



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

File Match problem

Postby shailaja85 » Tue Feb 14, 2012 9:03 pm

please help me

File-1
----+----1--
AAAA
BBBB
CCCC
DDDD


File-2
----+----1--
AAAA 1111
CCCC 2222
DDDD 3333


Expected Output
“BBBB is not there in file-B” in SYSOUT


File-1 has to match with file-2, the below are my requirements

1. If field of file-1 is there in file-2 to then entire file-2 record has to move to output file
2. If field of file-1 is NOT there in file-2 to then job has to abend and error message has to come in SYSOUT saying that “BBBB is not there in file-B”
shailaja85
 
Posts: 20
Joined: Fri Feb 10, 2012 5:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File Match problem

 

Re: File Match problem

Postby Robert Sample » Tue Feb 14, 2012 9:41 pm

Since you are not consistent in what you want, how do you expect anybody to help you?

According to your requirement
2. If field of file-1 is NOT there in file-2 to then job has to abend and error message has to come in SYSOUT saying that “BBBB is not there in file-B”
the records CCCC and DDDD would not appear in your output file. ABEND is a very specific term that means the job stops running immediately, hence neither CCCC nor DDDD would be looked at on the input side, and would not show up on the output side.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: File Match problem

Postby shailaja85 » Tue Feb 14, 2012 10:01 pm

Hi Robert Sample

Sorry for insufficient data.

If key of file-1 is NOT there in file-2 then job has to abend and error message has to come in SYSOUT saying that “BBBB is not there in file-B”

In the above case I am not expecting any data into output file.(execution of job has to stop as soon as if key is NOT found in file-2 )
In the above example I am treating first 4 bytes of file-1 and file-2 as KEY
My intension is until and unless file-2 is updated with all keys job should not run successfully
And SYSOUT has to have information at which key of file-1 is abended, and message has to come in SYSOUT as
“BBBB is not there in file-B”
shailaja85
 
Posts: 20
Joined: Fri Feb 10, 2012 5:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File Match problem

Postby bodatrinadh » Wed Feb 15, 2012 12:48 am

Shailaja,

It is not possible to compare and abend the job using Syncsort
For reference check this link.
syncsort-synctool/topic1281.html#p5032

You need to add one more step to your job for force abending

Thanks
-3nadh
Thanks
-3nadh
User avatar
bodatrinadh
 
Posts: 67
Joined: Thu Jan 12, 2012 9:05 pm
Has thanked: 0 time
Been thanked: 4 times

Re: File Match problem

Postby MrSpock » Wed Feb 15, 2012 4:38 am

Two files that need to be matched-up based on a common key. Sounds like a typical JOINKEYS situation.

shailaja85, do you not agree, or am I over-simplifying this?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: File Match problem

Postby NicC » Wed Feb 15, 2012 1:52 pm

Why do you want to abend after the first error is found? It is more efficient to find ALL errors and then abend so that all errors can be fixed at one time.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: File Match problem

Postby shailaja85 » Wed Feb 15, 2012 10:34 pm

Thanks for your kind inputs/points

Hi Nic,
Yes it is really good idea to abend after processing of all recoreds, So that I can update all records at a time.
Can you please provide the sort card for that?

Hi Bodatrinadh,
It is OK to have more than one step to achieve the above said logic
Can you please provide the sort card for that?
shailaja85
 
Posts: 20
Joined: Fri Feb 10, 2012 5:52 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File Match problem

Postby bodatrinadh » Thu Feb 16, 2012 8:01 pm

Try this

//STEP1    EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTJNF1 DD *                                                     
AAAA                                                               
BBBB                                                               
CCCC                                                               
DDDD                                                               
//SORTJNF2 DD *                                                     
AAAA 1111                                                           
CCCC 2222                                                           
DDDD 3333                                                           
//SORTOF01 DD SYSOUT=*                                             
//SORTOF02 DD DSN=&&TEMP,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)       
//SYSIN    DD *                                                     
 JOINKEYS FILE=F1,FIELDS=(1,4,A)                                   
 JOINKEYS FILE=F2,FIELDS=(1,4,A)                                   
 JOIN UNPAIRED,F1,ONLY                                             
 SORT FIELDS=COPY                                                   
 OUTFIL FILES=01,                                                   
        OUTREC=(1,4,X,C'IS NOT THERE IN FILE-B')                 
 OUTFIL FILES=02,                                               
        OUTREC=(1,4,X,C'IS NOT THERE IN FILE-B') 
//*                                                             
//SORT2 EXEC PGM=IDCAMS                                         
//IN01    DD DISP=SHR,DSN=&&TEMP                                 
//OUT01   DD SYSOUT=*                                           
//SYSOUT  DD SYSOUT=*                                           
//SYSPRINT DD SYSOUT=*                                           
//SYSIN   DD *                                                   
   PRINT INFILE(IN01) COUNT(1)                                   
   IF LASTCC EQ 0 THEN  -                                         
   SET MAXCC = 12                                                 
   ELSE IF LASTCC EQ 4 THEN  -                                   
  SET MAXCC = 0                                                 
                                   


Thanks
-3nadh
Thanks
-3nadh
User avatar
bodatrinadh
 
Posts: 67
Joined: Thu Jan 12, 2012 9:05 pm
Has thanked: 0 time
Been thanked: 4 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post