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.
Can i use Sort?
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Can i use Sort?
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.
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.
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Can i use Sort?
'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.
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.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
COBOL SORT - How to sort entire file first & sort by Key
by k_ekam » Thu Dec 01, 2022 12:58 pm » in IBM Cobol - 3
- 1547
-
by Robert Sample
View the latest post
Wed Dec 07, 2022 7:32 am
-
-
- 1
- 1767
-
by prino
View the latest post
Tue Jul 02, 2024 2:23 pm
-
-
How to sum a decimal value using sort
by hkaur7087 » Thu Aug 05, 2021 2:19 pm » in DFSORT/ICETOOL/ICEGENER - 4
- 2348
-
by sergeyken
View the latest post
Thu Aug 05, 2021 7:48 pm
-
-
- 1
- 1570
-
by cobol_dev
View the latest post
Thu Apr 14, 2022 12:55 am
-
- 3
- 3714
-
by naveenkumar sudha
View the latest post
Mon May 09, 2022 10:15 pm