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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 6 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Vision results (also known as DYL-280) CaptBill CA Products 1 Tue Dec 20, 2016 3:35 am


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