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 

fopen(): Does DDNAME not exists or file not exists

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vicente_garcia
Beginner


Joined: 16 Nov 2004
Posts: 4
Topics: 2

PostPosted: Wed Dec 01, 2004 11:05 am    Post subject: fopen(): Does DDNAME not exists or file not exists Reply with quote

Hello list.

In a JCL I want to use a DDNAME to read some information only if the DDNAME is present.

In a C program, how can I check if an erron in fopen() is because

- the DDNAME in not especifyed

or

- the DDNAME is especifyed but with a non existent file ?

Enumeration of funtions and variables involved will be fine. A small sample code will be perfect Smile

Thank you all

Vicente
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Dec 01, 2004 4:31 pm    Post subject: Reply with quote

vicente_garcia,

You can use LE run-time option CBLQDA to turn of the dynamic allocation of file names. CBLQDA(ON) is the setting that dynallocs a (NEW,DELETE) file when an output DD name is opened but missing from the TIOT.

you can print of all of the LE run-time options in effect using "PARM=/RPTOPTS(ON)"

ie.

Code:

STEP0100 EXEC PGM=MYPGM,PARM='/RPTOPTS(ON)'


If the file is not present then you will get a JCL error.

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
vicente_garcia
Beginner


Joined: 16 Nov 2004
Posts: 4
Topics: 2

PostPosted: Thu Dec 02, 2004 9:12 am    Post subject: Reply with quote

Hi Kolusu

Seems that JES checks for valid files in JCL prior it is run. So, fopen("DD:xxxxx") will return an error only if DDNAME xxxxx is not present in JCL.

Thankyou

Vicente
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 -> Application Programming 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