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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Weirdo results with JOINKEYS Balaryan DFSORT/ICETOOL 4 Wed Oct 18, 2017 9:04 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm

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