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

To Check the previously ran GDG no.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Tue May 03, 2011 3:22 am
Reply with quote

Hi,
I have a requirement in which I have to:
1.) Have a check where we have to check if a new GDG generation is created or not. If not we have to send a empty file.
If yes we have to carry on with the business processing.

Is there a way out for how to check whether a new GDG has been created since the last run ??

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

Global Moderator


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

PostPosted: Tue May 03, 2011 6:43 am
Reply with quote

Keep a logfile, and update it on the last run. For the current run, check against the logfile, and see if they match or not. Or, use it to see if there is more than one generation in between the runs.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Tue May 03, 2011 10:59 am
Reply with quote

Or create an empty GDG dataset at start of cycle which will then be filled with data - if data exists for it. When the send job comes along it will find the GDG with or without data.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1050
Location: Richmond, Virginia

PostPosted: Tue May 03, 2011 5:44 pm
Reply with quote

Run IDCAMS LISTCAT report to a file and analyze it programatically.
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Tue May 03, 2011 6:22 pm
Reply with quote

Or maintain control flag... set the flag when gdg generation is created...

Before processing your business logic check for flag if set do business process and reset the flag....
Else send empty file....
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue May 03, 2011 6:31 pm
Reply with quote

Why not use a fixed file name and then check on the contents of a name that will not change.

If the file is populated then create the GDS from that file, else send that empty file.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue May 03, 2011 8:41 pm
Reply with quote

I vote for expat's solution.

Very strait forward and easy to implement.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Wed May 04, 2011 12:03 am
Reply with quote

Hi,
Thanks All for the suggestions...
Expat : I see that could be a easier one...Could you explain a littele more to help me with the implementation part...
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Wed May 04, 2011 4:23 am
Reply with quote

Hi Sambhaji,
Could you please explain, how can we implement this....

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

Global Moderator


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

PostPosted: Wed May 04, 2011 4:37 am
Reply with quote

Saurabh, do you think that maybe you could explain the situation a little more clearly, what happens betwen runs that causes a problem? Why do you send an empty file and not the one with actual data in it?
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Wed May 04, 2011 10:11 am
Reply with quote

Hi,
Sure I would like to explain more….

We have a job which runs daily, now there is something happening on our source system which causes the Input file to be irregular , i.e it won't come on daily basis and might come irregularly. So we plan to have a check on the GDG generation, i.e if a new GDG generation is created by the source, we would do the processing or else send an empty file.

I hope this clarifies.

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

Global Moderator


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

PostPosted: Wed May 04, 2011 12:50 pm
Reply with quote

Has your shop not heard of dataset triggering, although a GDS is probably not the best type of dataset to use for this.

When a dataset is created, the scheduling software can submit a job for processing that dataset.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Wed May 04, 2011 2:30 pm
Reply with quote

I agree with Expat,
CA7(I strongly believe other schedulers also have this) tracks the creation of GDG generations once the GDG is defined on CA7. And CA7 can be made to trigger a job when a new GDG generation is created.

Code:
 LCTLG,DSN=ABCDE.SOME.GDG                                               
DSN=ABCDE.SOME.GDG                                 DATE 11.124    PAGE 0001
                                                                               
--------------- DATASET NAME ---------------     DSNBR    POSTTM  TYPE         
                    DATE    TIME      GDG#   #VOL    VOLSER    DEV-TYPE    SEQ 
                                                                               
ABCDE.SOME.GDG     ........................   DS00000016 JTERM   GDG           
                   11105    1148      2227    001    A67335    78048081    0001
                   11105    1141      2226    001    A64129    78048081    0001
                   11105    1129      2225    001    A63793    78048081    0001
                                                                               
SLID-00 REQUEST COMPLETED AT 03:52:38 ON 11.124 


The above snapshot of CA7 shows that ABCDE.SOME.GDG is defined on CA7 and CA7 tracks the generations ( here 2227 is the latest generation).

