Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm

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