View previous topic :: View next topic
|
Author |
Message |
Kumar Sandeep
New User
Joined: 24 Apr 2020 Posts: 10 Location: India
|
|
|
|
I have a requirement to compare 2 files.
One file is year-end file (Dec file) and another file is respective month's file (Jan, Feb, Mar.....).
The job will compare each month's file with year-end (Dec) file and write records to output file.
It is a monthly job and each month's file created will be compared with Dec's file.
In JCL, I can mention current's month's file as A.B.C.D(0) and Dec's file as A.B.C.D.G0050V00 (say G0050V00 is Dec file's generation).
Say, Feb file will be compared with Dec file, Mar file with Dec file, likewise, Nov file with Dec file (of last year). Now, in Dec again a year-end file will be created and in that case it will not do a comparison with last year's Dec file. Again, from Jan, job will do a comparison with Dec's file which was produced last and likewise it will do for other months when the monthly job will run.
I need suggestions here. If I will mention Dec's file with generation num then at the start of every year I will have to change my JCL/Proc so that comparison will happen with the latest Dec's file only.
Is there any way so that I don't have to change my JCL/Proc every year? Any solution for this? |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Have a once a year job that runs after the December file is created.
SORTIN DD DSN=A.B.C.D(0) (That is December at this point)
SORTOUT DD DSN=A.B.C.D.YEAREND(+1) (New GDG for Yearend)
You then always refer to Decembers file as A.B.C.D.YEAREND(0) |
|
Back to top |
|
|
Kumar Sandeep
New User
Joined: 24 Apr 2020 Posts: 10 Location: India
|
|
|
|
Thank you.
Can we put it in the same job or do we need to create a separate job which will copy Dec file to an year-end file and then that year-end file can be used in existing job?
Please let me know if there could be any other solutions? |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Can we put it in the same job or do we need to create a separate job which will copy Dec file to an year-end file and then that year-end file can be used in existing job?
I would make a separate Job that creates the Year-end dataset and have it scheduled once a year after the December run. You would use the Year-end dataset in place of the current December dataset in your current Job.
Please let me know if there could be any other solutions?
There could be several other solutions. You need to expand your mind. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Kumar Sandeep wrote: |
Thank you.
Can we put it in the same job or do we need to create a separate job which will copy Dec file to an year-end file and then that year-end file can be used in existing job?
Please let me know if there could be any other solutions? |
What has been suggested is a clean way.
1. You will need to do a one time load of 2019 dec data to this new YTD GDG+1
2. Refer YTD GDG(0) in your job now < Dec Data Set (2019).
3. Set a yearly job that run on last day of the year and create new YTD GDG(+1)
2. Make sure Step2 runs after step3 when that day comes.
You are good to go.
If you want to do in the same job then do something like ibmmainframes.com/about53750.html
Run only when its 31st dec and create a YTD GDG+1 and refer it. |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 592 Location: London
|
|
|
|
within the same job that creates the new YTD GDG(+1) you can have another step that refers to that new generation for input as GDG(+1). It's only in a separate job you'd need to refer to it as GDG(0). |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
True Indeed. |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 592 Location: London
|
|
|
|
There's a new jobcard keyword called GDGBIAS in Z/OS2.3 that affects this. Never tried to use it so not fully understanding how it works, but I think the default behaves as we've always understood it. Not quite sure I see the point of it.
This optional keyword parameter specifies how relative references to a
generation data set in a DD JCL statement are resolved.
Syntax
GDGBIAS={JOB|STEP}
Subparameter definition
JOB
Relative references to a generation data set are resolved on a job
basis. The system establishes the relationship between the relative
generation number and the absolute generation number when the
generation data set is first referenced in the job. This relationship
is consistent throughout the job.
STEP
Relative references to a generation data set are resolved on a job step
basis. The system establishes the relationship between the relative
generation number and the absolute generation number when the
generation data set is first referenced in each job step. Each job step
that references the generation data set establishes a new relationship.
Defaults
If no GDGBIAS parameter is specified, the system uses the default from
the job's job class that is specified at initialization. For job
classes that do not specify a default for the GDGBIAS parameter,
GDGBIAS=JOB is used. |
|
Back to top |
|
|
Kumar Sandeep
New User
Joined: 24 Apr 2020 Posts: 10 Location: India
|
|
|
|
Thank you all for the replies. |
|
Back to top |
|
|
|