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
 

 

Compare datasets and store results in third dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Compare datasets and store results in third dataset
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: 456
Location: Belgium

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

No, program; not JCL
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: Fri Oct 26, 2007 2:05 am    Post subject:
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    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 Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm


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