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
 

 

Combining files with DFSORT

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

New User


Joined: 31 Oct 2006
Posts: 48
Location: Chennai

PostPosted: Wed Mar 12, 2008 9:40 pm    Post subject: Combining files with DFSORT
Reply with quote

I have 2 files to be combined.

File 1 has the following information:
Cust-no loaninfo
There could be more than 1 record for each customer

File 2 has the following information:
Cust-no street-no city
In this file a customer has only 1 record.
*** Note: Few customers in File 1 may not have records in File 2.

After merging, every record in file 1 should have information from file 2, if available.

e.g.

File 1:
Cust-no1 loaninfo1
Cust-no1 loaninfo2
Cust-no2 loaninfo1
Cust-no3 loaninfo1
Cust-no3 loaninfo2
Cust-no3 loaninfo3
Cust-no3 loaninfo4


File 2:
Cust-no1 street-no1 city1
Cust-no3 street-no3 city3


After merging:
Cust-no1 loaninfo1 street-no1 city1
Cust-no1 loaninfo2 street-no1 city1
Cust-no2 loaninfo1
Cust-no3 loaninfo1 street-no3 city3
Cust-no3 loaninfo2 street-no3 city3
Cust-no3 loaninfo3 street-no3 city3
Cust-no3 loaninfo4 street-no3 city3

Thanks & Regards,
OP
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Mar 12, 2008 10:28 pm    Post subject:
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD *
Cust-no1  loaninfo1
Cust-no1  loaninfo2
Cust-no2  loaninfo1
Cust-no3  loaninfo1
Cust-no3  loaninfo2
Cust-no3  loaninfo3
Cust-no3  loaninfo4
/*
//IN2 DD *
Cust-no1  street-no1  city1
Cust-no3  street-no3  city3
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,8,CH) KEEPNODUPS -
  WITHALL WITH(1,19)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,8,22:11,17)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(38:X)
/*
Back to top
View user's profile Send private message
op

New User


Joined: 31 Oct 2006
Posts: 48
Location: Chennai

PostPosted: Thu Mar 13, 2008 12:31 am    Post subject: Reply to: Combining files with DFSORT
Reply with quote

Hi Frank,

Thanks a lot.
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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 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
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm


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