Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Run 2 JCLs using a single JOB
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
andycool

Active User


Joined: 12 Apr 2005
Posts: 65

PostPosted: Mon Apr 18, 2005 9:45 pm    Post subject:
Reply with quote

Hey MGIndalco,
The step SUBMIT2..shud that be given after the JOB TERMINATION step or b4 that?
I mean shud this be the last step in the JCL?

Plz acknowledge.

Regards,
Back to top
View user's profile Send private message
References
PostPosted: Mon Apr 18, 2005 9:45 pm    Post subject: Re: Reply with quote

die7nadal

Active User


Joined: 23 Mar 2005
Posts: 154

PostPosted: Tue Apr 19, 2005 12:29 am    Post subject:
Reply with quote

andycool wrote:
Hey MGIndalco,
The step SUBMIT2..shud that be given after the JOB TERMINATION step or b4 that?
I mean shud this be the last step in the JCL?

Plz acknowledge.

Regards,


Yes, the Submit STEP should be the last step of every Job.
Back to top
View user's profile Send private message
anuradha

Global Moderator


Joined: 06 Jan 2004
Posts: 257

PostPosted: Tue Apr 19, 2005 12:41 am    Post subject:
Reply with quote

Hi Andycool,

SUBMIT2 step should be the last step of job1. So once the steps of job1 are finished JOB1 will execute the SUBMIT2 step which will submit the second job.

If the jobs are interrelated then we should give cond parameter too.
Back to top
View user's profile Send private message
andycool

Active User


Joined: 12 Apr 2005
Posts: 65

PostPosted: Tue Apr 19, 2005 7:32 pm    Post subject:
Reply with quote

Thanks for the comments guyz...
I appretiate your help.
Back to top
View user's profile Send private message
andycool

Active User


Joined: 12 Apr 2005
Posts: 65

PostPosted: Sun Apr 24, 2005 11:14 am    Post subject:
Reply with quote

Hi Guys,
As per your above comments the SUBMIT2 step will be the last step. As i am chaining here a series of jobs, it will be necessary for me to keep a track of Return Codes. For instance:

===========================================
Job1step1
Job1step2
Job1step3
Job1SUBMIT2 //this will submit the job JOB2
Job2step1
Job2step2
Job2step3
Job2SUBMIT3 //this will submit the job JOB3
==========================================

As illustrated above if i want to chk a condition that :

If the RC of Job1 = 0 then only proceed with the step Job1SUBMIT2...how can i do this?
As i am chaining a series of jobs, this check will be required to ensure that the previous job has finished successfully and the next job in the series can be submitted.

Regards,
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 154

PostPosted: Mon Apr 25, 2005 8:43 am    Post subject:
Reply with quote

andycool wrote:
Hi Guys,
As per your above comments the SUBMIT2 step will be the last step. As i am chaining here a series of jobs, it will be necessary for me to keep a track of Return Codes. For instance:

===========================================
Job1step1
Job1step2
Job1step3
Job1SUBMIT2 //this will submit the job JOB2
Job2step1
Job2step2
Job2step3
Job2SUBMIT3 //this will submit the job JOB3
==========================================

As illustrated above if i want to chk a condition that :

If the RC of Job1 = 0 then only proceed with the step Job1SUBMIT2...how can i do this?
As i am chaining a series of jobs, this check will be required to ensure that the previous job has finished successfully and the next job in the series can be submitted.

Regards,


U can either use an IF statement like below,

IF Job1step3.RC=0 THEN
Job1SUBMIT2
ENDIF

Or

Job1SUBMIT2 EXEC PGM,PARM=(0,LT)
Back to top
View user's profile Send private message
andycool

Active User


Joined: 12 Apr 2005
Posts: 65

PostPosted: Tue Apr 26, 2005 5:30 pm    Post subject:
Reply with quote

Hey die7 thanks for that.
Please tell me if the below psuedo code is valid or not:

======================
Job1step1
Job1step2
IF Job1step2.RC <> 0 THEN // I want to continue execution of
// Job1tep3 even though Job1Step2
// is not properly executed.

