Can i use Sort?



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Can i use Sort?

Postby ussef » Thu Aug 12, 2021 7:42 pm

I have a job that runs every business day and creates a new generation of a GDG.
Now my requirement is to automate a week job that runs on 1st of every month
The input for this week job are the files that were created in the previous week.Since we can't predict the number files that will get created each week it's not possible to hardcode the generations(ie:0,-1,-2 ...etc).So by specifying the GDG base as the input file(this will take all the 50generations) how can we extract only the required records for the week job.?or the files generated between the last date of processing and the current date ?and add the version (GXXXX) of the file to the output file.
ussef
 
Posts: 1
Joined: Thu Aug 12, 2021 7:39 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Can i use Sort?

Postby sergeyken » Fri Aug 13, 2021 5:07 pm

This question is not related neither to SORT, nor to JCL.

You may need to work with catalog to extract the existing latest GDG names. It remains unclear how do you plan to determine those DSN from the last week? It is also not clear how do you plan to use unpredictable number of DSN in a (static?) JCL?

The correct approach would be: always to create daily GDG datasets, even if some of them are empty, and always use last 7 of them when combining the weekly concatenation. Otherwise all other tricks and gimmicks do not look as an acceptable method.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 278
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 5 times
Been thanked: 25 times

Re: Can i use Sort?

Postby willy jensen » Fri Aug 13, 2021 8:11 pm

'a week job that runs on 1st of every month The input for this week job are the files that were created in the previous week' ? Are you only interested in datasets from the last week of the month?
Anyway, the way to go is to postprocess a LISTCAT, which will show you the creation date. While you might be able to tweak SORT to do it, I would personally go for a proper program.
willy jensen
 
Posts: 380
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 53 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post