Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Run 2 JCLs using a single JOB
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

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

New User


Joined: 12 Apr 2005
Posts: 64

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: 156

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

New User


Joined: 12 Apr 2005
Posts: 64

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: 156

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

New User


Joined: 12 Apr 2005
Posts: 64

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: 156

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

New User


Joined: 12 Apr 2005
Posts: 64

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

New User


Joined: 12 Apr 2005
Posts: 64

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

Active User


Joined: 10 Mar 2005
Posts: 432
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
andycool

New User


Joined: 12 Apr 2005
Posts: 64

PostPosted: Sun May 08, 2005 12:45 pm    Post subject:
Reply with quote

Hi MGIndalco, gald you are back !
As i have tried to explain earlier, i have a chain of jobs wch are automatically loaded one after another.
Now, i want some notification to be given to the programmar that, the first job is successfully over and the second is going to start as on; second job is successfully over and third is going to start.
I thought of the NOTIFY parameter but that is not the ideal way as it juss flashes for a second and goes off in a zippy.
Also, the notification or all the jobs are sent at the end of the cycle, like: i ran a cycle of 4 jobs successfully, i received 4 notifications together as the end of last job.

Please get back if its still not clear,
Thanks in Advance,
Back to top
View user's profile Send private message
MGIndaco

Active User


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

PostPosted: Mon May 09, 2005 1:54 pm    Post subject:
Reply with quote

Ok, If can be useful... when you submit next job, you can also, in the same step, send a message to users with "Send" command as you can see below:
SEND '************************' USER(USER1)
SEND 'Phase 1 ended without errors' USER(USER1)
SEND 'Phase 2 submitted ' USER(USER1)
SEND '************************' USER(USER1)
SEND '************************' USER(USER2) LOGON
SEND 'Phase 1 ended without errors' USER(USER2) LOGON
SEND 'Phase 2 submitted ' USER(USER2) LOGON
SEND '************************' USER(USER2) LOGON

User1 will receive the message at the moment and so User2 but the second, if is not logged on, will also receive the message when he'll have access to the system.

If this is not what you are looking for, I'll try to explain you method and consequences about use of WTO messages.
Back to top
View user's profile Send private message
andycool

New User


Joined: 12 Apr 2005
Posts: 64

PostPosted: Tue May 10, 2005 3:16 pm    Post subject:
Reply with quote

Hi MG,
From wht you have illustrated above, i understand that, SEND is again like the NOTIFY parameter and this msg will just flash on the scrn.
Tomorrow if i go in =s.st and look for that particular job run, i wont be able to find the msg that was flashed, as in case of a sysout.
My requirement is whtever msg that is given to the user need not be flashed on the TSO but shud be present in the jobrun.

Example:
/*
//Job1step1
//Job1step2
If successful execute Job1submit else Job1msg
//Job1submit
//Job1msg exec pgm=abc
/*

Here, I shud be able to c in the sysout of step "Job1msg" some msg like "Aborting the job, process incomplete"

Is there any utility "abc" as above with which i can do this. Or please suggest some other idea.

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

Active User


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

PostPosted: Tue May 10, 2005 6:55 pm    Post subject:
Reply with quote

Ok, try but with JCL IF-ELSE-ENDIF
i.e.

//JOB1STEP1 EXEC PGM=...
//JOB1STEP2 EXEC PGM=...
//*-------------------------------------------*
//*- TEST OF PREVIOUS STEPS:
//*- mod1 TEST SINGLE STEP
//*- mod2 TEST MAXCC
//*-------------------------------------------*
mod1//TESTJOB1 IF JOB1STEP1.RC = 0 AND JOB1STEP2.RC = 0 THEN
mod2//TESTJOB1 IF RC = 0 THEN
//*-------------------------------------------*
//*- EXECUTION ENDED WITHOUT ERRORS
//*-------------------------------------------*
//JOB1SUB2 -> submit the second job
//JOB1END EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INPUT DD *
Job ended successfully
//OUTPUT DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(INPUT) OUTFILE(OUTPUT)
/*
//*-------------------------------------------*
//*- EXECUTION ENDED WITH ERRORS
//*-------------------------------------------*
//TESTJOB1 ELSE
//JOB1END EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INPUT DD *
Job ended with errors.
//OUTPUT DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(INPUT) OUTFILE(OUTPUT)
/*
//TESTJOB1 ENDIF
//*-------------------------------------------*
//*- END OF JOB
//*-------------------------------------------*
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue May 10, 2005 7:22 pm    Post subject: Re: Run 2 JCLs using a single JOB
Reply with quote

MGIndaco, from his last post, it DOES sound like andycool wants to use a Write-To-Operator (WTO) function so that the messages appear in the job's output stream (JESMSGLG).
Back to top
View user's profile Send private message
MGIndaco

Active User


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

PostPosted: Tue May 10, 2005 8:36 pm    Post subject:
Reply with quote

Ok, excuse me for my superficial understanding. icon_redface.gif
To write to operator, you must know the name of assembler routine installed on your system that manage wto(or look for a sample in the net), then you can call it with various languages and manage answer as you desire.
But, I don't understand why, at the end of our reasoning, Andy, you are still looking for a solution that wait a wto reply, needing so an unnecessary manual activity.
icon_question.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Any single step solution possible? Rohit Umarjikar SYNCSORT 7 Mon Apr 22, 2019 6:18 am
No new posts Split single i/p line into multiple l... elixir1986 DFSORT/ICETOOL 2 Wed Feb 27, 2019 12:47 am
No new posts Single step to take backup of multipl... Vignesh Sid JCL & VSAM 1 Thu Nov 29, 2018 8:12 pm
No new posts DUMP A Multi volume datasets and rest... lind sh JCL & VSAM 6 Mon Oct 01, 2018 12:02 pm
No new posts Merge two files and sum up the count ... preeti6 JCL & VSAM 6 Thu Sep 06, 2018 10:57 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us