IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to use DFSORT/ICETOOL for specific requirements


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun Kumar Tupili

New User


Joined: 30 Nov 2006
Posts: 14
Location: Banglore

PostPosted: Thu Nov 30, 2006 12:47 pm
Reply with quote

Hi,

I have a requirement. I have two input files. Both have keys in positions 1-2.
I need data if the keys for both files matches, the output file should have the matching key,remaining data in file1 and remaining data in file2.

File1
-----
A1 X1
B1 Y1
C1 Z1
C2 Z2

File2
-----
A1 X2
A2 X2
B1 Y2
A2 X2
C2 Z3


I want the output file as

Output
-------
A1 X1 X2
B1 Y1 Y2
C2 Z2 Z3

How to use DFSORT/ICETOOL to get the requirement done. I don't want to write a program.

I tried to merge the files into a single file and sort it.
I will get the corresponding duplicate records. but how to sort it to output file.
Back to top
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 363
Location: Earth

PostPosted: Thu Nov 30, 2006 4:53 pm
Reply with quote

Hi,
Here is the solution you asked for
Code:

//STEP0100 EXEC PGM=ICETOOL
//*                         
//TOOLMSG  DD SYSOUT=*     
//DFSMSG   DD SYSOUT=*     
//IN1      DD *             
A1 X1                       
B1 Y1                       
C1 Z1                       
C2 Z2                       
/*                         
//IN2      DD *             
A1 X2                       
A2 X2                       
B1 Y2                                                                 
A2 X2                                                                 
C2 Z3                                                                 
/*                                                                   
//T1       DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
   COPY FROM(IN1) TO(T1) USING(CTL1)                                 
   SORT FROM(IN2) TO(T1) USING(CTL2)                                 
   SPLICE FROM(T1) TO(OUT) ON(1,2,CH) WITH(7,2)                       
//CTL1CNTL DD *                                                       
   OUTREC FIELDS=(1:1,2,4:4,2,6:5X)                                   
//CTL2CNTL DD *                                                       
   SORT FIELDS=(1,2,CH,A)                                             
   SUM FIELDS=NONE                                                   
   OUTREC FIELDS=(1:1,2,7:4,2)                                       
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top