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

Is it possible to compare two files ignoring last suffix


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

New User


Joined: 30 Jun 2005
Posts: 37
Location: Germany

PostPosted: Mon Apr 13, 2020 8:33 am
Reply with quote

File 1: FB,LRECL(80)

ZFS.ONE.VRMN01
ZFS.TWO.THR.VRMN02

File 2: FB,LRECL(80)

ZFS.ONE.VRQN01
ZFS.TWO.THR.VRQN02
ZFS.NONE.VRQN03

Match:

ZFS.ONE
ZFS.TWO.THR

Unmatch:

ZFS.NONE
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 471
Location: Bamberg, Germany

PostPosted: Mon Apr 13, 2020 10:47 am
Reply with quote

Code:
//MAGIC    EXEC PGM=ICEMAN 
//F1       DD *                           
ZFS.ONE.VRMN01                           
ZFS.TWO.THR.VRMN02                       
/*                                       
//F2       DD *                           
ZFS.ONE.VRQN01                           
ZFS.TWO.THR.VRQN02                       
ZFS.NONE.VRQN03                           
/*                                       
//SORTOUT  DD DUMMY SYSOUT=*             
//MATCH    DD SYSOUT=*                   
//NOMATCH  DD SYSOUT=*                   
//SYSIN    DD *                           
  JOINKEYS F1=F1,FIELDS=(1,44,A)         
  JOINKEYS F2=F2,FIELDS=(1,44,A)         
  JOIN UNPAIRED,F2                       
  REFORMAT FIELDS=(F1:1,44,F2:1,44,?)     
  SORT FIELDS=(COPY)                     
  OUTFIL FNAMES=(MATCH),                 
    INCLUDE=(89,1,CH,EQ,C'B'),           
    HEADER1=('Match',/,5C'-'),           
    BUILD=(1,44)                         
  OUTFIL FNAMES=(NOMATCH),SAVE,                                   
    HEADER1=('NoMatch',/,7C'-'),                                   
    BUILD=(45,44)                                                 
/*                                                                 
//JNF1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(45:1,44,JFY=(SHIFT=RIGHT))),   
    IFTHEN=(WHEN=(87,1,CH,EQ,C'.'),OVERLAY=(87:2X,                 
      1:45,44,JFY=(SHIFT=LEFT))),                                 
    IFTHEN=(WHEN=(86,1,CH,EQ,C'.'),OVERLAY=(86:3X,                 
      1:45,44,JFY=(SHIFT=LEFT))),                                 
    IFTHEN=(WHEN=(85,1,CH,EQ,C'.'),OVERLAY=(85:4X,                 
      1:45,44,JFY=(SHIFT=LEFT))),                                 
    IFTHEN=(WHEN=(84,1,CH,EQ,C'.'),OVERLAY=(84:5X,                 
      1:45,44,JFY=(SHIFT=LEFT))),                                 
    IFTHEN=(WHEN=(83,1,CH,EQ,C'.'),OVERLAY=(83:6X,                 
      1:45,44,JFY=(SHIFT=LEFT))),                                 
    IFTHEN=(WHEN=(82,1,CH,EQ,C'.'),OVERLAY=(82:7X,                 
      1:45,44,JFY=(SHIFT=LEFT))),                                 
    IFTHEN=(WHEN=(81,1,CH,EQ,C'.'),OVERLAY=(81:8X,                 
      1:45,44,JFY=(SHIFT=LEFT))),                                 
    IFTHEN=(WHEN=(80,1,CH,EQ,C'.'),OVERLAY=(80:9X,                 
      1:45,44,JFY=(SHIFT=LEFT)))                                   
  END                                                             
/*                                                                 
//JNF2CNTL DD *                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(45:1,44,JFY=(SHIFT=RIGHT))),
    IFTHEN=(WHEN=(87,1,CH,EQ,C'.'),OVERLAY=(87:2X,             
      1:45,44,JFY=(SHIFT=LEFT))),                               
    IFTHEN=(WHEN=(86,1,CH,EQ,C'.'),OVERLAY=(86:3X,             
      1:45,44,JFY=(SHIFT=LEFT))),                               
    IFTHEN=(WHEN=(85,1,CH,EQ,C'.'),OVERLAY=(85:4X,             
      1:45,44,JFY=(SHIFT=LEFT))),                               
    IFTHEN=(WHEN=(84,1,CH,EQ,C'.'),OVERLAY=(84:5X,             
      1:45,44,JFY=(SHIFT=LEFT))),                               
    IFTHEN=(WHEN=(83,1,CH,EQ,C'.'),OVERLAY=(83:6X,             
      1:45,44,JFY=(SHIFT=LEFT))),                               
    IFTHEN=(WHEN=(82,1,CH,EQ,C'.'),OVERLAY=(82:7X,             
      1:45,44,JFY=(SHIFT=LEFT))),                               
    IFTHEN=(WHEN=(81,1,CH,EQ,C'.'),OVERLAY=(81:8X,             
      1:45,44,JFY=(SHIFT=LEFT))),                               
    IFTHEN=(WHEN=(80,1,CH,EQ,C'.'),OVERLAY=(80:9X,             
      1:45,44,JFY=(SHIFT=LEFT)))                               
  END                                                           
/*

Output:
Code:
Match         
-----         
ZFS.ONE       
ZFS.TWO.THR
   
NoMatch       
-------       
ZFS.NONE     
Back to top
View user's profile Send private message
kushkush

New User


Joined: 30 Jun 2005
Posts: 37
Location: Germany

PostPosted: Mon Apr 13, 2020 12:43 pm
Reply with quote

Thanks Joerg, worked perfectly. Learning much from your posts and posts here.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 471
Location: Bamberg, Germany

PostPosted: Mon Apr 13, 2020 1:00 pm
Reply with quote

Sometimes it can be quicker to apply a Pattern or RegEx in ISPF 3.4 for such things. icon_wink.gif

Anyhow, glad it works for you as expected. Thanks for confirming.
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 Print report for each record from mul... CA Products 1
No new posts Get two files from one file with diff... DFSORT/ICETOOL 10
This topic is locked: you cannot edit posts or make replies. I HAVE 2 INPUT FILES WITH SAME LAYOUT... COBOL Programming 6
No new posts exclude the 5 first lines for compare... TSO/ISPF 2
No new posts Compare the file record count percent... DFSORT/ICETOOL 4
Search our Forums:

Back to Top