Portal | 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: 860
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: 387
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: 2419
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 Group comparison/update between two f... premnath DFSORT/ICETOOL 8 Thu Oct 22, 2020 4:27 am
No new posts Need assistance formatting when joini... chillmo SYNCSORT 8 Wed Oct 21, 2020 10:56 am
No new posts REXX script to beautify XML jzhardy CLIST & REXX 1 Sun Oct 11, 2020 1:23 pm
No new posts Combining more 4 files with sorted or... bshkris DFSORT/ICETOOL 3 Thu Oct 08, 2020 10:57 am
No new posts Creating a single-record file with CO... Joerg.Findeisen DFSORT/ICETOOL 8 Tue Oct 06, 2020 8:19 pm

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