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 Records Based on a Key Field

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

Active User


Joined: 14 Jun 2006
Posts: 331
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

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
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: 331
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: 7130
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
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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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