IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compare multiple files using JCL/Rexx/Cobol


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Tue May 19, 2020 7:26 pm
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 Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue May 19, 2020 8:16 pm
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: 2455
Location: Hampshire, UK

PostPosted: Tue May 19, 2020 9:37 pm
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: 8797
Location: Welsh Wales

PostPosted: Thu May 21, 2020 5:12 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
Search our Forums:

Back to Top