MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing parameters

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
pvrajs
Beginner


Joined: 07 Jan 2005
Posts: 41
Topics: 12

PostPosted: Tue May 10, 2005 8:58 am    Post subject: Passing parameters Reply with quote

Hi,

I have a typical situation.

I have a Job which executes a set of Natural programs, say 6 in number. Out of the 6 Natural programs 3 programs use a date card.

I want to run this job for a previous date range, say Mar 1 2005 to Apr 15 2005. I dont want to manually change the datecard for every run.

Is it possible to automate in such a way that is job is run once for every date and automatically flips the date and runs again. As I want to run for previous date, I think I cant use a job schedular and that too .. I want to run for all the dates today only.

Please let me know if we have any way. please provide me the sample code too. Please suggest me at the earliest, as this is very critical to me. Otherwise I need to keep on submitting the job 'n' times.

Thanks for the help.
_________________
Thanks for help
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue May 10, 2005 9:08 am    Post subject: Reply with quote

pvrajs,

Quote:

I want to run this job for a previous date range, say Mar 1 2005 to Apr 15 2005. I dont want to manually change the datecard for every run.


So you want to increment the date for every run ?

ie.
Code:

run       date

1         March 1st 2005
2         March 2nd 2005
3         March 3rd 2005
....


What is the format of the date? CCYY/MM/DD ?


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pvrajs
Beginner


Joined: 07 Jan 2005
Posts: 41
Topics: 12

PostPosted: Tue May 10, 2005 9:28 am    Post subject: Reply with quote

033005

mmddyy
_________________
Thanks for help
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue May 10, 2005 9:43 am    Post subject: Reply with quote

Pvrajs,

I can't read your requirement sitting at my desk. You did not answer my first question. So I going with the assumption that you want to increment the date for every run. Here is the basic set up. You might have to change your pgms to read the date in mmddyy format.

Create a 80 byte(FB recfm) file with starting date enclosed in quotes.

i.e
Code:

       PVRAJS.DATECARD.FILE                       
 ===>                                         
***************************** Top of Data *
'2005-03-01'                               
**************************** Bottom of Data



Now in your JCL
Code:

//STEP0100  EXEC PGM=NATURAL1
//PARM DATE DD   DSN=PVRAJS.DATECARD.FILE,
//               DISP=SHR
...

//STEP0200  EXEC PGM=NATURAL2
//PARM DATE DD   DSN=PVRAJS.DATECARD.FILE,
//               DISP=SHR
..

//LASTSTEP EXEC PGM=IKJEFT01                       
//SYSTSPRT DD  SYSOUT=*,DCB=BLKSIZE=121             
//SYSPRINT DD  SYSOUT=*                             
//SYSTSIN  DD  *                                   
 DSN SYSTEM(XXX)                                   
 RUN  PROGRAM(DSNTIAUL) -                           
      PLAN(DSNTIAUL)    -                           
      PARMS('SQL')      -                           
      LIB('DB2P.RUNLIB.LOAD')                       
//SYSREC00 DD DSN=PVRAJS.DATECARD.FILE,
//            DISP=OLD
//SYSPUNCH DD SYSOUT=*                             
//SYSIN    DD *                                     
 SELECT CHAR('''')                                 
       ,DATE(                                       
//         DD DSN=PVRAJS.DATECARD.FILE,
//            DISP=SHR
//         DD *                                     
 ) + 1 DAY                                         
      ,CHAR('''')                                   
      ,CHAR(' ',68)                                 
   FROM SYSIBM.SYSDUMMY1                           
   ;                                               
/*


So for every run the date is incremented by 1 day in the last step. To verify the code, just run the last step 2 or 3 times and check the contents of pvrajs.datecard.file after every run.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pvrajs
Beginner


Joined: 07 Jan 2005
Posts: 41
Topics: 12

PostPosted: Tue May 10, 2005 11:34 pm    Post subject: Reply with quote

Thanks for the reply .. but I want to submit the job also automatically for the said range. From the code I understand that this is not does .. I need to submit the job for every date change.
_________________
Thanks for help
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed May 11, 2005 8:43 am    Post subject: Reply with quote

Pvrajs,

you can submit the JCL to run 45 times by submitting 1 single job.

Let us say your JCL is named RUNJCL in the pds PVRAJS.TEST.JCL

now create another job like as below. Code 46 sub stmts for submitting the job 46 times (March 1st to apr 15th = 46 days). since all the jobs have the same jobcard , then will execuete one after another hoping that your system does not allow running duplicate jobs.

Code:

//STEP0010 EXEC PGM=IKJEFT01               
//SYSUDUMP DD SYSOUT=*                     
//SYSTSPRT DD SYSOUT=*                     
//SYSOUT   DD SYSOUT=*                     
//SYSTSIN  DD *                           
 SUB 'PVRAJS.TEST.JCL(RUNJCL)'       
 SUB 'PVRAJS.TEST.JCL(RUNJCL)'       
 SUB 'PVRAJS.TEST.JCL(RUNJCL)'       
 ....
/*                                         


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group