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

SORT File Compare


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Tue Feb 07, 2012 12:47 am
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 07, 2012 1:25 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top