Please help



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

Please help

Postby GeorgeQ » Mon Jun 19, 2017 8:23 am

I have a jcl job need to be run in every month, for each month I need to manually rewrite the code and add a new month data.

//M20171 DD DSN=A000000.MONTHDT.MONTH1,DISP=SHR
//M20172 DD DSN=A000000.MONTHDT.MONTH2,DISP=SHR
//M20173 DD DSN=A000000.MONTHDT.MONTH3,DISP=SHR
//M20174 DD DSN=A000000.MONTHDT.MONTH4,DISP=SHR
//M20175 DD DSN=A000000.MONTHDT.MONTH5,DISP=SHR
.
.

For example at May 2017, I need to add a new data //M20175,
and for 2017 Jun, I will have to add another new data //M20176, so and so forth.

May I ask is that possible and how I can make it more automatic, use some loop methods or any way to make this easy?

Thank you.
GeorgeQ
 
Posts: 28
Joined: Fri Jun 16, 2017 1:08 am
Has thanked: 12 times
Been thanked: 0 time

Re: Please help

Postby steve-myers » Mon Jun 19, 2017 9:51 am

Do not ever post the same question in multiple forums, You will not get any answer anywhere.

These users thanked the author steve-myers for the post:
GeorgeQ (Tue Jun 20, 2017 1:47 am)
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Please help

Postby NicC » Mon Jun 19, 2017 1:41 pm

Presumably the program that reads these new DDnames gets chnged every month so get the programmer to come up with the new JCL. Maybe then they will start to look at a proper design - maybe using GDGs.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
GeorgeQ (Tue Jun 20, 2017 1:48 am)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Please help

Postby Robert Sample » Mon Jun 19, 2017 4:56 pm

for each month I need to manually rewrite the code and add a new month data.
Do you mean each month you have to add code for the new DD name? If so, what language do you use, and if not, what do you mean by "manually rewrite the code"? Furthermore, have you considered using a generation data group for this? How many months back do you keep in the JCL? Do you have a sort for the data or are you processing it month-by-month? What is the precise process you follow each month? Does your site use a job scheduler and if so have you investigated the possibility of using it?

In other words, you have told us almost NOTHING about your process and hence it is pretty much impossible for us to provide you assistance.

These users thanked the author Robert Sample for the post:
GeorgeQ (Mon Jun 19, 2017 8:54 pm)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Please help

Postby GeorgeQ » Mon Jun 19, 2017 9:05 pm

Robert Sample wrote:
for each month I need to manually rewrite the code and add a new month data.
Do you mean each month you have to add code for the new DD name? If so, what language do you use, and if not, what do you mean by "manually rewrite the code"? Furthermore, have you considered using a generation data group for this? How many months back do you keep in the JCL? Do you have a sort for the data or are you processing it month-by-month? What is the precise process you follow each month? Does your site use a job scheduler and if so have you investigated the possibility of using it?

In other words, you have told us almost NOTHING about your process and hence it is pretty much impossible for us to provide you assistance.




Yes,I will run this each month, but I only need one year data(max is 12 month), so each new month I will append(this is the manually part, if current month is September ,I will add "//M20179 DD DSN=A000000.MONTHDT.MONTH9,DISP=SHR") a new DDNAME base on last month. even I use generation data I still need to add a new DDNAME(because the amount of DDNAME is increasing from (1<Jan> to 12<Dec> ). I use jcl to run SAS program.

Thanks!
GeorgeQ
 
Posts: 28
Joined: Fri Jun 16, 2017 1:08 am
Has thanked: 12 times
Been thanked: 0 time

Re: Please help

Postby NicC » Mon Jun 19, 2017 10:15 pm

No - you do not need to change the JCL if you use a GDG. You specify the GDG base name and that will pick up all generations. But you have to make sure that the GDG only keeps the latest 12 (one year's worth) generations so as the latest is created the oldest is deleted (or, at least, is uncatalogued).
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
GeorgeQ (Tue Jun 20, 2017 1:48 am)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Please help

Postby Robert Sample » Mon Jun 19, 2017 10:23 pm

If you use a GDG, you have only one DD statement -- DISP=SHR,DSN=<gdg.base> will pick up all generations (as of z/OS 2.1, you can use GDGORDER in your JCL on the DD statement to select whether to retrieve generations from oldest to newest or newest to oldest which is the default). As new months are added, the old months roll off the GDG as long as the limit is set to 12. You would not need to change the SAS code for a new DD statement every month, then.

These users thanked the author Robert Sample for the post:
GeorgeQ (Tue Jun 20, 2017 1:48 am)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Please help

Postby GeorgeQ » Tue Jun 20, 2017 1:10 am

Robert Sample wrote:If you use a GDG, you have only one DD statement -- DISP=SHR,DSN=<gdg.base> will pick up all generations (as of z/OS 2.1, you can use GDGORDER in your JCL on the DD statement to select whether to retrieve generations from oldest to newest or newest to oldest which is the default). As new months are added, the old months roll off the GDG as long as the limit is set to 12. You would not need to change the SAS code for a new DD statement every month, then.



I think only one DD statement is not enough, if this month is May, so I need five generations GDG(0),GDG(-1),GDG(-2),GDG(-3),GDG(-4)..
but next month I will need six generations, so I need add a new DDNAME for GDG(-5),this is a manually work.

Thanks!
GeorgeQ
 
Posts: 28
Joined: Fri Jun 16, 2017 1:08 am
Has thanked: 12 times
Been thanked: 0 time

Re: Please help

Postby NicC » Tue Jun 20, 2017 1:46 am

Yes - only one DDNAME. Specifying the gdg base and no relative or absolute generation number means that all the data sets of that gdg are concatenated together by the system. For someone who's skills include JCL you should know that. Read the manual(s).
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
GeorgeQ (Tue Jun 20, 2017 1:47 am)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Please help

Postby GeorgeQ » Tue Jun 20, 2017 3:29 am

I don't want concatenated each generations together, I just want use each historical monthly data.
so even I use GDG data, I still need to add new DDNAME
//M20171 DD DSN=A000000.MONTHDT.MONTH(-4),,DISP=SHR
//M20172 DD DSN=A000000.MONTHDT.MONTH(-3),,DISP=SHR
//M20173 DD DSN=A000000.MONTHDT.MONTH(-2),,DISP=SHR
//M20174 DD DSN=A000000.MONTHDT.MONTH(-1),DISP=SHR
//M20175 DD DSN=A000000.MONTHDT.MONTH(0),DISP=SHR

next month I will have to modify the code as show in below. for //M20171,becasue next month //A000000.MONTHDT.MONTH(0) will become data for June instead of May.
//M20171 DD DSN=A000000.MONTHDT.MONTH(-5),,DISP=SHR
//M20172 DD DSN=A000000.MONTHDT.MONTH(-4),,DISP=SHR
//M20173 DD DSN=A000000.MONTHDT.MONTH(-3),,DISP=SHR
//M20174 DD DSN=A000000.MONTHDT.MONTH(-2),DISP=SHR
//M20175 DD DSN=A000000.MONTHDT.MONTH(-1),DISP=SHR
//M20176 DD DSN=A000000.MONTHDT.MONTH(0),DISP=SHR
GeorgeQ
 
Posts: 28
Joined: Fri Jun 16, 2017 1:08 am
Has thanked: 12 times
Been thanked: 0 time

Next

Return to JCL