View previous topic :: View next topic
|
Author |
Message |
Saurabh Pune
New User
Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1050 Location: Richmond, Virginia
|
|
|
|
Run IDCAMS LISTCAT report to a file and analyze it programatically. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
I vote for expat's solution.
Very strait forward and easy to implement. |
|
Back to top |
|
|
Saurabh Pune
New User
Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
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 |
|
|
Saurabh Pune
New User
Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
Hi Sambhaji,
Could you please explain, how can we implement this....
Thanks. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Saurabh Pune
New User
Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
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 |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
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 |
|
|
Saurabh Pune
New User
Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
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 |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
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 |
|
|
Saurabh Pune
New User
Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
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 |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
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 |
|
|
Saurabh Pune
New User
Joined: 26 May 2009 Posts: 23 Location: USA
|
|
|
|
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 |
|
|
kratos86
Active User
Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
|