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

how to avoid a "data set not found"


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

New User


Joined: 02 Aug 2007
Posts: 64
Location: Bangalore

PostPosted: Mon Dec 21, 2009 1:11 pm
Reply with quote

Hi,

Some time back we have a similar situation where the Dataset may/maynot exist and program should read onlf if the dataset is present and process.
We used the following syntax
Code:

SELECT OPTIONAL IN-FILE 
    ASSIGN TO DT.           


This will ensure the job wont create any problem even if the file is not present.

Hope it helps.

Regards,
Surya
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Dec 21, 2009 1:42 pm
Reply with quote

Quote:
it works fine, but it's not an elegant solution. Also, it makes possible for a lot of "experts" to say that we’re lousy workers with lousy solutions.
horse manure

if Yo do not like it, just stop the payments!

You have a lousy/faulty design, You are deep in Mississippi mud(1) , we(2) spend time provide You a solution
and You complain that the solution is not elegant by your taste...

it has already beed ascertained that...
the current design is ... lousy
the current solution is ... lousy
because it has been designed/implemented by lousy workers
so what in Gehenna do You want from the people on the forum ??

(1) aka known as that ain't chocolate puddin'!
(2) not me personally but other people have
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Dec 21, 2009 7:55 pm
Reply with quote

expat wrote:
I suppose that you could always have an IEFBR14 as the first step of the job with a DD statement for every file that needs to exist, and if it does it ignores it and if it doesn't it creates it.
We've been doing this but if the dasd is sms-managed there will be a valid eof. If the dasd is not sms-managed, the results are unpredictable - someimes a dcb mis-match abend occurs, sometimes incorrect data is read depending on what was on the dasd prior to the new file being allocated, sometmes an eof is processed - and we ended up using an in-house utility.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Dec 21, 2009 7:57 pm
Reply with quote

Quote:
We've been doing this but if the dasd is sms-managed there will be a valid eof

Hi,

why not use IDCAMS LISTCAT to test the existence. I guess it wont fail.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Dec 21, 2009 8:13 pm
Reply with quote

Well, I just don't know what their process is doing - so won't be able to predict much and actually, would like to "quote" what Enrico has said.

in your (Vasanth) assumption you've assumed, entire process ends the moment program-in-question(P1) is executed or not. What if there are some "dowstream-programs" waiting for the output from P1...add one more IDCAMS step? and then one more...and few more...?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Dec 21, 2009 8:16 pm
Reply with quote

Quote:
"dowstream-programs" waiting for the output from P1...add one more IDCAMS step? and then one more...and few more...?


I agree, Definitely a valid point. The initial request was sounding like the user wanted to forge one program so I suggested a TEMP solution.
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Tue Dec 22, 2009 5:04 am
Reply with quote

enrico-sorichetti wrote:
Quote:
it works fine, but it's not an elegant solution. Also, it makes possible for a lot of "experts" to say that we’re lousy workers with lousy solutions.
horse manure

if Yo do not like it, just stop the payments!

You have a lousy/faulty design, You are deep in Mississippi mud(1) , we(2) spend time provide You a solution
and You complain that the solution is not elegant by your taste...

it has already beed ascertained that...
the current design is ... lousy
the current solution is ... lousy
because it has been designed/implemented by lousy workers
so what in Gehenna do You want from the people on the forum ??

(1) aka known as that ain't chocolate puddin'!
(2) not me personally but other people have


Firstly I'd like to say you are very inpolite, sir.
I don't know who you are and I don't want to know.
I don't care who you are.
I hope a moderator will see your reply and ban you from the forum.
To the people who politely tried to help me: I appreciate every reply and every suggestion posted here. When I mentioned "experts" I was referring to the people at the company I work for. And yes, it's a very good solution to my "taste".
JC
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Tue Dec 22, 2009 5:05 am
Reply with quote

karisurya wrote:
Hi,

Some time back we have a similar situation where the Dataset may/maynot exist and program should read onlf if the dataset is present and process.
We used the following syntax
Code:

SELECT OPTIONAL IN-FILE 
    ASSIGN TO DT.           


This will ensure the job wont create any problem even if the file is not present.

Hope it helps.

Regards,
Surya


Thanks a lot.
Good tip.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Dec 22, 2009 5:30 am
Reply with quote

Quote:
I hope a moderator will see your reply...

Note the title beneath enrico's user name. icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Dec 22, 2009 6:35 am
Reply with quote

Terry,

you are assuming that he reads anything at all.
he only wants a solution; he does not want hear ideas about how to make things better.

he is a typical whinner, who thinks he is a winner.

besides, if he had so many experts at his site,
why is he broadcasting his lack of expertise on the internet.
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: Tue Dec 22, 2009 8:54 am
Reply with quote

Hello,

JC, if the experts in your company and some experts here all say the design is deficient, maybe it is worth considering a different approach. . .

Suggest you focus on the problems with the process rather than being upset with the wording of some of the responses. Taking exception to the "reply style" allows you to avoid dealing with the actual problem.

The situation you are dealing with has been dealt with many times before (i've been part of several) and it is really quite do-able. So far, none of the systems i've supported needed to go to dynamic allocation or "optional" input (actually i do not believe this is a good case for an optional file).

As i mentioned earlier, i see no reason this does not run completely/correctly every time. If it does not, this is a problem and needs to be corrected - not worked around.
Back to top
View user's profile Send private message
CHANDAN KAPOOR

New User


Joined: 12 Apr 2008
Posts: 36
Location: NOIDA

PostPosted: Tue Dec 22, 2009 10:05 am
Reply with quote

Hi ,

you can add a step which will use ICETOOL utility to check the existence of dataset and set the return code of this step depending upon the existence of dataset.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Dec 22, 2009 10:15 am
Reply with quote

Hi,


Quote:
you can add a step which will use ICETOOL utility to check the existence of dataset and set the return code of this step depending upon the existence of dataset.


Can you please show how ICETOOL checks for the existence of a dataset.


Gerry
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Dec 22, 2009 2:49 pm
Reply with quote

Anuj Dhawan wrote:
We've been doing this but if the dasd is sms-managed there will be a valid eof. If the dasd is not sms-managed, the results are unpredictable - someimes a dcb mis-match abend occurs, sometimes incorrect data is read depending on what was on the dasd prior to the new file being allocated, sometmes an eof is processed - and we ended up using an in-house utility.

Anuj, IEBGENER would be just as effective, It doesn't destroy data if it exists and sets up a completely sweet dataset if it does not.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Dec 22, 2009 3:42 pm
Reply with quote

Yup expat. I'll take that as X'mas gift why only Robert gets them? icon_biggrin.gif
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Dec 22, 2009 3:45 pm
Reply with quote

Anuj Dhawan wrote:
Yup expat. I'll take that as X'mas gift why only Robert gets them? icon_biggrin.gif

WHAT !!! .............. You mean to tell me that you never received the JCL for IEBCOPY icon_eek.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Dec 22, 2009 4:10 pm
Reply with quote

I heard about a wire, but actual gift never reached to me icon_sad.gif
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top