Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Combining Records Based on a Key Field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 266
Location: Jacksonville, FL

PostPosted: Wed Mar 26, 2008 8:29 pm    Post subject: Combining Records Based on a Key Field
Reply with quote

I have two files:

FILE1
Code:

----+----1----+----2----+----3----+----4
AB1234  XXXXXXXXXX    00035
CD5678  XXXXXXXXXX    00012
EF9012  XXXXXXXXXX    00006


FILE2
Code:

----+----1----+----2----+----3----+----4
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
AB1234  YYYYYYYYYYY
CD5678  YYYYYYYYYYY
CD5678  YYYYYYYYYYY
CD5678  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY
EF9012  YYYYYYYYYYY


Based on the USERID in positions 1-6 in each record of FILE1, I want to copy the count to the same position of matching records of FILE2 without retaining any of the records from FILE1.

Output file should look like
Code:

----+----1----+----2----+----3----+----4
AB1234  YYYYYYYYYYY   00035
AB1234  YYYYYYYYYYY   00035
AB1234  YYYYYYYYYYY   00035
AB1234  YYYYYYYYYYY   00035
AB1234  YYYYYYYYYYY   00035
CD5678  YYYYYYYYYYY   00012
CD5678  YYYYYYYYYYY   00012
CD5678  YYYYYYYYYYY   00012
EF9012  YYYYYYYYYYY   00006
EF9012  YYYYYYYYYYY   00006
EF9012  YYYYYYYYYYY   00006
EF9012  YYYYYYYYYYY   00006
EF9012  YYYYYYYYYYY   00006
Back to top
View user's profile Send private message
References
PostPosted: Wed Mar 26, 2008 8:29 pm    Post subject: Re: Combining Records Based on a Key Field Reply with quote

Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Mar 26, 2008 8:55 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON DD DSN=...  input file1 (FB/40)
//    DD DSN=...  input file2 (FB/40)
//OUT DD DSN=...  output file (FB/40)
//TOOLIN DD *
SPLICE FROM(CON) TO(OUT) ON(1,6,CH) -
  WITHALL WITH(1,6) WITH(9,11)
/*
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 266
Location: Jacksonville, FL

PostPosted: Wed Mar 26, 2008 9:24 pm    Post subject: Reply to: Combining Records Based on a Key Field
Reply with quote

The solution worked great!

I always thought that SORT/ICEMAN/ICETOOL were all the same programs, just aliases of each other. I have found this is not the case.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Mar 26, 2008 9:30 pm    Post subject:
Reply with quote

SORT and ICEMAN are aliases of the DFSORT program. ICETOOL is a separate program shipped with DFSORT.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1