Page 1 of 1

Get all the GDG versions created for the day

Posted: Fri Aug 11, 2017 6:09 am
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 ..

Re: Get all the GDG versions created for the day

Posted: Fri Aug 11, 2017 12:31 pm
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.

Re: Get all the GDG versions created for the day

Posted: Fri Aug 11, 2017 2:22 pm
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.

Re: Get all the GDG versions created for the day

Posted: Fri Aug 11, 2017 3:37 pm
by nicc
We assume that you mean GENERATIONS (Gxxxx) and not VERSIONS (Vxx).

Re: Get all the GDG versions created for the day

Posted: Wed Aug 16, 2017 2:10 am
by gvenkateshmca
That is true nic it is different generation

Re: Get all the GDG versions created for the day

Posted: Wed Aug 16, 2017 2:16 am
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.

Re: Get all the GDG versions created for the day

Posted: Wed Aug 16, 2017 2:37 am
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.

Re: Get all the GDG versions created for the day

Posted: Thu Aug 17, 2017 4:57 am
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

Re: Get all the GDG versions created for the day

Posted: Thu Aug 17, 2017 12:30 pm
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