View previous topic :: View next topic
|
Author |
Message |
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
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 |
|
|
krishna_sureka
New User
Joined: 05 Sep 2006 Posts: 7 Location: Pune
|
|
|
|
Have you tried with COND=ONLY ? |
|
Back to top |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
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 |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
hi,
can anyone suggest me to resolve this problem.
Thanks,
Bala |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
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 |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
Hi,
use the cond parameter in step2 as COND=ANY
it will execute
Kiran G R |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
THANK YOU SUPERK
BALA |
|
Back to top |
|
|
|