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

Compare datasets and store results in third dataset


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senmainframe
Currently Banned

New User


Joined: 09 Oct 2007
Posts: 30
Location: USA

PostPosted: Fri Oct 26, 2007 12:59 am
Reply with quote

I need to compare two datsets based on agent code, type code
(agent code - starting pos 6, length 6)
(type code (starting pos 15, lengt 2)

and I need to store the matched records in the third datasets. JCL for this?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Fri Oct 26, 2007 1:49 am
Reply with quote

No, program; not JCL
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Oct 26, 2007 2:05 am
Reply with quote

You haven't given much detail so I'll assume that you don't have duplicates in either input file, that the input files have the same RECFM and LRECL and that you only want one record for each match (not both). Given those assumptions, you can use a DFSORT/ICETOOL job like this:

Code:


//S1    EXEC  PGM=ICETOOL                                         
//TOOLMSG DD SYSOUT=*                                             
//DFSMSG  DD SYSOUT=*                                             
//CON DD *                                                       
     000001   03                                                 
     000003   05                                                 
     000004   02                                                 
     000005   01                                                 
     000005   02                                                 
     000006   01                                                 
     000007   06                                                 
//    DD *                                                       
     000001   03                                                 
     000002   05                                                 
     000004   02                                                 
     000005   01                                                 
     000007   04                                                 
/*
//OUT DD SYSOUT=*                                                 
//TOOLIN DD *                                                     
SELECT FROM(CON) TO(OUT) ON(6,6,CH) ON(15,2,CH) FIRSTDUP         
/*


OUT would have:

Code:

     000001   03 
     000004   02 
     000005   01 


If that doesn't match your requirement, then show an example of the records in each input file with all variations and what you expect for output, and explain the rules for going from input to output.
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 Store the data for fixed length COBOL Programming 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top