Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort Set the indicator to know match found or not

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Sriramhari

New User


Joined: 11 May 2009
Posts: 17
Location: Bangalore

PostPosted: Wed Oct 23, 2013 4:09 pm    Post subject: Syncsort Set the indicator to know match found or not
Reply with quote

File-1 looks like (VB file)
Code:

123AINFO1
123BINFO2
123CINFO3
124AINFO1
125BINFO2
127AINFO1


File-2 looks like
Code:

123F
124F
125F
128F


Expected Output
Code:

123AYINFO1
123BINFO2
123CINFO3
124AYINFO1
125AYINFO1
125BINFO2
127ANINFO1


Condition:
Output file need to have all the records from F1 (UNPAIRED,F1)
If Match found in File 2
If File-1 record's 4th Char is A,
Set the indicator 'Y' in 5th position
Else
Set the indicator 'N' in 5th position

if File1 record's 4th Character not='A' then No change.

How to Set the indicator as Y or N..?
Is it possible to do it in Sort using Joinkeys..? Any inputs.

Thanks,
R. Vidhya.
Back to top
View user's profile Send private message

bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Wed Oct 23, 2013 4:22 pm    Post subject: Reply to: JoinKeys and set the indicator to know match found
Reply with quote

Hi Vidhya...

Why "125" is repeated twice ? it has one record in File 1...any specific reason?

Thanks
-3nadh
Back to top
View user's profile Send private message
Sriramhari

New User


Joined: 11 May 2009
Posts: 17
Location: Bangalore

PostPosted: Wed Oct 23, 2013 4:27 pm    Post subject:
Reply with quote

Hi Bodatrinadh,
Thanks for the observation. File-1 looks like
Code:

123AINFO1
123BINFO2
123CINFO3
124AINFO1
125AINFO1
125BINFO2
127AINFO1


Thanks,
R. Vidhya
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Oct 23, 2013 4:31 pm    Post subject:
Reply with quote

Just wanted to confirm whether you are using DFSORT or Syncsort? From one of your old post, it looks like you have Syncsort.
Back to top
View user's profile Send private message
Sriramhari

New User


Joined: 11 May 2009
Posts: 17
Location: Bangalore

PostPosted: Wed Oct 23, 2013 4:42 pm    Post subject: Reply to: JoinKeys and set the indicator to know match found
Reply with quote

Hi Mistah kurtz

yes, it is SyncSort.

Thanks,
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Oct 23, 2013 5:32 pm    Post subject:
Reply with quote

Hi Sriramhari
Assuming that all the files are FB and LRECL 80.
Please check the below job.
Code:
//STEP01   EXEC PGM=SORT                       
//SORTJNF1 DD *                               
123AINFO1                                     
123BINFO2                                     
123CINFO3                                     
124AINFO1                                     
125BINFO2                                     
127AINFO1                                     
//SORTJNF2 DD *                               
123F                                           
124F                                           
125F                                           
128F                                           
//SORTOUT  DD SYSOUT=*                         
//SYSOUT   DD SYSOUT=*                         
//SYSIN    DD *                               
    JOINKEYS FILE=F1,FIELDS=(1,3,A)           
    JOINKEYS FILE=F2,FIELDS=(1,3,A)           
    JOIN     UNPAIRED,F1                       
    REFORMAT FIELDS=(F1:1,9,F2:1,3),FILL=C'?' 
    OPTION   COPY                             
    INREC    IFTHEN=(WHEN=(10,3,CH,NE,C'???'),
                     BUILD=(1,4,5:C'Y',6:5,5)),
             IFTHEN=(WHEN=NONE,BUILD=(1,9))   


Output:
Code:
123AYINFO1
123BYINFO2
123CYINFO3
124AYINFO1
125BYINFO2
127AINFO1
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Oct 23, 2013 5:34 pm    Post subject:
Reply with quote

Sriramhari,

