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

How to check the dataset availability?


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

New User


Joined: 19 Apr 2007
Posts: 3
Location: india

PostPosted: Mon Apr 23, 2007 11:27 am
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 23, 2007 11:49 am
Reply with quote

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
View user's profile Send private message
cvadlamudi

New User


Joined: 19 Apr 2007
Posts: 68
Location: India

PostPosted: Mon Apr 23, 2007 11:55 am
Reply with quote

Hi,

u can also use IDCAMS utility with LISTCAT if there is no file then the RC will be 8.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 23, 2007 12:41 pm
Reply with quote

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
View user's profile Send private message
viresh johri

New User


Joined: 19 Apr 2007
Posts: 3
Location: india

PostPosted: Mon Apr 23, 2007 1:08 pm
Reply with quote

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
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Mon Apr 23, 2007 1:08 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 23, 2007 1:38 pm
Reply with quote

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
View user's profile Send private message
viresh johri

New User


Joined: 19 Apr 2007
Posts: 3
Location: india

PostPosted: Mon Apr 23, 2007 2:32 pm
Reply with quote

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
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Mon Apr 23, 2007 2:34 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 23, 2007 2:46 pm
Reply with quote

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
View user's profile Send private message
cvadlamudi

New User


Joined: 19 Apr 2007
Posts: 68
Location: India

PostPosted: Mon Apr 23, 2007 3:32 pm
Reply with quote

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
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top