View previous topic :: View next topic
|
Author |
Message |
viresh johri
New User
Joined: 19 Apr 2007 Posts: 3 Location: india
|
|
|
|
Hi , If in the prior step, if the dataset is not existing(Goes down with Jcl error),I want to send email notification about the failure of the job in the next step, My query is how to check the dataset availability?I want to do it for catalog procedure.
Thanks |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Viresh,
Code: |
//CHKDS EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
LISTDS 'ISTEST.MURALI#'
/* |
The above step throws maxcc 8, if the dataset is a non existent one. |
|
Back to top |
|
|
cvadlamudi
New User
Joined: 19 Apr 2007 Posts: 68 Location: India
|
|
|
|
Hi,
u can also use IDCAMS utility with LISTCAT if there is no file then the RC will be 8. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Keep in mind that you can do nothing after the jcl error occurs - the job is already terminated. One of the above suggestions could be placed in the step immediately before the problem step and the job could proceed accordingly.
Please clarify this
Quote: |
I want to do it for catalog procedure.
|
as i am unclear on what it means. . .
I'd suggest resolving the issue with the "missing" dataset. Why is it missing? |
|
Back to top |
|
|
viresh johri
New User
Joined: 19 Apr 2007 Posts: 3 Location: india
|
|
|
|
Its for Catalog procedure,As symbolica paramerters cant be use in catalog procedure.As my Dtaset name will change according to the TDate varibale(Daily).
The options are working for instream procedure , but not catalog procedure.
Is there any way to check in catalog procedures.?
Thanks |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
hey,
Quote: |
u can also use IDCAMS utility with LISTCAT if there is no file then the RC will be 8. |
Shouldn't it be an RC of 4 for non-existing files and ) for existing ones ?..
[/quote] |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Symbolic parameters can be used in cataloged procedures. Who said that they cannot?
By "instream", do you mean proc&pend?
This
Quote: |
The options are working for instream procedure , but not catalog procedure.
Is there any way to check in catalog procedures.?
|
is inconsistent. If it really is an instream proc, it will work like a cataloged proc.
Please post "both" sets of jcl and any error messages you received. |
|
Back to top |
|
|
viresh johri
New User
Joined: 19 Apr 2007 Posts: 3 Location: india
|
|
|
|
I have one proc , that 3 steps are there.I want to check the dataset availability for the 1st step , and according to it, I want to send email notification.I can't use symbolic parameters in the Proc , say i have proc 'x' in that i need to check the dataset availability.I cant give
//SYSIN DD *
LISTCAT ENTRIES('dataset name')
IF MAXCC=8 THEN SET MAXCC=4
My Query, how to give in catalog procedure, as i f create another member and give the LISTCAT ENTRIES('dataset name')
IF MAXCC=8 THEN SET MAXCC=4
, I t will trow error as my dataset name is everyday changing accordign to the date. |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
Hi Dick,
one doubt in what u said..
My JCL for dataset checking is this..
Code: |
//STEP1 EXEC PGM=IDCAMS
//SYSIN DD *
LISTCAT ENT(XXXXX.YYYYYY.ZZZZZZ.DDMM)
/*
//SYSOUT DD SYSOUT=*
//SYSMSG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//* |
So if i am getting this dataset
" XXXXX.YYYYYY.ZZZZZZ.DDMM " from the previous step and
in the previous step this DDMM is given as a symbolic parameter which changes everyday, then how do i code my IDCAMS step ?
Hope I am clear with my question... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Raak, a very good question.
If you can get the variable dataset name into a dataset with a couple of spaces and close bracket, then you can use this with IDCAMS.
The example below is creating the dataset in the same job, but will hopefully show the principle of the idea. Give it a try.
Code: |
//IEBGENER EXEC PGM=IEBGENER
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DSN=&&TEMP,DISP=(,PASS),
// SPACE=(TRK,(2,2),RLSE),
// RECFM=FB,LRECL=80
//SYSUT1 DD *
your dataset name )
/*
//*
//IDCAMS01 EXEC PGM=IDCAMS
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTC ENT( -
// DD DSN=&&TEMP,DISP=(OLD,DELETE)
)
/*
|
|
|
Back to top |
|
|
cvadlamudi
New User
Joined: 19 Apr 2007 Posts: 68 Location: India
|
|
|
|
We can send the Instream Data thru a Dataset rite...
i.e
Code: |
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=TESTHLQ.TESTLLQ.TLLQ1,DISP=SHR
//SYSOUT DD SYSOUT=*
|
File TESTHLQ.TESTLLQ.TLLQ1 will contain
Code: |
LISTCAT ENT(XXXXX.YYYYYY.ZZZZZZ.DDMM)
|
The file will get updated every time the job gets submitted and the parm file need to be updated with the sort utility or wat ever u like.. with the Dataset name created with DDMM...
If i am wrong correct me.... |
|
Back to top |
|
|
|