IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Related to using a file in comparison


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kumar Sandeep

New User


Joined: 24 Apr 2020
Posts: 6
Location: India

PostPosted: Fri Oct 16, 2020 5:30 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 746
Location: Pennsylvania

PostPosted: Fri Oct 16, 2020 6:05 pm
Reply with quote

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
View user's profile Send private message
Kumar Sandeep

New User


Joined: 24 Apr 2020
Posts: 6
Location: India

PostPosted: Mon Oct 19, 2020 2:16 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 746
Location: Pennsylvania

PostPosted: Mon Oct 19, 2020 5:07 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2508
Location: NY,USA

PostPosted: Tue Oct 20, 2020 2:47 am
Reply with quote

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 Use [URL] BBCode for Links
Run only when its 31st dec and create a YTD GDG+1 and refer it.
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 488
Location: London

PostPosted: Thu Oct 29, 2020 3:28 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2508
Location: NY,USA

PostPosted: Fri Oct 30, 2020 1:30 pm
Reply with quote

True Indeed.
Back to top
View user's profile Send private message
Pete Wilson

Active User


Joined: 31 Dec 2009
Posts: 488
Location: London

PostPosted: Fri Oct 30, 2020 9:14 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts FILE STATUS - 39 ON VARIABLE LENGTH V... COBOL Programming 1
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts How to find which file contains my se... DFSORT/ICETOOL 6
No new posts IGZ0035S THERE WAS AN UNSUCCESSFUL OP... COBOL Programming 3
No new posts Group comparison/update between two f... DFSORT/ICETOOL 10

Back to Top