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

How to check file availability using REXX tool?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Sat Oct 15, 2011 2:38 am
Reply with quote

I have following requirement.

I have two separate Mainframe regions say TEST & DEV. I have a Mainframe Job to copy files from DEV to TEST.

Now say i have submited a job in DEV to copy current generation of 100 GDG files to +1 generation of 100 GDG files in TEST. So for these 100 GDG files, +1 generations will be created in TEST region.

I want to have a tool to check the following:

1. Take the current generation of 100 GDG files from DEV
2. Check whether +1 generation of 100 GDG files are created or not in TEST.

Can anyone help me on this please?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat Oct 15, 2011 2:47 am
Reply with quote

Yes. Could you provide some more details? I think some conceptual ideas of how you want to do this, or maybe help us by telling us what programs or utilities you'll need to use to accomplish this. Where does REXX come into the picture here?

Maybe I'm over-simplifying this, but it seems to me the easy way would be to:

1. Take a BEFORE snapshot of TEST with a LISTCAT.
2. Run the copies of the 100 generations.
3. Take an AFTER snapshot of TEST with LISTCAT. Compare the two and look for any discrepencies, like where the before and after dataset name didn't change.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Sat Oct 15, 2011 2:48 am
Reply with quote

Hi,

Is the Versioning Same in both Dev & Test?


Sai
Back to top
View user's profile Send private message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Sat Oct 15, 2011 2:55 am
Reply with quote

Hi

Thanks for your replies.

Versioning is not same in DEV and TEST it is always +1 in TEST.
Suppose i have two files in DEV as mentioned below.

file 1 : x.x.x (GDG Base)
x.x.x.G001V00

file 2 : y.y.y (GDG Base)
y.y.y.G001V00
y.y.y.G002V00


So after my COPY job from DEV to TEST. TEST region will have following.
file 1 : x.x.x (GDG Base)
x.x.x.G001V00
x.x.x.G002V00

file 2 : y.y.y (GDG Base)
y.y.y.G001V00
y.y.y.G002V00
y.y.y.G003V00
Back to top
View user's profile Send private message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Sat Oct 15, 2011 2:56 am
Reply with quote

Can LISTCAT be used for all set of files at a time?

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

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Sat Oct 15, 2011 3:36 am
Reply with quote

Hi Sunny,

i created a file with all GDG base name and used it as input of my rexx.Please find the code below.

Code:
/*REXX*/                                     
address tso                                   
say 'Enter GBG Base Name file:'               
pull base                                     
"alloc da('"base"') fi(infile) shr reuse"     
"execio * diskr infile (stem indata. finis"   
do i = 1 to indata.0                         
    indata.i = strip(indata.i)               
    x = outtrap('zzz.')                       
    "listcat  ent('"indata.i"') all"         
    x = outtrap('off')                       
    if index(zzz.1,'NOT FOUND') > 1 then     
    do                                       
      Say 'GBG Base not cataloged:'indata.i   
    end                                       
    else                                     
    do                                       
    j = 1                                     
    do until index(zzz.j,'ASSOCIATIONS') <> 0
       j = j + 1                         
    end                                 
    do until index(zzz.j,'IN-CAT') <> 0 
       j = j + 1                         
    end                                 
    j = j - 2                           
    parse var zzz.j f1 '--' f2 .         
      Say 'Current GDG Version   :'f2   
    end                                 
end                                     

Input:

Code:
BKUP.SL.ICPY.SSL025NP
BKUP.MI.ICPY.SMI210NP
BKUP.MI.ICPY.SMX210NP

Note: The 3rd base is not cataloged


Output:

Code:
 Enter GBG Base Name file:                           
ID.BASE.FILE                                     
 Current GDG Version   :BKUP.SL.ICPY.SSL025NP.G2340V00
 Current GDG Version   :BKUP.MI.ICPY.SMI210NP.G2244V00
 GBG Base not cataloged:BKUP.MI.ICPY.SMX210NP



Sai
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Sat Oct 15, 2011 11:54 am
Reply with quote

DFdss offers relative generation processing and rename facilities if required, so why bother to use REXX when it isn't needed.

May take a few minutes to code up, but it will work and gives out lots of info messages if things go wrong.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Sat Oct 15, 2011 12:58 pm
Reply with quote

saiprasadh wrote:
Is the Versioning Same in both Dev & Test?

What do you mean by this, please explain

sunnybunny wrote:
Can LISTCAT be used for all set of files at a time?

What happened when you tried this, probably much better for your learning if you try something before asking if it will work or not.

@ saiprasadh

Your code does not need to generate so many lines to do so much checking against each line generated

Look at this
Code:
/* REXX *** Get the zero generation of a given GDG base           */

ARG GDG .
DSN = STRIP(GDG||".G0000V00")
X=OUTTRAP(LST.)
" LISTC ENT('"STRIP(GDG)"')"
X=OUTTRAP(OFF)
DO A = LST.0 TO 1 BY -1
  IF POS('NONVSAM',LST.A) > 0 THEN DO
    DSN = STRIP(SUBSTR(LST.A,POS('NONVSAM',LST.A)+13,44))
    A = 0
  END
END
IF RIGHT(DSN,9) = '.G0000V00'
  THEN SAY GDG
  ELSE SAY DSN
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Oct 15, 2011 1:04 pm
Reply with quote

Quote:
I want to have a tool to check the following:
1. Take the current generation of 100 GDG files from DEV
2. Check whether +1 generation of 100 GDG files are created or not in TEST.
Can anyone help me on this please?


I hope that nobody with a bit of good sense will waste time on such a stupid requirement

Quote:
Now say i have submited a job in DEV to copy current generation of 100 GDG files to +1 generation of 100 GDG files in TEST. So for these 100 GDG files, +1 generations will be created in TEST region.

if the copy job ended successfully what reason to doubt that the files were created icon_question.gif

Quote:
I have following requirement.

Quote:
I want to have a tool

is that a real stupid-requirement, or something You want to toss up in order to add "useless-tools writing" to Your skills
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Oct 15, 2011 1:56 pm
Reply with quote

Follow on ..
Kevin You are not oversimplyfing, You are just right ... that' s the only way ..

but IMHO why overcomplicate things
what difference would it make

from ... have a job which
does the copy
have the scheduler check the job return code to send an email to some beancounter in case of error

to ... have a job which
generates a listcat before
does the copy
have the scheduler send an email to some beancounter in case of error
generates a listcat after
uses sort to compare the listcats and sets the return code to
have the scheduler send an email to some beancounter in case of mismatch

and .... no rexx involved at all
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top