Get all the GDG versions created for the day

JES2/3, JCL, utilities.
Previous topicNext topic
User avatar

Topic author
gvenkateshmca
New Member
Posts: 4
Joined: Fri Aug 11, 2017 5:51 am

Get all the GDG versions created for the day

Post by gvenkateshmca » Fri Aug 11, 2017 6:09 am

Hi Guys,

I am looking for Getinh All the GDG Versions Created for a Day. We have one proc which is running in different Job and creating the different versions in one day and some time it will create 10 versions and another time it will create based on the transactions . I want to know that how many version created for the day and these all are needs to go to another job for the process end of the day and need to exclude the previous days versions . Is there any way to identify that .. If you have any sample JCL can you please share it ..



User avatar

Akatsukami
Global Moderator
Global Moderator
Posts: 109
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL

Re: Get all the GDG versions created for the day

Post by Akatsukami » Fri Aug 11, 2017 12:31 pm

You can get the creation date of a data set via the LISTDSI function of Rexx, or by parsing the output of LISTCAT. Other senpai may have other suggestions. You cannot, however, do it through JCL alone.


"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1288
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa

Re: Get all the GDG versions created for the day

Post by Robert Sample » Fri Aug 11, 2017 2:22 pm

You are looking at the problem wrong. After processing each day's generations, either copy the data to another GDG (if it needs to be kept) and then delete the generations (one IDCAMS command will do that), or simply delete the generations. That way, each morning the GDG starts with no generations and your processing can refer to each day's data by referencing the GDG base to get all generations. With a recent release of z/OS (2.2 or 2.1 but I don't recall which), you can even specify to retrieve the generations in the order created or the default reverse order created.




nicc
Global Moderator
Global Moderator
Posts: 546
Joined: Wed Apr 23, 2014 8:45 pm

Re: Get all the GDG versions created for the day

Post by nicc » Fri Aug 11, 2017 3:37 pm

We assume that you mean GENERATIONS (Gxxxx) and not VERSIONS (Vxx).


Regards
Nic

User avatar

Topic author
gvenkateshmca
New Member
Posts: 4
Joined: Fri Aug 11, 2017 5:51 am

Re: Get all the GDG versions created for the day

Post by gvenkateshmca » Wed Aug 16, 2017 2:10 am

That is true nic it is different generation



User avatar

Topic author
gvenkateshmca
New Member
Posts: 4
Joined: Fri Aug 11, 2017 5:51 am

Re: Get all the GDG versions created for the day

Post by gvenkateshmca » Wed Aug 16, 2017 2:16 am

Robert Sample wrote: You are looking at the problem wrong. After processing each day's generations, either copy the data to another GDG (if it needs to be kept) and then delete the generations (one IDCAMS command will do that), or simply delete the generations. That way, each morning the GDG starts with no generations and your processing can refer to each day's data by referencing the GDG base to get all generations. With a recent release of z/OS (2.2 or 2.1 but I don't recall which), you can even specify to retrieve the generations in the order created or the default reverse order created.
The problem is the new files are going to create based on the transaction per day and this is existing process in the production which is running daily and keeping the data for the more than 6 months .So we can't delete the particular date generation . I have so many generation for the particular gdg base my requirement is to identify the today date generation and copy all these into the my new job to process that .The number of files are vary from day to day based on the volume of the transactions.



User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1288
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa

Re: Get all the GDG versions created for the day

Post by Robert Sample » Wed Aug 16, 2017 2:37 am

Your process is broken -- that is, you are not taking advantage of the functions the system provides to simplify your tasks by using the GDG to isolate a day's transactions.

If you cannot isolate the day's transactions into a single GDG (no matter how many generations got created), then you need to write a program in the language of your choice to parse LISTCAT output (or LISTDSI output) as specified elsewhere to extract the create dates of each generation and restrict yourself to only the one day's generations. If you use dynamic allocation (BPXWDYN), you can use it to allocate each generation and copy the data to an output data set that is then used in the rest of the job to process the data. If you do not use dynamic allocation, your program MUST write another job (with the correct number of generations allocated to the DD name) to the internal reader to submit it, since the JCL of the executing job CANNOT be changed for the number of generations. Either program approach is significantly more work than isolating the day's transactions in a single GDG, but if site standards prohibit that then so be it.



User avatar

Topic author
gvenkateshmca
New Member
Posts: 4
Joined: Fri Aug 11, 2017 5:51 am

Re: Get all the GDG versions created for the day

Post by gvenkateshmca » Thu Aug 17, 2017 4:57 am

Thanks I need to write a some program or JCL to extract only the all the generation for the day , I am not able to find the dynamically taking the generation for that day into my new process jcl , If anyone has come across this type of situation can you please help me




arpitpatel01
New Member
Posts: 2
Joined: Fri Aug 26, 2016 3:51 pm

Re: Get all the GDG versions created for the day

Post by arpitpatel01 » Thu Aug 17, 2017 12:30 pm

Hello gvenkateshmca,

If you can add date at the end of each record in the gdg dataset, then it might help you filter out records that are to be considered for current day.
It will change the dataset lrecl, layout.
You can use this if possible.

Hope this helps.

Thanks,
Arpit.

[ Post made via Android ] Image



Previous topicNext topic

Return to “JCL - Job Control Language.”