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
 
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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm

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