IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

RESTART the Proc


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kumar119119

New User


Joined: 31 May 2010
Posts: 23
Location: Pune

PostPosted: Wed Oct 20, 2010 10:45 pm
Reply with quote

Hi to All,
I faced these repeated confusing questions

1.Nested proc Restart

In JCL

//JS10 EXEC PROC01

In proc PROC01

PROC1 PROC
//STEP1 EXEC PGM=ABCD
//STEP2 EXEC PGM=XYZ
//STEP3 EXEC PROC=PROC02

In nested proc PROC02

//PROC02 PROC
//STEP4 EXEC PGM=PQRS
//STEP5 EXEC PGM=LMN

Now I want to restart STEP4 which is in nested proc PROC02

which is correct ?
a) RESTART=JS10.STEP4
b) RESTART=JS10.STEP3.STEP4

Please answer this, I searched this forum but couldn't find the answer,
If already a similar post is there please provide me that link


2)

Instream Proc RESTART ?

RESTART=Procname.Procstepname
or
RESTART=jobstepname.procstepname

which is correct?

3)

single Proc RESTART?

assume if a job has one proc, in that proc
a) only one step is there
b) three steps are there

now how do u restart both a & b?
either Procstepname or jobstepname.procstepname?

4)

RESTART single step only?

If a job has 10 steps,
if i want to execute only step6 i can use IEBEDIT,

I read in some posts in that they told

RESTART=STEP6,COND=(0,LE)

how is it possible,
restart=step6 means step6 executes,but cond=(0,le) means never execute that step,

instead restart=step6, after step6 if we give null indicator its enough,
please tell me this,
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Wed Oct 20, 2010 10:53 pm
Reply with quote

Now that you're not in the interview - please test and let us know.
Back to top
View user's profile Send private message
kumar119119

New User


Joined: 31 May 2010
Posts: 23
Location: Pune

PostPosted: Wed Oct 20, 2010 11:07 pm
Reply with quote

Hi Phrzby Phil,
Good Evening,

Now I released from the project,
I need to join in one week,
So, I can't test,

Please tell me the answer,

Thank you.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Oct 20, 2010 11:32 pm
Reply with quote

Just keep your thought process simple. Keep in mind a few basic rules:

- The RESTART syntax is always going to be:

,RESTART=* - restart at the first jobstep and, if used, first procstep.

,RESTART=STEPNAME - restart at the specified job step. If stepname refers to an EXEC statement that invokes a procedure, the step name of the step within the procedure must also be specified (see below).

,RESTART=STEPNAME.PROCSTEPNAME - restart at the specified step of a procedure. Stepname identifies the EXEC statement of the job step that calls the procedure; procstepname identifies the EXEC statement of the procedure step. The step identified by procstepname must contain the PGM keyword rather than invoke a procedure.

