Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Is it possible to compare two files ignoring last suffix

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

New User


Joined: 30 Jun 2005
Posts: 33
Location: Germany

PostPosted: Mon Apr 13, 2020 8:33 am    Post subject: Is it possible to compare two files ignoring last suffix
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: 292
Location: Bamberg, Germany

PostPosted: Mon Apr 13, 2020 10:47 am    Post subject:
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: 33
Location: Germany

PostPosted: Mon Apr 13, 2020 12:43 pm    Post subject: Reply to: Is it possible to compare two files ignoring last suffix
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: 292
Location: Bamberg, Germany

PostPosted: Mon Apr 13, 2020 1:00 pm    Post subject:
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    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 REXX tool to extract all files starti... KeshavKunal CLIST & REXX 4 Tue Jul 21, 2020 3:43 pm
No new posts PKZIP - extracting multiple txt files drarem All Other Mainframe Topics 3 Tue Jul 07, 2020 8:47 pm
No new posts Compare multiple files using JCL/Rexx... tanvi110788 JCL & VSAM 4 Tue May 19, 2020 5:47 pm
No new posts Need help to concatenate files with w... ssuthagar All Other Mainframe Topics 3 Fri May 15, 2020 1:39 am
No new posts Compare Two datasets and Override Mat... ArunkumarGanesan DFSORT/ICETOOL 7 Mon Apr 27, 2020 7:45 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us