Hope it helps.
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed May 04, 2011 4:11 pm
Reply with quote

If you want it to be simple follow this procedure,


1. Delete all the GDG generations after the file is sent
2. Create an empty GDG generation.

Next day when the process starts
Even though the file is not received we have an empty GDG entry and would be sending the empty file. If the file is received we anyways send the latest generation.

This is always a safe handling. In case you have restriction to use only GDG files.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Wed May 04, 2011 10:32 pm
Reply with quote

Hi,
I do agree with EXPAT...
But not sure of whether the Schedular thing is applicable in our case as while scheduling a job I am not getting any such option in our interface.

kratos86: Nice Simple solution, Nice logic. BUT I really CANNOT Either Create or DELETE the Source GDG, So won't be able to implement that.

I would relly love to implement EXPAT's earlier solution

Quote:
Why not use a fixed file name and then check on the contents of a name that will not change.

If the file is populated then create the GDS from that file, else send that empty file.


If you could assist a lil more with the implementation part..

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

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Thu May 05, 2011 8:19 am
Reply with quote

Quote:
But not sure of whether the Schedular thing is applicable in our case as while scheduling a job I am not getting any such option in our interface.

Please note that, always do check with peers and try searching the forums before posting. This way issues will be resolved in a timely manner.
Quote:
really CANNOT Either Create or DELETE the Source GDG

I am not saying to delete the GDG but to delete its generations.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Thu May 05, 2011 8:25 am
Reply with quote

Hi kratos86 :

I did this
Quote:
Please note that, always do check with peers and try searching the forums before posting. This way issues will be resolved in a timely manner.


I meant the same
Quote:
I am not saying to delete the GDG but to delete its generations.
.. As this GDG is being used by other jobs as well ,So can't delete the generations...

Regret for the misunderstanding…

Would like to implement his with the JCL itself….
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Thu May 05, 2011 10:07 am
Reply with quote

Quote:
.. As this GDG is being used by other jobs as well ,So can't delete the generations...

If the generations are not deleted you would have issue by sending the duplicate information whenever the the new file did not arrive. So, I assume the GDS are getting deleted somewhere in the end of your batch run. May be someother job - Check whether it deletes all the generations.

Quote:
I would relly love to implement EXPAT's earlier solution

You told you cannot create/delete a GDG, But planning to implement expat solution which actually requires you to create a GDS. Be sure which are all the constraints you have and what all you don't have.

If you are able to create a GDS, then the job which clears the GDG can be used to create a empty entry.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Thu May 05, 2011 11:50 am
Reply with quote

Hi,

Quote:
If the generations are not deleted you would have issue by sending the duplicate information whenever the the new file did not arrive. So, I assume the GDS are getting deleted somewhere in the end of your batch run. May be someother job - Check whether it deletes all the generations.


Mine is a new job yet to be implemented, and the GDG's are certainly not being deleted in the other jobs also.

About EXPAT's Solution I didn't knew that…

Reiterating Would like to implement his with the JCL itself……

Let me know if you have any idea…
Thanks for your assistance..kratos86
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Thu May 05, 2011 12:03 pm
Reply with quote

Quote:
Mine is a new job yet to be implemented, and the GDG's are certainly not being deleted in the other jobs also.


This being the case, i would suggest to go with the CA7 Virtual dataset trigger option. This requires change in the CA7 of the job which actually sends the file and your job. You can check the CA7 reference manuals of your site. Or else wait for others to provide you a better solution.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Thu May 05, 2011 3:48 pm
Reply with quote

Or change the job that creates the GDG by adding a step that will copy the new dataset to another dataset (not a GDS) which your job can empty after transmission.

And you should be able to change a feeder job as part of the project.
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 Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts Check if CICS is online in JCL CICS 10
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts How to check whether who renamed the ... JCL & VSAM 3
Search our Forums:

Back to Top