IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File comparison using sort card.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krsenthil85

New User


Joined: 31 Aug 2007
Posts: 55
Location: bangalore

PostPosted: Wed Mar 31, 2010 5:06 pm
Reply with quote

I have two input files File A (LRECL 100, KEY - 13,14) and File B (LREC 124, KEY - 6,14)

Compare File A and File B, if the records are found in both files Write the record from File A to output file and update the 58th position as 'B'

If the record from File A not Present in File B, just copy the record from FileA to Output file without any change.

Please let me know the sort card step for this.

Thanks,
Senthil.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 31, 2010 8:53 pm
Reply with quote

Hello,

Post some sample input data and the output you want from that input.

Also mention the recfm and lrecl of the output and how the output should be formatted - the inputs are different lrecls. . .
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Apr 01, 2010 9:38 pm
Reply with quote

Try the following SyncSort for z/OS JOIN application:
Code:
//SORT1  EXEC PGM=SORT                         
//SORTJNF1 DD DSN=FILE1                               
//SORTJNF2 DD DSN=FILE2                               
//SORTOUT  DD SYSOUT=*                         
//SYSOUT   DD SYSOUT=*                           
//SYSIN    DD *                                   
  JOINKEYS FILE=F1,FIELDS=(13.14,A)             
  JOINKEYS FILE=F2,FIELDS=(6,14,A)             
  JOIN UNPAIRED,F1                               
  REFORMAT FIELDS=(F1:1,100,F2:1,1)
  SORT FIELDS=COPY
  OUTREC IFTHEN=(WHEN=(101,1,CH,NE,C' '),BUILD=(1,57,C'B',59,42)),
         IFTHEN=(WHEN=NONE,BUILD=(1,100))
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top