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: 810
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: 373
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: 2378
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: 8796
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 CA Sysview - JCL or Rexx - Read or Ex... Jasi CA Products 4 Wed Aug 05, 2020 9:19 pm
No new posts Restart logic by using cursor name in... Twinkle22 Mainframe Interview Questions 1 Wed Jul 29, 2020 11:26 am
No new posts Multiple Sums in one File Rick Ryan SYNCSORT 2 Wed Jul 29, 2020 1:30 am
This topic is locked: you cannot edit posts or make replies. Invoke REXX thru JCL to expand the co... spizen556 CLIST & REXX 2 Sun Jul 26, 2020 3:53 pm
No new posts Retrieve multiple records with metaco... Jose Juan J CA Products 0 Sat Jul 25, 2020 1:36 am

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