Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Join two files with different number of records

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

New User


Joined: 21 Feb 2006
Posts: 24

PostPosted: Mon Sep 27, 2010 2:28 pm    Post subject: Join two files with different number of records
Reply with quote

Hello,

I´ve got two files, File A (lrecl=80,recfm=fb) and that contains:
COLS> ----+----1----+
****** ***************
000001 002 CCCCC
000002 000 KKKKK
000003 004 GGGGG
and file B (lrecl=80,recfm=fb) contains:
COLS> ----+----1
****** **********
000001 2010-09-24
****** **********
and the output I want to find is:
COLS> ----+----1----+----2----+----3
****** **********************
000001 2010-09-24 002 CCCCC
000002 2010-09-24 000 KKKKK
000003 2010-09-24 004 GGGGG

How can I do this?. Thanks very much.

Iratxe
Back to top
View user's profile Send private message

prahalad

New User


Joined: 14 Sep 2010
Posts: 18
Location: Pune

PostPosted: Mon Sep 27, 2010 4:54 pm    Post subject:
Reply with quote

It seems your file B has a record which contains a date field. You want to append that date in each record in file A. For doing this you can use the following code:
Code:

//STPU080   EXEC PGM=SORT           
//SORTJNF1  DD *                   
002 CCCCC                           
000 KKKKK                           
004 GGGGG                           
//SORTJNF2  DD *                   
2010-09-24                         
//JNF1CNTL  DD *                   
  INREC OVERLAY=(81:C'1')           
//JNF2CNTL  DD *                   
   INREC OVERLAY=(81:C'1')           
//SORTOUT   DD SYSOUT=*             
//SYSIN     DD *                   
  JOINKEYS FILES=F1,FIELDS=(81,1,A),SORTED
  JOINKEYS FILES=F2,FIELDS=(81,1,A),SORTED 
  JOIN UNPAIRED,F1                   
  REFORMAT FIELDS=(F2:1,11,F1:1,80)   
  SORT FIELDS=COPY                   
//SYSOUT   DD SYSOUT=*               
Back to top
View user's profile Send private message
Iratxe

New User


Joined: 21 Feb 2006
Posts: 24

PostPosted: Mon Sep 27, 2010 5:39 pm    Post subject: Reply to: Join two files with different number of records
Reply with quote

Thanks very much. It's perfect.

Iratxe
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us