- The RESTART parameter can only be used in the JOB statement or in a
/*JOBPARM statement (on a JES2 system).
Back to top
View user's profile Send private message
kumar119119

New User


Joined: 31 May 2010
Posts: 23
Location: Pune

PostPosted: Wed Oct 20, 2010 11:58 pm
Reply with quote

Hi Kevin,
Thanks for your reply,

Please clarify me below of these ones,

1)

Usually my peers discussed& they told in some interviews that
Restart a proc is
Restart=procname.procstepname

Dats y i confused vch i need to use
Jobstepname.procstepname or procname.procstepname

Thats why i confused is this applicable for instream& catalog procs both or only for catlog procs
In my organisation i never saw instream proc, mostly at which scenario organisations use instream procs?

2)
I read in www.ibmmainframes.com/post-6914.html

In that Anuradha told

That in instream proc we can restart a step with restart=procname.procstepname
Thats why i posted like this

3)
Can you tell me which is correct in nested proc restart

Either jobstepname.procstepname
Or jobstepname.procname.procstepname

Here procname is nested proc name

4)
Tell me to execute only one step by restart=step6,cond=(0,le)
Hw its works as cond=(0,le) specifies that step never executes,
Please clarify these

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

Global Moderator


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

PostPosted: Thu Oct 21, 2010 12:37 am
Reply with quote

Again, the concept is rather simple. For your first question, you have the following elements:

A job:
Code:

//JOBA JOB ...
//JS10 EXEC PROC01


A cataloged procedure:

Code:

//PROC01 PROC
//STEP1 EXEC PGM=ABCD
//STEP2 EXEC PGM=XYZ
//STEP3 EXEC PROC=PROC02


Another cataloged procedure:

Code:

//PROC02 PROC
//STEP4 EXEC PGM=PQRS
//STEP5 EXEC PGM=LMN


Following the rules, you can code either:
Code:

//JOBA JOB ...,RESTART=*


which will restart the job at job step JS10 and proc PROC01 step STEP1, which is exactly the same as just re-submitting the same job.

or you can code ONLY one of these three:

Code:

//JOBA JOB ...,RESTART=JS10.STEP1


which will restart the job at job step JS10 and proc PROC01 step STEP1, just like above:

Code:

//JOBA JOB ...,RESTART=JS10.STEP2


which will restart the job at job step JS10 and proc PROC01 step STEP2:

Code:

//JOBA JOB ...,RESTART=JS10.STEP3


which will restart the job at job step JS10 and proc PROC01 step STEP3.

There are no other options. The ONLY way to get what is being asked is to either re-write the job to call PROC02 directly with the proper RESTART statement:

Code:

//JOBA JOB ...,RESTART=JS10.STEP4
//JS10 EXEC PROC02


or re-write PROC01 so that it ONLY invokes PROC02, and re-write PROC02 so that STEP4 is the first step, or avoid the whole mess altogether and not nest your proc's. It's a bad practice.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Oct 21, 2010 12:43 am
Reply with quote

For the second question, an instream proc follows the exact same rules. I tested it out to make sure, and removed my original comment about not using RESTART for an instream proc, although personally I've never seen instream procs used for real, and it seems as if it would be just as easy to edit the job and just change the proc, submit the job, then cancel your edit.

I think your third question's been answered.

I'm going to make one final comment before I end my involvement with this topic. I'm going to run this by the other Moderators, but I think we need to start pushing you posters to provide only REAL-WORLD solutions, not these esoteric, theoretical ones, and to start pushing back to the interviewers if they expect you to answer them otherwise. The answers need to based on YOUR experiences with standards/procedures that YOU have followed. I may have to follow a different set of standards/procedures where I work, so my answer might be quite different than yours, but correct anyway. I think you'd be hard-pressed to find any production control environment where they'd do anything more than change the default RESTART command per YOUR specifications and then re-run the job. I seriously doubt any would allow someone to actually implement a job with nested procedures, with maybe a few allowable exceptions. I doubt there are any that are going to use IEBEDIT, change COND or IF/THEN/ELSE statements, or anything else. For anything more, you'll probably have to implement an emergency change request and provide them with an edited version of the job and/or procedures, which they would then submit as-is.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Thu Oct 21, 2010 1:14 am
Reply with quote

superk wrote:
There are no other options. The ONLY way to get what is being asked is to either re-write the job to call PROC02 directly with the proper RESTART statement:

Code:

//JOBA JOB ...,RESTART=JS10.STEP4
//JS10 EXEC PROC02


or re-write PROC01 so that it ONLY invokes PROC02, and re-write PROC02 so that STEP4 is the first step, or avoid the whole mess altogether and not nest your proc's.

This seems not to be the case. Experimentation indicates that RESTART=STEP3.STEP4 is indeed efficacious (I'm running zOS 1.11.0, MVS SP7.1.1, and JES3, FWIW).
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Oct 21, 2010 1:52 am
Reply with quote

Holy crap!

Anyone know how/why that works?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Thu Oct 21, 2010 1:56 am
Reply with quote

superk wrote:
I think you'd be hard-pressed to find any production control environment where they'd do anything more than change the default RESTART command per YOUR specifications and then re-run the job. I seriously doubt any would allow someone to actually implement a job with nested procedures, with maybe a few allowable exceptions. I doubt there are any that are going to use IEBEDIT, change COND or IF/THEN/ELSE statements, or anything else. For anything more, you'll probably have to implement an emergency change request and provide them with an edited version of the job and/or procedures, which they would then submit as-is.

Again, this does not seem to be the case.

For the past half-dozen years, I have done software tools development, which very seldom takes me within shouting distance of the production LPARs or the issuance process. From 1995-2002, however, I was involved in ADMing general ledger systems (varying in size from one Canadian to one North American and South American) for a certain large manufacturer of mainframe hardware and software. The rules for these production systems were basically two-fold:
  1. If the system goes down, get it running ASAP.
  2. In case of doubt, refer to rule #1.

The operators were under orders to make no modifications to a failed job...but to run any JCL that we handed them to resolve the situation. Any JCL; they were not to make reply, not to reason why, not to comment, "Gee, this looks awfully like a Rexx exec intended to transfer accounts receivable to your checking account" (and some of the operators were sharp enough to notice that), but run it. The responsibility was entirely ours, the service analysts; on problem calls, we'd be working from home, and, if any of us needed to perform jumonji giri, the kitchen and the knife block were only a few steps away (none of us did, although there were a couple of occasions when it looked like it might be the easy way out).

Standards and procedures may have changed, there and everywhere, and I do myself and my fellow analysts the honor of suggesting that the rawest of us yet had considerably more knowledge, experience, and ability than the typical querents in this forum, and could thus get away with tricks that no sane manager would let them try. Nonetheless, I think it may be short-sighted to assume that a plea of, "We tried industry-standard procedures, and they didn't work" will be accepted by a crisis manager who is imagining his bonuses for the next millennium spiraling down the drain.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Thu Oct 21, 2010 1:59 am
Reply with quote

superk wrote:
Anyone know how/why that works?

The manual indicates that that reference will work when overriding a DD statement in a nested procedure, so it's not unreasonable to suppose that the RESTART parameter would -- and does -- accept it.
Back to top
View user's profile Send private message
kumar119119

New User


Joined: 31 May 2010
Posts: 23
Location: Pune

PostPosted: Thu Oct 21, 2010 12:05 pm
Reply with quote

Hi Akatsukami,

Thank you very much for Kevin & Akatsukami for your replies,

Finally by your answers what i understood is
i.e

1)

If there is a Nested proc, we need to write

RESTART=STEP3.STEP4

here STEP3= similar to JS10,
lik //JS10 EXEC PROC1

//STEP3 EXEC PROC2

and
STEP4= nested proc step name

Akatsukami,tell me one thing,
i.e
If we give RESTART=STEP3.STEP4

is control directly goes to step3 even if we don't mention the JS10 in the RESTART, for this case is JS10 no need?

Like one mention in the previous posts for single proc no need to mention jobstepname.procstepname, instead jus RESTART=procstepname is enough,

is it correct?

2)

Instream procs mostly organisations dont use,
so that RESTART a instream proc is no need to know

so, RESTART=procname.procstepname is wrong

3)

Tell me to execute only one step by restart=step6,cond=(0,le)
Hw its works as cond=(0,le) specifies that step never executes,
Please clarify these

so, please tell me is my uderstanding correct or not,
If not please tell me

Thanks in advance
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Oct 21, 2010 6:30 pm
Reply with quote

I am astonished icon_eek.gif

This is why I read this forum.

For years I thought, believed, was convienced that a restart within a nested proc was not possible.

I read the manuals and tried it many times with no success.

We have gone so far as to add an IEFBR14 step in the first proc to establish a restart point.

I tried what Akatsukami said and it worked!

Thanks for showing me the light.

P.S. - I also learned a new word.... efficacious
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Thu Oct 21, 2010 6:39 pm
Reply with quote

"efficacious" - having the power to produce a desired effect.

I presume then that you find "efficacious" to be in fact efficacious.

We say a word is autological if it refers to itself, and heterological otherwise.

So, "short" and "efficacious" are autological, whereas "long" and "green" are heterological.

The question is: Is "heterological" autological or heterological?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Thu Oct 21, 2010 7:52 pm
Reply with quote

kumar119119 wrote:
Akatsukami,tell me one thing,
i.e
If we give RESTART=STEP3.STEP4

is control directly goes to step3 even if we don't mention the JS10 in the RESTART, for this case is JS10 no need?

That is correct.

Quote:
Like one mention in the previous posts for single proc no need to mention jobstepname.procstepname, instead jus RESTART=procstepname is enough,

Now, don't get confused over this.

z/OS V1.R9.0 MVS JCL Reference states in the topic "Modifying Nested Procedures":
Quote:
Modifying or additional JCL statements apply to one level of nesting only. You can use statements to modify statements in a procedure only for the level of nesting at which the EXEC statement for that procedure appears.

Thus, it gives the examples:
Quote:
Procedure C:
Code:
      //C       PROC
      //CS1     EXEC  PGM=CCC
      //CS1DD1  DD    DSNAME=A.B.C,DISP=SHR
      //CS1DD2  DD    SYSOUT=A
      //        PEND

Procedure B:
Code:
      //B       PROC
      //BS1     EXEC  PROC=C
      //CS1.CS1DD1  DD  DSNAME=X.Y.Z       This statement is a valid
      //*                                  override of procedure C, stepCS1
      //*                                  for DD CS1DD1
      //*
      //CS1.CS1DD3  DD  SYSOUT=A           This statement is a valid
      //*                                  addition to procedure C, step CS1
      //BS2     EXEC  PGM=BBB
      //BS2DD1  DD    DSNAME=E,DISP=SHR
      //        PEND

Procedure A:
Code:
      //A       PROC
      //AS1     EXEC  PROC=B
      //BS2.BS2DD2  DD  DSNAME=G,DISP=SHR  This statement is a valid
      //*                                  addition to procedure B, step BS2
      //AS2     EXEC  PGM=AAA
      //AS2DD1  DD    DSNAME=E,DISP=SHR
      //        PEND

Job Stream:
Code:
      //JOB1    JOB
      //STEP1   EXEC  PROC=A
      //AS2.AS2DD2  DD  DSNAME=G,DISP=SHR  This statement is a valid
      //*                                  addition to procedure A, step AS2
      //STEP2   EXEC  PGM=IEFBR14

and
Quote:
Procedure C:
Code:
      //C        PROC
      //CS1      EXEC  PGM=CCC
      //CS1DD1   DD    DSN=A.B.C,DISP=SHR
      //CS1DD2   DD    SYSOUT=A
      //         PEND

Procedure B:
Code:
      //B        PROC
      //BS1      EXEC  PROC=C
      //CS1.CS1DD1  DD  DSNAME=X.Y.Z
      //CS1.CS1DD3  DD  SYSOUT=A
      //BS2      EXEC  PGM=BBB
      //BS2DD1   DD    DSN=E,DISP=SHR
      //         PEND

Procedure A:
Code:
      //A        PROC
      //AS1      EXEC  PROC=B
      //BS1.CS1.CS1DD1 DD DSN=X.Y.Z    This statement is an invalid
      //*                              override of procedure B, step BS1,
      //*                              DD CS1.CS1DD1 (rules 4 and 5)
      //*
      //BS1.CS1.CS1DD3 DD SYSOUT=A     This statement is an invalid
      //*                              override of procedure B, step BS1,
      //*                              DD CS1.CS1DD3 (rules 4 and 5)
      //*
      //BS1.BS1DD1 DD  DSN=G,DISP=SHR  This statement is an invalid
      //*                              addition to procedure B, step BS1
      //*                              (rule 3)
      //AS2      EXEC  PGM=AAA
      //AS2DD1   DD    DSN=E,DISP=SHR
      //         PEND

Job Stream:
Code:
      //JOB1     JOB
      //STEP1    EXEC  PROC=A
      //AS1.BS1.CS1.CS1DD1 DD DSN=X    This statement is an invalid
      //*                              override of procedure A, step AS1,
      //*                              DD BS1.CS1.CS1DD1 (rules 3 and 5)
      //STEP2    EXEC  PGM=IEFBR14

Now, I don't have the source for the JES DSPs and, as I am neither an assembler nor a PL/X programmer, it would do me no good if I did. However, it is reasonable to assume that the same logic, and probably the same code, is used to resolve stepname references in every case, including for the RESTART parameter (this is essentially a longer-winded version of what I said to superk yesterday). So, we may never have a reference more than one level deep. Thus, if we wish to restart at STEPY in a proc at any level of nesting, we must find the step in the proc -- which may itself be nested several levels deep -- that invokes that proc, and (assuming that it be named STEPX) code RESTART=STEPX.STEPY on the job card.
Back to top
View user's profile Send private message
kumar119119

New User


Joined: 31 May 2010
Posts: 23
Location: Pune

PostPosted: Thu Oct 21, 2010 8:20 pm
Reply with quote

Hi Akatsukami,

Thanks a lot for ur kind replies,

Hi daveporcelan,

We must say thanks to Akatsukami as he gave a great solution to this post,

Thanks again Akatsukami,

I asked in some posts but instead of giving solution,
they replied me "you first test& tell us",

but Akatsukami gave an excellent solution,

Thank you.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Starting a PROC with parameters from ... CLIST & REXX 6
No new posts IMS Restart Failure IMS DB/DC 4
No new posts Proc print in Mainframe All Other Mainframe Topics 4
No new posts Restart logic by using cursor name in... DB2 1
No new posts trying to set return code in PROC JCL & VSAM 15
Search our Forums:

Back to Top