View previous topic :: View next topic |
Author |
Message |
Mouli Beginner
Joined: 07 Jun 2003 Posts: 18 Topics: 7
|
Posted: Tue Dec 11, 2007 6:18 pm Post subject: How to pass a current date |
|
|
Hi all,
I tried searching for this in the forum, i could not get what i was looking for. If i miss anything, please let me know.
Okay. this is what i was looking for, I need to pass current date to the PARM parameter. So, that COBOL program can look into the PARM value and process.
I know, we can directly use the current date in the program and process instead of passing curent date through a PARM and process. We have lot of things in the down below of the JCL. So, we need current to be passed through PARM field in the JCL.
One restriction is that, this needs to be done in one job. That is, i have a solution where i can do this by a INTRDR submitting with current date, which we don't need. Do you guys have any idea..
Thanks for your help _________________ Regards,
Mouli |
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Tue Dec 11, 2007 6:25 pm Post subject: Re: How to pass a current date |
|
|
Mouli wrote: | Do you guys have any idea |
No, not really. Where do you intend to get this date value from? An external dataset? The job scheduling system? Don't forget that a variable value passed via the PARM has to be resolved before the job can execute. |
|
Back to top |
|
 |
sriramla Beginner
Joined: 22 Feb 2003 Posts: 74 Topics: 1
|
Posted: Wed Dec 12, 2007 9:57 am Post subject: |
|
|
Your job scheduler will have variables that gives the current day,month, year etc. Consult the manual to get those variables and pass them in the PARM. |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Wed Dec 12, 2007 12:32 pm Post subject: |
|
|
You can also use SORT to build a control card containing current date (in one of various formats) and read it into the program in the next step from a file. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Thu Dec 13, 2007 12:34 am Post subject: |
|
|
Mouli,
I feel you can get the current date inside the pgm itself than resorting to tougher methods.
Quote: |
I know, we can directly use the current date in the program and process instead of passing curent date through a PARM and process. We have lot of things in the down below of the JCL. So, we need current to be passed through PARM field in the JCL.
|
I am still wondering y to resort to difficult methods to get the current date. _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Thu Dec 13, 2007 9:49 am Post subject: Re: How to pass a current date |
|
|
Mouli wrote: | We have lot of things in the down below of the JCL. | Perhaps the job runs several days and all the "down below" steps need to use the same date as the initial step?
It is our nature to find the best/easiest method to accomplish a goal but it is made more difficult when the requirement is not fully explained to us. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
sriramla Beginner
Joined: 22 Feb 2003 Posts: 74 Topics: 1
|
Posted: Thu Dec 13, 2007 10:02 am Post subject: |
|
|
vivek1983 wrote: | Mouli,
I feel you can get the current date inside the pgm itself than resorting to tougher methods.
|
Vivek, One good point in passing the date thru parm instead of getting in the program is for easy rerun. If you want to rerun the program for past dates, its easy to change the PARM and resubmit. Another issue in getting the date in the program is mid-night window issue. When the program is scheduled to run at 11:00pm but it got delayed by couple of hours, then program will use next day's date and may give incorrect results. Passing the date thru parm will prevent this. Note that, the Jobs will usually be loaded in the scheduler in the evening and all symbolics would be resolved by that time. |
|
Back to top |
|
 |
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Thu Dec 13, 2007 10:34 am Post subject: |
|
|
As pointed out in previous replies, the PARM values on the JCL EXEC statements are resolved before the first program executes, so there really is no opportunity for a program in the JOB to generate the PARM values for JCL EXEC statements.
If you're running the programs using the RUN PROGRAM command in IKJEFT01 (or an alias of it), you could have a program generate a PARM statement and save it to a dataset and concat the dataset following the RUN PROGRAM. But I don't know of any way to generate a PARM value for a JCL EXEC statement.
Code: |
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD *
PARMS('12/13/2007')
//SYSUT2 DD DSN=WORK.RUNDATE,DISP=(,CATLG,DELETE),
// UNIT=DISK,SPACE=(TRK,1),RECFM=FB,LRECL=80,BLKSIZE=0
...
...
//STEP2 EXEC PGM=IKJEFT01
...
//SYSTSIN DD *
RUN PROGRAM(PGMB) -
// DD DSN=WORK.RUNDATE,DISP=SHR
|
|
|
Back to top |
|
 |
Mouli Beginner
Joined: 07 Jun 2003 Posts: 18 Topics: 7
|
Posted: Thu Dec 13, 2007 2:41 pm Post subject: |
|
|
Thanks a lot for all your views/ideas guys.. We ended up modifying the program to accept the current date and in the "down below process", as i mentioned earlier we used this date and processed.
Once again thanks for all your ideas.
Thanks
Mouli _________________ Regards,
Mouli |
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Thu Dec 13, 2007 2:45 pm Post subject: |
|
|
If executing past midnight is a possibility, you can check time of day and adjust current date if needed. _________________ ....Terry |
|
Back to top |
|
 |
|
|