Get all the GDG versions created for the day

JES2/3, JCL, utilities.
Post Reply
User avatar
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 »

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: 122
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Contact:

Re: Get all the GDG versions created for the day

Post by Akatsukami »

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: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Get all the GDG versions created for the day

Post by Robert Sample »

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: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Get all the GDG versions created for the day

Post by nicc »

We assume that you mean GENERATIONS (Gxxxx) and not VERSIONS (Vxx).
Regards
Nic
User avatar
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 »

That is true nic it is different generation
User avatar
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 »

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: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Get all the GDG versions created for the day

Post by Robert Sample »

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
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 »

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: 4
Joined: Fri Aug 26, 2016 3:51 pm

Re: Get all the GDG versions created for the day

Post by arpitpatel01 »

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
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”