Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compare multiple files using JCL/Rexx/Cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
tanvi110788

New User


Joined: 19 May 2020
Posts: 5
Location: India

PostPosted: Tue May 19, 2020 5:47 pm    Post subject: Compare multiple files using JCL/Rexx/Cobol
Reply with quote

Hi,

I have a requirement where in I receive 6 or more files from upstream application into a GDG. I want to compare those all generations with one another to see any duplicates, i.e., it is a possibility that two or more files that came in may be duplicates (erroneously sent by upstream twice or multiple times). Could you please help on providing a solution using JCL or Cobol or Rexx ?

I might have follow-up questions based on the solutions.

Thanks.
Back to top
View user's profile Send private message

sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 778
Location: Maryland

PostPosted: Tue May 19, 2020 7:26 pm    Post subject: Re: Compare multiple files using JCL/Rexx/Cobol
Reply with quote

tanvi110788 wrote:
Hi,

I have a requirement where in I receive 6 or more files from upstream application into a GDG. I want to compare those all generations with one another to see any duplicates, i.e., it is a possibility that two or more files that came in may be duplicates (erroneously sent by upstream twice or multiple times). Could you please help on providing a solution using JCL or Cobol or Rexx ?

I might have follow-up questions based on the solutions.

Thanks.


1) Files do exist only in Unix/Windows, but not in mainframe (excluding USS)

2) Either GDG, or not GDG, - it doesn't matter. BTW: how do you imagine "GDG of 6 input files"???

3) JCL has no ability neither to compare datasets, nor to do anything else except invoking other programs.

4) What did you try so far? What are the results?

5) The answer on tools to choose depends on the nature of your datasets.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 352
Location: Denmark

PostPosted: Tue May 19, 2020 8:16 pm    Post subject:
Reply with quote

Something built upon this REXX which drives SUPERC:
Code:
 dsl='data.set1 data.set2 data.set3 '
 cc=bpxwdyn('alloc dd(sysin) dummy')                 
 cc=bpxwdyn('alloc dd(outdd) new delete',           
            'cyl space(1,10) unit(sysda) reuse')     
 p='DELTAL,LINECMP,DPBLKCL FMVLNS NOPRTCC'           
 do dsln=1 to words(dsl)-1                           
   ds1=word(dsl,dsln)                               
   ds2=word(dsl,dsln+1)                             
   cc=Bpxwdyn('alloc dd(newdd) da('ds1') shr reuse')
   cc=Bpxwdyn('alloc dd(olddd) da('ds2') shr reuse')
   say 'Compare' ds1 'and' ds2                       
   Address attchmvs "ISRSUPC P"                     
   say 'rc:' rc                                     
 end                                                 
 cc=bpxwdyn('free dd(sysin)')                       
 cc=bpxwdyn('free dd(olddd)')                       
 cc=bpxwdyn('free dd(newdd)')                       
 cc=bpxwdyn('free dd(outdd)')                       

If rc=0 then the datasets are equal.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2354
Location: Hampshire, UK

PostPosted: Tue May 19, 2020 9:37 pm    Post subject: Reply to: Compare multiple files using JCL/Rexx/Cobol
Reply with quote

You have been told before, on SO, theat JCL does not do this sort of thing. So why repeat your error? Do you actually try to learn from responses?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8795
Location: Welsh Wales

PostPosted: Thu May 21, 2020 5:12 pm    Post subject:
Reply with quote

Why not investigate the possibility of removing the "upstream" errors
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need to open a DSN using REXX & e... Y Marwaha CLIST & REXX 8 Fri Jun 05, 2020 7:30 pm
No new posts Execute Partially Edited Rexx Exec fr... AllenSieracki CLIST & REXX 14 Tue Jun 02, 2020 7:56 pm
No new posts Question for Cobol Report Writer jackzhang75 COBOL Programming 2 Wed May 27, 2020 4:35 am
No new posts In JCL Procedure how we can execute R... Dhananjayulu Neeli CLIST & REXX 7 Sat May 16, 2020 12:01 am
No new posts Need help to concatenate files with w... ssuthagar All Other Mainframe Topics 3 Fri May 15, 2020 1:39 am

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