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 

DFSORT - 2 input files - one ouptut file

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


Joined: 14 Aug 2018
Posts: 2
Topics: 1

PostPosted: Fri Aug 24, 2018 1:58 pm    Post subject: DFSORT - 2 input files - one ouptut file Reply with quote

Input file 1 data:
Code:

2018-07-16


Input file 2 data:
Code:

REC1 DATA
REC2 DATA
REC3 DATA


Desired output:
Code:

2018-07-16 REC1 DATA
2018-07-16 REC2 DATA
2018-07-16 REC3 DATA

How can DFSORT or ICETOOL be used to get the Desired Output?
Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Aug 24, 2018 4:14 pm    Post subject: Reply with quote

BMW1,

Couple of ways. The easiest and simple way is to generate a Symbol for file-1 date and using it in the second step.
Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
2018-07-16                                               
//SORTOUT  DD DSN=&&S,DISP=(,PASS),SPACE=(TRK,(1,0))     
//SYSIN    DD *                                           
  OPTION COPY,STOPAFT=1                                   
  OUTREC BUILD=(C'RDATE,C''',1,10,C'''',80:X)             
//*                                                       
//STEP0200 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SYMNAMES DD DISP=(OLD,PASS),DSN=&&S                     
//SORTIN   DD *                                           
REC1 DATA                                                 
REC2 DATA                                                 
REC3 DATA                                                 
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  OPTION COPY                                             
  INREC BUILD=(RDATE,1,80)                               
//*                                                       


Or you can use JOINKEYS to match on a psuedo key
Code:

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//INA      DD *                                 
REC1 DATA                                       
REC2 DATA                                       
REC3 DATA                                       
//INB      DD *                                 
2018-07-16                                       
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                 
  OPTION COPY                                   
  JOINKEYS F1=INA,FIELDS=(81,1,A),SORTED,NOSEQCK
  JOINKEYS F2=INB,FIELDS=(81,1,A),SORTED,NOSEQCK
  REFORMAT FIELDS=(F2:1,10,F1:1,80)             
//*                                             
//JNF1CNTL DD *                                 
  INREC OVERLAY=(81:X)                           
//*                                             
//JNF2CNTL DD *                                 
  OPTION STOPAFT=1                               
  INREC OVERLAY=(81:X)                           
//*

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


Joined: 14 Aug 2018
Posts: 2
Topics: 1

PostPosted: Mon Aug 27, 2018 11:48 am    Post subject: Reply with quote

Thank You!!!! Both work perfectly!! Appreciate the help!
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