MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Overlay data

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
erasani
Beginner


Joined: 02 Oct 2021
Posts: 17
Topics: 7

PostPosted: Tue Jul 12, 2022 5:06 pm    Post subject: Overlay data Reply with quote

Hi,

Can some one please help me with the bleow. Record 1(Positions 4-8) in first file should be overlaid with second file(Positions 1-5) and write into output file. There is no matching criteria between these files. Input files will always have same number of records.

Input File 1
Code:

001CARD0.........
002CARD1.........
003CARD2.........
004CARD3.........
005CARD4.........


Input File 2

Code:

CARD5
CARD6
CARD7
CARD8
CARD9


Output File

Code:

001CARD5.........
002CARD6.........
003CARD7.........
004CARD8.........
005CARD9.........
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Tue Jul 12, 2022 8:37 pm    Post subject: Reply with quote

erasani,


You can use Joinkeys to create a psuedo key and merge based on that.

Untested DFSORT JCL which will give you the desired results. Since you haven't provided DCB properties of the input files I assumed them to be FB recfm and 80 bytes in length
Code:

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//INA      DD *                                 
001CARD0.........                               
002CARD1.........                               
003CARD2.........                               
004CARD3.........                               
005CARD4.........                               
//INB      DD *                                 
CARD5                                           
CARD6                                           
CARD7                                           
CARD8                                           
CARD9                                           
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                 
  OPTION COPY                                   
  JOINKEYS F1=INA,FIELDS=(81,8,A),SORTED,NOSEQCK
  JOINKEYS F2=INB,FIELDS=(06,8,A),SORTED,NOSEQCK
  REFORMAT FIELDS=(F1:01,03,                     
                   F2:01,05,                     
                   F1:09,72)                     
/*                                               
//JNF1CNTL DD *                                 
  INREC OVERLAY=(81:SEQNUM,8,ZD)                 
/*                                               
//JNF2CNTL DD *                                 
  INREC BUILD=(01,05,SEQNUM,8,ZD)               
/*                                               

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
erasani
Beginner


Joined: 02 Oct 2021
Posts: 17
Topics: 7

PostPosted: Tue Jul 12, 2022 8:56 pm    Post subject: Reply with quote

As usual, you're the best..Thanks Kolusu
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group