Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Check for the availability of new version of a GDG

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

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Mon Mar 15, 2010 5:05 pm    Post subject: Check for the availability of new version of a GDG
Reply with quote

Hi All,

I have a requirement to check if a new version of a GDG is available by a particular time say 7:00 AM.
For the time factor, I could schedule the job at 7:00 AM but how to check if it is already created for a particular day?
Based on the availbility/no-availbility, I have some other functions to perform.

Just wanted to know if there is any JCL steps for this requirement.
Hope the requirement is clear!
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 15, 2010 5:09 pm    Post subject:
Reply with quote

Well, let us start off in the right direction. Do you mean GDS version or GDS generation. As both are perfectly valid for use with GDS but have completely different meanings and implications, may I suggest that you and us actually do know we are talking about here.
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Mon Mar 15, 2010 5:18 pm    Post subject:
Reply with quote

we use LISTCAT ALL LVL(GDG-BASE-NAME) in IDCAMS control card to check for the existence of any generations of the GDG. If no GDG generation is present (only base is present), or the base itself is not present, it gives RC 4.
Back to top
View user's profile Send private message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Mon Mar 15, 2010 5:30 pm    Post subject:
Reply with quote

I mean the generation of a GDG base.

Exp - If the GDG base name is HLQ.XXXX.YYYY, and the yesterday's generation let's say HLQ.XXXX.YYYY.G0141V00 , I need to check if HLQ.XXXX.YYYY.G0142V00 is availble today or not.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 15, 2010 5:45 pm    Post subject:
Reply with quote

Well, the use of a GDS for a trigger or having to check to see if a new generation has been created, IMHO, is not the best thought out practice.

Usually for things like this I would use a plain old fixed dataset name which when created can be used to trigger an event in the schedule process which will then, and only then create a new GDS generation.

Also testing for a fixed dataset name is easier to do, if the dataset does not exist the return code is 12, but can be set to another value as a lot of sites will not accept RC 8 or above as an acceptable return code. This way you can test in the same job if the dataset exists and if it does, is it populated.

By using a GDS generation the code has to be updated every run, but using a fixed dataset name makes life oh so easier.

I know that this doesn't help much, but at least it gives you something to think about to improve the current situation and to prevent the same problem occuring in the future.

However, on the plus side, I do believe that this has been discussed on the forum before and a solution was found.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 15, 2010 5:51 pm    Post subject:
Reply with quote

This thread will give you how to get creation date of gdg generation(here latest for you)

This date you can compare with todays date and if it is equal then do what function you needed to do.
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Mon Mar 15, 2010 6:27 pm    Post subject: Reply to: Check for the availability of new version of a GDG
Reply with quote

Similar type of checks were there in one of our previous sites.

It was a kind of tedious process to check for new generation based on generation number. Please see if this helps.

1. LISTCAT the GDG into a PS file
2. Using a COBOL program, compare the previous and current day's generation number. (need to have one PS file with previous day's listing and one with current day's listing)
3. And do the function based on your requirement.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 15, 2010 6:42 pm    Post subject: Re: Reply to: Check for the availability of new version of a
Reply with quote

Mathiv Anan wrote:
Similar type of checks were there in one of our previous sites.

It was a kind of tedious process to check for new generation based on generation number. Please see if this helps.

1. LISTCAT the GDG into a PS file
2. Using a COBOL program, compare the previous and current day's generation number. (need to have one PS file with previous day's listing and one with current day's listing)
3. And do the function based on your requirement.


Looks complicated.. you need to always store what is last generation you have processed...
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Mon Mar 15, 2010 6:44 pm    Post subject: Reply to: Check for the availability of new version of a GDG
Reply with quote

Agreed icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Mar 15, 2010 6:59 pm    Post subject: Reply to: Check for the availability of new version of a GDG
Reply with quote

I also vote-in for the fixed-data-set name as expat has suggested. However, if GDS is your choice - best bet would be to preocess the GDS, (take the back-up if needed) and delete it - new day new generation to deal with. And yes, ofcourse you need an IDCAMS step to check if generation exists or not. Look for the RC from IDCAMS and do whatever next you want...
Back to top
View user's profile Send private message
bibek24

New User


Joined: 14 Aug 2007
Posts: 35
Location: Hyderabad

PostPosted: Mon Mar 29, 2010 10:22 pm    Post subject:
Reply with quote

I thought of another approach to meet the requirement.

I want to run a new job based on the completion status of another job on the same day.

Let's say jobs X and Y are scheduled on jobtrac on a particular day. Job Y needs to run at 7:30 AM. The steps in the job Y will only be executed if job X has completed sucessfully, meaning with a RC=0 to 4.

How to check for the RC of a job scheduled on jobtrac?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Mar 29, 2010 11:08 pm    Post subject:
Reply with quote

Hello,

Suggest you speak with the scheduling people to set this up in the scheduling system.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Mar 30, 2010 3:40 pm    Post subject:
Reply with quote

bibek24 wrote:
Let's say jobs X and Y are scheduled on jobtrac on a particular day. Job Y needs to run at 7:30 AM. The steps in the job Y will only be executed if job X has completed sucessfully, meaning with a RC=0 to 4.
I may be interpreting it wrong, however, statement in bold-text is bit ambiguous - schedulers can schedule the jobs but not the steps inside them. If you want to execute couple of steps based upon the RC from some other job, I doubt it can be done as worded.

If you mean to execute the Job-Y, yep, can be done with the hlp of scheduling people, as Dick has suggested.
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Tue Apr 06, 2010 12:06 am    Post subject: Reply to: Check for the availability of new version of a GDG
Reply with quote

Hello
If possible below is one suggesstion for the Requirment.
1) EOD, Create one Empty Version of GDS data
2) On Morning 7:00, Check whether the Latest GDS version contain the data. If it contains the data it means the GDS version creation on that dat else it is not.

Else in Some mainframes there are some utility which are given the creation date of file. and if Creation date is todays then it is created today.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Apr 06, 2010 3:00 pm    Post subject: Re: Reply to: Check for the availability of new version of a
Reply with quote

Rupesh.Kothari wrote:
If possible below is one suggesstion for the Requirment.
1) EOD, Create one Empty Version of GDS data
2) On Morning 7:00, Check whether the Latest GDS version contain the data. If it contains the data it means the GDS version creation on that dat else it is not.
Keeping in mind that you actually meant respective "Generation" and not the "version" - this might be true only if empty-generation means "no-processing" for the original requirement. OP wants to check the presence of generation - empty or full of data, is not yet mentioned.
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am
No new posts Is there a time Version of DATEDIFF ? Bill Woodger DFSORT/ICETOOL 1 Wed Aug 17, 2016 7:06 pm
No new posts Syncsort version supporting FINDREP c... juares castro SYNCSORT 9 Tue Aug 09, 2016 6:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us