Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
using return codes in the next step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Fri Sep 08, 2006 12:59 am    Post subject: using return codes in the next step
Reply with quote

I want to write a program such that in the first step it will check whether the particular dsn is available or not. if it is not available the output RC value is 12. then i have to create a dsn. but when running, the job failed at step 1 itself due to the RC 12. i want to execute the step when the RC for the above step is 12. i have used cond parameter in the exec statement but it is not working. Can anyone provide a snippet for this.

Thanks,
Bala
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: Fri Sep 08, 2006 1:19 am    Post subject: Re: using return codes in the next step
Reply with quote

The first step could be done:
Code:

//STEP1    EXEC PGM=IDCAMS                       
//SYSPRINT DD   SYSOUT=*                         
//SYSIN    DD   *                                 
  LISTCAT ENT(MYHLQ.MY.DATASET)               
/*                                               
//*                                               


Personally, I detest using COND statements, and I would make the second step:
Code:

// IF (STEP1.RC = 4) THEN                                 
//STEP2    EXEC PGM=IEFBR14                               
//DD1      DD   DSN=MYHLQ.MY.DATASET,                   
//         DISP=(,CATLG,DELETE),UNIT=SYSDA,               
//         SPACE=(CYL,(1,1),RLSE),RECFM=FB,LRECL=80       
// ENDIF                                                   


Or, if desired:
Code:

//STEP2    EXEC PGM=IEFBR14,COND=(4,NE,STEP1)           
//DD1      DD   DSN=MYHLQ.MY.DATASET,                 
//         DISP=(,CATLG,DELETE),UNIT=SYSDA,             
//         SPACE=(CYL,(1,1),RLSE),RECFM=FB,LRECL=80     
//*                                                     
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Fri Sep 08, 2006 1:41 am    Post subject:
Reply with quote

hi superk,

it is not working, i have shown my sysprint message here.


********************************* TOP OF DATA *******************************
IDCAMS SYSTEM SERVICES TIME: 16:06

VERIFY DATASET(K4CCBK1.IIRS.VSAM.SORT )
IKJ56228I DATA SET K4CCBK1.IIRS.VSAM.SORT NOT IN CATALOG OR CATALOG CAN
IKJ56228I NOT BE ACCESSED
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12

IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 12
******************************** BOTTOM OF DATA *****************************
Back to top
View user's profile Send private message
krishna_sureka

New User


Joined: 05 Sep 2006
Posts: 7
Location: Pune

PostPosted: Fri Sep 08, 2006 2:10 am    Post subject: Re: using return codes in the next step
Reply with quote

Have you tried with COND=ONLY ?
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Fri Sep 08, 2006 2:13 am    Post subject: Re: using return codes in the next step
Reply with quote

krishna_sureka wrote:
Have you tried with COND=ONLY ?


can you give a snippet. i am not aware of what you are saying.

Thanks,
Bala
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Fri Sep 08, 2006 5:29 am    Post subject:
Reply with quote

hi,

can anyone suggest me to resolve this problem.

Thanks,
Bala
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: Fri Sep 08, 2006 5:41 pm    Post subject: Re: using return codes in the next step
Reply with quote

What exactly is the problem? Just stating that "it is not working" doesn't help much.

Why don't you post all of your JCL? (make sure you use the BBCode tags).
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Fri Sep 08, 2006 5:55 pm    Post subject: Re: using return codes in the next step
Reply with quote

superk wrote:
What exactly is the problem? Just stating that "it is not working" doesn't help much.

Why don't you post all of your JCL? (make sure you use the BBCode tags).


here is the code i am using:-
Code:

//STEP2   EXEC PGM=IDCAMS                                           
//SYSIN   DD *                                                       
  VERIFY DATASET(K4CCBK1.IIRS.VSAM.SORT )                             
/*                                                                   
//SYSPRINT DD SYSOUT=*                                               
//*******************************************************************
//STEP3   EXEC PGM=IDCAMS,COND=ONLY                                 
//SYSIN   DD *                                                       
  DEFINE CLUSTER                        -                             
  (NAME(K4CCBK1.IIRS.VSAM.SORT)       -                             
  TRACK(10,10) VOLUME(STRBB2)           -                             
  KEYS(6,0) RECORDSIZE(80,80)           -                             
  INDEXED)                              -                             
  DATA (NAME(K4CCBK1.IIRS.VSAM.SORT.DATA)) -                       
  INDEX (NAME(K4CCBK1.IIRS.VSAM.SORT.INDEX))                       
/*                                                                   
//SYSPRINT DD SYSOUT=*


i want the step3 to be executed only if the step2 fails i.e. only if the specified VSAM file is not available. i think this is the information you have asked.

Thanks,
Bala
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Fri Sep 08, 2006 5:58 pm    Post subject: Re: using return codes in the next step
Reply with quote

Hi,
use the cond parameter in step2 as COND=ANY
it will execute

Kiran G R
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: Fri Sep 08, 2006 6:41 pm    Post subject: Re: using return codes in the next step
Reply with quote

Well, it works for me just fine the way I originally described:
Code:

//STEP2   EXEC PGM=IDCAMS                                           
//SYSIN   DD *                                                       
  VERIFY DATASET(K4CCBK1.IIRS.VSAM.SORT)                             
/*                                                                   
//SYSPRINT DD SYSOUT=*                                               
//*******************************************************************
//STEP3   EXEC PGM=IDCAMS,COND=(12,NE,STEP2)                                 
//SYSIN   DD *                                                       
  DEFINE CLUSTER                        -                             
  (NAME(K4CCBK1.IIRS.VSAM.SORT)       -                             
  TRACK(10,10) VOLUME(STRBB2)           -                             
  KEYS(6,0) RECORDSIZE(80,80)           -                             
  INDEXED)                              -                             
  DATA (NAME(K4CCBK1.IIRS.VSAM.SORT.DATA)) -                       
  INDEX (NAME(K4CCBK1.IIRS.VSAM.SORT.INDEX))                       
/*                                                                   
//SYSPRINT DD SYSOUT=*


However, I'm curious as to why you want two job steps when one will suffice:
Code:

//STEP2   EXEC PGM=IDCAMS                                           
//SYSIN   DD *                                                       
  VERIFY DATASET(K4CCBK1.IIRS.VSAM.SORT)             
  IF LASTCC>0 THEN DO   
    DEFINE CLUSTER                        -                             
    (NAME(K4CCBK1.IIRS.VSAM.SORT)       -                             
    TRACK(10,10) VOLUME(STRBB2)           -                             
    KEYS(6,0) RECORDSIZE(80,80)           -                             
    INDEXED)                              -                             
    DATA (NAME(K4CCBK1.IIRS.VSAM.SORT.DATA)) -                       
    INDEX (NAME(K4CCBK1.IIRS.VSAM.SORT.INDEX))
    REPRO (should be one here somewhere)
    SET MAXCC=0
  END               
/*                                                                   
//SYSPRINT DD SYSOUT=*                                               
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Fri Sep 08, 2006 7:05 pm    Post subject:
Reply with quote

THANK YOU SUPERK

BALA
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts EXIT or RETURN cvnlynn CLIST & REXX 18 Wed Jul 19, 2017 2:50 am
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm

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