MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Catalog an empty dataset

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
anaik
Beginner


Joined: 31 Jan 2007
Posts: 20
Topics: 6

PostPosted: Thu Sep 20, 2007 10:34 am    Post subject: Catalog an empty dataset Reply with quote

I am having an input dataset called PRWTSSS.DNLD.INPSTM.DXYYDDD1. This is created by a different system. If the file is empty then predecessor job does not catalog the file. So our jobs fail. i tried the below step
Code:

//STEP0100 EXEC PGM=IEFBR14
//*
//FILE01 DD DSN=YOUR MISSING FILE,
// DISP=(MOD,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(LRECL=ZZZ,RECFM=FB,BLKSIZE=0)
//*


but it will create a dataset by the name PRWTSSS.DNLD.INPSTM.DXYYDDD1, if it does not exist. Our system does not have permissions to create a file with high level qualifier as PRWTSSS.

Can anybody help me resolving this issue
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Sep 20, 2007 10:42 am    Post subject: Reply with quote

anaik,

Run the following step and process/skip the other steps depending on the return code

Code:

//*************************************                 
//* RC=0  - DATASET HAS RECS          *                 
//* RC=4  - DATASET EMPTY             *                 
//* RC=12 - DATASET NOT FOUND         *                 
//*************************************                 
//STEP0100 EXEC PGM=IDCAMS                             
//SYSPRINT DD SYSOUT=*                                 
//SYSIN    DD *                                         
 PRINT IDS('PRWTSSS.DNLD.INPSTM.DXYYDDD1') CHARACTER COUNT(1)
/*                                     


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Sep 20, 2007 10:48 am    Post subject: Reply with quote

anaik,

I am not clear with your question.

What I understood is you want to create PRWTSSS.DNLD.INPSTM.DXYYDDD1 if this file is empty and you don't have authority to create this file.

You can print your file using a IDCAMS step and check for the return code and proceed if it is zero.
Back to top
View user's profile Send private message Send e-mail
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu Sep 20, 2007 10:56 am    Post subject: Reply with quote

So why does the other job not catalog the dataset if empty ?

That sounds a wierd setup to me. If the job is set up to create a dataset then create it it should, and then leave null / empty processing to the following job.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
anaik
Beginner


Joined: 31 Jan 2007
Posts: 20
Topics: 6

PostPosted: Thu Sep 20, 2007 11:01 am    Post subject: Reply with quote

Kolusu,

The last qualifier in file DXYYDD1 is populated run time. For 20th sept it will be DX072831 etc

vkphani,
the file is created by a different group. I am processign their file.

how do i handle the laSt qualifier
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu Sep 20, 2007 1:13 pm    Post subject: Reply with quote

Quote:
If the file is empty then predecessor job does not catalog the file. So our jobs fail.

Do you mean that the file IS created but not catalogued, or that the file is created and then deleted if empty, or that the file is created with a DISP of KEEP rather than CATLG.

Firstly, in an SMS environment the KEEP is usually dynamically altered to CATLG.

If this job is creating files that are not catalogued then you are asking for problems in the future when you DASD gets full up with uncatalogued files.

Is the file a tape file with a disp of (,CATLG, ... ) but not written to, so not opening the file and cataloging at close time ? Very common when ,,DEFER is coded in the unit parameter.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
anaik
Beginner


Joined: 31 Jan 2007
Posts: 20
Topics: 6

PostPosted: Thu Sep 20, 2007 1:30 pm    Post subject: Reply with quote

the empty file is not catalogued becuase the file storage is on TAPE and not on DISK..
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Sep 20, 2007 11:13 pm    Post subject: Reply with quote

anaik,

Make a change to your predecessor job to catalog the file eventhough it is empty if you don't have permissions to create a file with high level qualifier as PRWTSSS.
Back to top
View user's profile Send private message Send e-mail
dr_te_z
Beginner


Joined: 08 Feb 2007
Posts: 18
Topics: 3

PostPosted: Fri Sep 21, 2007 12:49 am    Post subject: Reply with quote

On the mainframe there are 2 flavors of an "empty" file.
- 1 Only a catalog entry. This file is never opened for output (typically IEFBR14)
- 2 A "real" empty file. This file is opened for output and closed again (typical IEBCOPY)

The following steps could be harmed by files of type-1. A cobol trying to open a type-1 file for input might abend. Building JCL you must always be aware of this.
Back to top
View user's profile Send private message
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Fri Sep 21, 2007 3:26 pm    Post subject: Reply with quote

If the upstream job can't be changed to catalog the empty data set, you can change your job:
add a step before, use listcat TSO command, and based on the RC determine the next step. e.g.
Code:

//STEP010  EXEC PGM=IKJEFT01                         
//SYSTSPRT DD  SYSOUT=*                               
//SYSPRINT DD  SYSOUT=*                               
//SYSUDUMP DD  SYSOUT=*                               
//SYSTSIN  DD  *                                     
 LISTC ENT("xxx') ALL
/*
//SYSIN    DD  DUMMY                                 
//*---------------------------------------------------
//    IF  (RC = 0) THEN                               
//....
//    ELSE
//....
//   END
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sun Sep 30, 2007 12:38 pm    Post subject: Reply with quote

If the file isn't cataloged, the sticking point is that you must get the vol ser. If not, you're SOL.
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group