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 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 Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm

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