Job1step3
ENDIF
Job1step3
IF Job1step3.RC = 0 THEN
Job1SUBMIT2
ENDIF
Job1SUBMIT2 //this will submit the job JOB2
Job2step1
Job2step2
Job2step3
Job2SUBMIT3 //this will submit the job JOB3
===========================================

Bottomline: To continue the job even though Job1Step2 is not properly executed. That is not to abend the job at any point of time.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 154

PostPosted: Tue Apr 26, 2005 7:29 pm    Post subject:
Reply with quote

andycool wrote:

If the RC of Job1 = 0 then only proceed with the step Job1SUBMIT2...how can i do this?


Since u said u want to check it for 0 and only then proceed I coded it, taht way.

If u want to execute the STEP even though if it has some CC Greater than or Equal to Zero , the easiest way wud be to give COND=(0,GT).
Back to top
View user's profile Send private message
andycool

Active User


Joined: 12 Apr 2005
Posts: 65

PostPosted: Tue Apr 26, 2005 11:09 pm    Post subject:
Reply with quote

Hi Guys,
I have tried here to structure a job, considering all your inputs especially those from MGIndalco and Die7 in the thread. This is just the first job in the chain. It'll look like this:

==========================================
//Job1 JOB ...
//
//Job1step1
//
//Job1step2
//
//Job1step3
//
//JOB1SUBMIT2 EXEC PGM=IKJEFT01,
// COND=(0,GT),
// PARM='',DYNAMNBR=50,
// REGION=4096K
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
PROF PREFIX(ANDYCOOL)
SUBMIT 'ANDYCOOL.TEST.JOBS(JOB2)'
==========================================
This will submit the Job2.
The COND=(0,GT) will submit the JOB2 even though the prevoius job maxcc is not zero.

Please let me know if i am missing any segments here.
Also let me know, in the "PROF PREFIX(USERID)"; is the userid is my TSOid ?

Thanks in Advance,
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 154

PostPosted: Wed Apr 27, 2005 12:15 am    Post subject: Re: Run 2 JCLs using a single JOB
Reply with quote

Ya u shud be good to go, I hope u already know what u mean by the PROF command. It will prefix all unqualified Datasets with the prefix mentioned, that Id is ur TSO id. Make sure the Input files are all having the high level qualifier as ur TSO ID.
Back to top
View user's profile Send private message
andycool

Active User


Joined: 12 Apr 2005
Posts: 65

PostPosted: Wed Apr 27, 2005 10:29 pm    Post subject:
Reply with quote

Hi Die7,
I sucessfully ran a chain of two jobs using the above suggesstions given by you.
But there's more yet to come. I hope you are not bored solving the doubts

Thanks a lot !

Regards,
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 154

PostPosted: Wed Apr 27, 2005 10:31 pm    Post subject: Re: Run 2 JCLs using a single JOB
Reply with quote

Anytime.
Back to top
View user's profile Send private message
andycool

Active User


Joined: 12 Apr 2005
Posts: 65

PostPosted: Wed May 04, 2005 2:41 pm    Post subject:
Reply with quote

Hi Die7,
Just when i thought it was over, yet a new doubt related to same topic.

Till this point i successfully ran a chain consisting of four jobs.
JOB1=>JOB2=>JOB3=>JOB4
This is working fine.

One of my requirement is, to get a msg in SYSOUT at the end of each job, like:
At the end of JOB1 in its sysout the msg shud be
"Msg- Job1 successful, proceeding to Job2"
and so on

Is there anyway i can get this.
Please let me know,
Thanks in Advance !
Back to top
View user's profile Send private message
andycool

Active User


Joined: 12 Apr 2005
Posts: 65

PostPosted: Fri May 06, 2005 3:06 pm    Post subject:
Reply with quote

Can anyone help me in this ?
Please respond !

Regards
Back to top
View user's profile Send private message
MGIndaco

Moderator


Joined: 10 Mar 2005
Posts: 479
Location: Milan, Italy

PostPosted: Fri May 06, 2005 9:42 pm    Post subject:
Reply with quote

Hi Andycool, I don't understand your request... are you looking for way to put a message as a WTO upon console? Or are you only looking for a way to append results of execution in another output?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 HoursGoto page Previous  1, 2, 3  Next
Page 2 of 3