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

Restart step which is in IF condition


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 22
Location: Hyderabad

PostPosted: Wed Jul 09, 2008 12:29 pm
Reply with quote

I have job as below.
Code:

//LSNBEMT  JOB (54035,2140,00000,1111),'DOESNT EXIST PS',
//     CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID,MSGLEVEL=(1,1),
//     RESTART=STEP02
//STEP01   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
  LISTCAT ENTRIES('LSKT00.BLPLAN1.PS.TEST2')
/*
//IFBLK    IF (STEP01.RC = 0) THEN
//*
//STEP02   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
  LISTCAT ENTRIES('LSKT00.BLPLAN1.PS.TEST2')
/*
//STEP03   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
  LISTCAT ENTRIES('LSKT00.BLPLAN1.PS.TEST2')
/*
//ENDIFBLK ENDIF

Here i am trying to restart job from STEP02 which is in IF block, but the step was not executed(may be because at the restart time STEP01 Return code may not be available.
Can anyone help me to restart this job from STEP02 by changing jobcard but without changing the job(using COND param) as it is a production job.
Back to top
View user's profile Send private message
Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 22
Location: Hyderabad

PostPosted: Wed Jul 09, 2008 12:38 pm
Reply with quote

small correction:

Below is the jobcard(It should not have any step other than calling proc as per client standards)
Code:

//LSNBEMT  JOB (54035,2140,00000,1111),'DOESNT EXIST PS',
//     CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID,MSGLEVEL=(1,1),
//     RESTART=PROC.STEP02
//     JCLLIB ORDER=LSNB00.LI.CNTL
//PROC    EXEC IFPROC4


Below is the proc

Code:

//IFPROC4 PROC IFPROC4
//STEP01   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
  LISTCAT ENTRIES('LSKT00.BLPLAN1.PS.TEST2')
/*
//IFBLK    IF (STEP01.RC = 0) THEN
//*
//STEP02   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
  LISTCAT ENTRIES('LSKT00.BLPLAN1.PS.TEST2')
/*
//STEP03   EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
  LISTCAT ENTRIES('LSKT00.BLPLAN1.PS.TEST2')
/*
//ENDIFBLK ENDIF
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Jul 09, 2008 2:01 pm
Reply with quote

Please post the output from the failed attempt.
Back to top
View user's profile Send private message
Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 22
Location: Hyderabad

PostPosted: Wed Jul 09, 2008 2:49 pm
Reply with quote

expat,
below is the output for the JCL. STEP02 and STEP03 are being FLUSHed(not exected).

JOBNAME STEPNAME PGM NAME RC
LSNBEMT STEP01 IDCAMS 04
LSNBEMT STEP02 IDCAMS FLUSH
LSNBEMT STEP03 IDCAMS FLUSH
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Jul 09, 2008 3:05 pm
Reply with quote

Maybe they are not being executed because STEP01 has issued a RC04, and in this case they are NOT to be processed.

So where is the output from your restart - which is what I wanted to see.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jul 09, 2008 4:03 pm
Reply with quote

Hi,

this question has been asked before

see link http://ibmmainframes.com/viewtopic.php?t=26541&highlight=nullify



Gerry
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Wed Jul 09, 2008 6:41 pm
Reply with quote

Hi,
Bharath Nadipally wrote:
Below is the proc

Tried to simulate the condition in question, I got the below error..

Code:
IN-STREAM DATA NOT ALLOWED IN PROC

Don't You get this with the code shown..?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jul 10, 2008 8:11 am
Reply with quote

Hi,

lets assume the PROC has no instream data, how do you restart STEP02 without altering the PROC ?

With normal restart, STEP02 & STEP03 just flush


Gerry
Back to top
View user's profile Send private message
Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 22
Location: Hyderabad

PostPosted: Thu Jul 10, 2008 11:15 am
Reply with quote

Hi Gerry,

Problem was solved. Thank you very much.
Back to top
View user's profile Send private message
Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 22
Location: Hyderabad

PostPosted: Thu Jul 10, 2008 11:19 am
Reply with quote

Hi anuj,

Actually I was running as a job in test library. But while moving to production, i have to have jobcard and proc as separate. so i have posted like that. Anyway, thank you for all your suggestions.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jul 10, 2008 11:58 am
Reply with quote

Hi,

my question still stands, can a restart be done when IF conditions are in a PROC without modyfying the PROC and actually executing the restarted step ?


Gerry
Back to top
View user's profile Send private message
P.RAJESH
Currently Banned

New User


Joined: 20 Mar 2008
Posts: 54
Location: chennai

PostPosted: Thu Jul 10, 2008 12:30 pm
Reply with quote

hi,

i tried your requirement by changeing the your if condition
shown below

//IFBLK IF (STEP01.RC = 0) | (¬STEP01.RUN)


Try with also.
Back to top
View user's profile Send private message
Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 22
Location: Hyderabad

PostPosted: Thu Jul 10, 2008 4:52 pm
Reply with quote

Rajesh,

The same is suggested in below link which is given by Gerry.
ibmmainframes.com/viewtopic.php?t=26541&highlight=nullify
Back to top
View user's profile Send private message
Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 22
Location: Hyderabad

PostPosted: Thu Jul 10, 2008 4:55 pm
Reply with quote

Gerry,

I have tried and it is possible. What rajesh has suggested was in the link given by you.

ibmmainframes.com/viewtopic.php?t=26541&highlight=nullify
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Sat Jul 12, 2008 5:21 pm
Reply with quote

Hi,

maybe I'm missing something here, how do you override the PROC or are you suggesting to put //IFBLK IF (STEP01.RC = 0) | (¬STEP01.RUN)
permanetly in the PROC ?


Gerry
Back to top
View user's profile Send private message
P.RAJESH
Currently Banned

New User


Joined: 20 Mar 2008
Posts: 54
Location: chennai

PostPosted: Mon Jul 14, 2008 10:29 am
Reply with quote

hi,

I prefer to place the if condition in procedure premenentaly.

your quote : how do you override the PROC

I am not clear with the above sentence.

I feel happy if you describe with an exmaple ?

Please....
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Jul 14, 2008 11:16 am
Reply with quote

Hi Rajesh,

let's start from scratch, hereunder is a PROC
Code:
//A       PROC                                                         
//*                                                                     
//**********************************************************************
//*                                                                     
//STEP01   EXEC PGM=IEFBR14                                             
//*                                                                     
//**********************************************************************
//*                                                                     
//CHECK01  IF (STEP01.RC = 0) THEN                                     
//*                                                                     
//STEP02   EXEC PGM=IEBGENER                                           
//*                                                                     
//CHECK01  ENDIF                                                       
//*                                                                     
//**********************************************************************
//CHECK02  IF (STEP02.RC = 0) THEN                                     
//*                                                                     
//STEP03   EXEC PGM=IEFBR14                                             
//*                                                                     
//CHECK02  ENDIF                                                       
//*                                                                     
//**********************************************************************
//CHECK03  IF (STEP03.RC = 0) THEN                                     
//*                                                                     
//STEP0004 EXEC PGM=IEFBR14                                             
//*                                                                     
//CHECK03  ENDIF                                                       
//*                                                                     
//**********************************************************************




Now are you saying I should set it up this way to enable restarts not to flush
Code:
//A       PROC                                                         
//*                                                                     
//**********************************************************************
//*                                                                     
//STEP01   EXEC PGM=IEFBR14                                             
//*                                                                     
//**********************************************************************
//*                                                                     
//CHECK01  IF (STEP01.RC = 0) | (¬STEP01.RUN) THEN                     
//*                                                                     
//STEP02   EXEC PGM=IEBGENER                                           
//*                                                                     
//CHECK01  ENDIF                                                       
//*                                                                     
//**********************************************************************
//CHECK02  IF (STEP02.RC = 0) | (¬STEP02.RUN) THEN                     
//*                                                                     
//STEP03   EXEC PGM=IEFBR14                                             
//*                                                                     
//CHECK02  ENDIF                                                       
//*                                                                     
//**********************************************************************
//CHECK03  IF (STEP03.RC = 0) | (¬STEP03.RUN) THEN                     
//*                                                                     
//STEP0004 EXEC PGM=IEFBR14                                             
//*                                                                     
//CHECK03  ENDIF                                                       
//*                                                                     
//**********************************************************************



Gerry
Back to top
View user's profile Send private message
P.RAJESH
Currently Banned

New User


Joined: 20 Mar 2008
Posts: 54
Location: chennai

PostPosted: Tue Jul 15, 2008 9:31 am
Reply with quote

Hi Gerry,

Exactly that's what i am saying.....

To avoide restart problems of step if it is bounded under IF condition.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Jul 15, 2008 9:49 am
Reply with quote

Hi Rajesh,

well I'm afraid this is not a good option, what happens when STEP02 is restarted and fails, STEP03 flushes but STEP04 will now run.

Don't like this idea at all.

So back to my original question, can you override IF conditions in a PROC withou changing the PROC ?


Gerry
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jul 15, 2008 12:02 pm
Reply with quote

Looks like that old peach of an argument - do I use IF/THEN/ELSE or COND= for ease of functionality ..........
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Add condition to a FINDREP SORT card DFSORT/ICETOOL 4
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top