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
 

 

SORT File Compare

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Tue Feb 07, 2012 12:47 am    Post subject: SORT File Compare
Reply with quote

Hi All,

Could anyone please help me in doing a file compare,

Both the Input Files
LRECL = 4079, FB

Output File
LRECL = 4080, FB

The key of the Input files starts from Position 1 to 18. Need to verify the keys from both the file

1)If the key is present in both of them, need to compare for the rest of the values of the file (Position 19 to 4060). If the values are same needs to skip the record and if there are any modification, the output file should append with a letter (U) along with the File-2 values. So the LRECL will be 4080.

2) If the key record is present in File-1 and not in File-2, then in the output file the letter (D) will be appended along with the record from File-1.

3) If the Key record is not present in File-1 and present in File-2 then the letter (I) will be appended along with the record from File-2.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Feb 07, 2012 1:25 am    Post subject: Reply to: SORT File Compare
Reply with quote

Can you post the ICE201I message from any old sort jobstep you have lying around, please, we can tell what functions you have available before providing something and then you say "it doesn't work"?

I'd go for A(dd), C(hange), D(elete). You can always sort and have an Add, Change and Delete in a single day. 'Cept you've not got duplicates have you? You're just doing start-of-day to end-of-day, not worrying about how many times...
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Feb 07, 2012 2:33 am    Post subject:
Reply with quote

niki,

Use the following DFSORT JCL which will give you the desired results
Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//INA      DD DSN=Your input 4079 lrecl file,DISP=SHR
//INB      DD DSN=Your input 4080 lrecl file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  JOINKEYS F1=INA,FIELDS=(1,18,A)                                     
  JOINKEYS F2=INB,FIELDS=(1,18,A)                                     
  JOIN UNPAIRED                                                       
  REFORMAT FIELDS=(F1:1,4079,?,F2:1,4079)
                             
  INREC IFOUTLEN=4080,                                                 
  IFTHEN=(WHEN=(4080,1,CH,EQ,C'1'),OVERLAY=(4080:C'D')),               
  IFTHEN=(WHEN=(4080,1,CH,EQ,C'2'),BUILD=(4081,4079,C'I')),           
  IFTHEN=(WHEN=(4080,1,CH,EQ,C'B',AND,                                 
               ((0019,256,CH,EQ,4099,256,CH),AND,                     
                (0275,256,CH,EQ,4355,256,CH),AND,                     
                (0531,256,CH,EQ,4611,256,CH),AND,                     
                (0787,256,CH,EQ,4867,256,CH),AND,                     
                (1043,256,CH,EQ,5123,256,CH),AND,                     
                (1299,256,CH,EQ,5379,256,CH),AND,                     
                (1555,256,CH,EQ,5635,256,CH),AND,                     
                (1811,256,CH,EQ,5891,256,CH),AND,                     
                (2067,256,CH,EQ,6147,256,CH),AND,                     
                (2323,256,CH,EQ,6403,256,CH),AND,                     
                (2579,256,CH,EQ,6659,256,CH),AND,                     
                (2835,256,CH,EQ,6915,256,CH),AND,                     
                (3091,256,CH,EQ,7171,256,CH),AND,                     
                (3347,256,CH,EQ,7427,256,CH),AND,                     
                (3603,256,CH,EQ,7683,256,CH),AND,                     
                (3859,220,CH,EQ,7939,220,CH))),OVERLAY=(4080:C'S')),   
  IFTHEN=(WHEN=NONE,OVERLAY=(19:4099,4061,C'U'))                       

  OUTFIL OMIT=(4080,1,CH,EQ,C'S')                                     
//*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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