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

JCL to compare 2 files using SYNCSORT


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

New User


Joined: 08 Jan 2008
Posts: 18
Location: delhi

PostPosted: Thu Jan 10, 2008 8:22 pm
Reply with quote

I need a SYNCSORT job which compares first 34 characters from two input files and creates a ouput file which contains no matches in file 1.

LRECL OF FRST FILE:195
LRECL OF SECOND FILE:195
LRECL OF OUTPUT FILE:195
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Jan 10, 2008 10:45 pm
Reply with quote

Code:
//*********************************
//SORT1    EXEC PGM=SYNCSORT       
//SORTJNF1 DD DSN=FILE-1           
//SORTJNF2 DD DSN=FILE-2           
//SYSOUT   DD SYSOUT=*             
//SORTOUT DD DSN=O/P FILE         
//SYSIN    DD *                   
 JOINKEYS FILE=F1,FIELDS=(1,34,A) 
 JOINKEYS FILE=F2,FIELDS=(1,34,A) 
 JOIN UNPAIRED,F1,ONLY             
 REFORMAT FIELDS=(F1:1,195)       
 SORT FIELDS=COPY                 
//*                               
Back to top
View user's profile Send private message
rohit510

New User


Joined: 08 Jan 2008
Posts: 18
Location: delhi

PostPosted: Fri Jan 11, 2008 11:56 am
Reply with quote

Thanks for the reply kRISPREMs
but its not working for me.Its abending with U00016.
Warning being generated is SORTOUT not defined.
can you please help me in solving this kRISPREMs
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Fri Jan 11, 2008 12:29 pm
Reply with quote

Quote:
but its not working for me
Which version of Syncsort you are running?
Back to top
View user's profile Send private message
rohit510

New User


Joined: 08 Jan 2008
Posts: 18
Location: delhi

PostPosted: Fri Jan 11, 2008 7:11 pm
Reply with quote

Its working fine now.
what can i do to fill the first two fields in output file with spaces alone.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat Jan 12, 2008 5:47 pm
Reply with quote

replace the REFORMAT statement like this
Code:
REFORMAT FIELDS=(C'  ',F1:3,195)   


Its an untested suggestion. Please let us know if you have any problem in using this
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top