File 1 is FB or VB??
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Wed Oct 23, 2013 5:44 pm    Post subject: Reply to: JoinKeys and set the indicator to know match found
Reply with quote

Try this code -

Assuming LREC=10 and FB for F1 and F2.

Code:

//SYSOUT   DD SYSOUT=*                                       
//SORTJNF1 DD *                                               
123AINFO1                                                     
123BINFO2                                                     
123CINFO3                                                     
124AINFO1                                                     
125AINFO1                                                     
125BINFO2                                                     
127AINFO1                                                     
//SORTJNF2 DD *                                               
123F                                                         
124F                                                         
125F                                                         
128F                                                         
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                               
  JOINKEYS FILES=F1,FIELDS=(1,3,A)                           
  JOINKEYS FILES=F2,FIELDS=(1,3,A)                           
  SORT FIELDS=COPY                                           
  REFORMAT FIELDS=(F1:1,10,F2:1,10)                           
  JOIN UNPAIRED,F1,F2                                         
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,11,3,CH,AND,9,1,ZD,EQ,+1),   
                BUILD=(1,4,C'Y',5,5)),                       
        IFTHEN=(WHEN=(1,3,CH,EQ,11,3,CH,AND,9,1,ZD,NE,+1),   
                BUILD=(1,9)),                                 
        IFTHEN=(WHEN=(1,3,CH,NE,11,3,CH),BUILD=(1,4,C'N',5,5))
                                                             
  OUTFIL OUTREC=(1,10),OMIT=(1,1,CH,EQ,C' ')                 


Output :-

Code:

123AYINFO1
123BINFO2 
123CINFO3 
124AYINFO1
125AYINFO1
125BINFO2 
127ANINFO1


Thanks
-3nadh
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Wed Oct 23, 2013 5:58 pm    Post subject: Reply to: JoinKeys and set the indicator to know match found
Reply with quote

Sorry i did not notice it was a VB file for F1..

Please try this code -

Code:

  JOINKEYS FILES=F1,FIELDS=(5,3,A)                             
  JOINKEYS FILES=F2,FIELDS=(1,3,A)                             
  SORT FIELDS=COPY                                             
  REFORMAT FIELDS=(F1:5,10,F2:1,10)                             
  JOIN UNPAIRED,F1,F2                                           
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,11,3,CH,AND,9,1,ZD,EQ,+1),     
                BUILD=(1,4,C'Y',5,5)),                         
        IFTHEN=(WHEN=(1,3,CH,EQ,11,3,CH,AND,9,1,ZD,NE,+1),     
                BUILD=(1,9)),                                   
        IFTHEN=(WHEN=(1,3,CH,NE,11,3,CH),BUILD=(1,4,C'N',5,5)) 
                                                               
  OUTFIL OUTREC=(1,10),OMIT=(1,1,CH,EQ,C' ')                   


Thanks
-3nadh
Back to top
View user's profile Send private message
Sriramhari

New User


Joined: 11 May 2009
Posts: 17
Location: Bangalore

PostPosted: Thu Oct 24, 2013 11:01 pm    Post subject:
Reply with quote

Hi All,
Thank you for the inputs, FILE-1 is VB; FILE-2 is FB. Sort out file is FB, it should be VB. (don't want to convert FTOV) - it will be two steps. Part of the sort card used:
Code:

JOINKEYS FILE=F1,FIELDS=(06,13,A)   
JOINKEYS FILE=F2,FIELDS=(07,13,A)   
JOIN     UNPAIRED,F1                 
REFORMAT FIELDS=(F1:1,420,F2:1,103) 
   many comparisons...

File-2 values are required for further comparison,
JOINKEYS REFORMAT RECORD LENGTH= 523, TYPE = F
But build records is from File-1. How to include a RDW field in first 4 position.
BUILD=(1,4,X'1C',5,220,C'N',222,108)) -- error either 4X'00' also not working. Any Suggesstions Please.

Thanks,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us