Joined: 22 Apr 2006 Posts: 6254 Location: Mumbai, India
I'm not sure, it's probably just me but I find some of your replies as very cryptic.
Not sure about others but perhaps this reply could be considered as "cryptic"..
In the original question TS (Thread Starter) has assumed (per me) that "Disp=(new,pass,delete)" can be used only for Temp files & Temp files can use only this DISP. I've given two other examples of using DISP with Temp files to make him think that the example in his post is not the only case with Temp files...
My point was that if, in a previous execution the file was left as is (on rare occasions the system fails, leaving files undeleted). Most shops have mopup routines that delete temp files after such an incident.
When I ran my test I didn't get a JCL err. I thought it might be because the sys uses systime as part of the temp DSN, and that made the DSNs unique. But strangely they both had the same DSN (including the time). I noticed that they were assigned to 2 different storage groups by SMS. Maybe that keeps them unique or they were assigned to different vols.
I didn't try writing to the files, but in any event that would cause an abend or a bad RC, not a JCL error.
Joined: 30 Dec 2006 Posts: 20 Location: Kolkata, India
I believe there is a confusion regarding the intent of the TS. My understanding of the question is a s follows: (TS please correct me if I am wrong)
Normally when we define a temporary dataset (&&filename) we specify a DISP=(NEW,PASS,DELETE), what happens if we define a permanent dataset using the same DISP, will it act similar to a temporary dataset? If no then in what way will it differ?
I do not have a complete answer to this, experts please comment. As far as I know from my limited exposure that a temporary dataset is one that will be deleted at the end of the job, is it actually deleted? I guess not, it is merely uncataloged and resides in a system managed volser. As long as the system does not require that space to be reallocated elsewhere, it will not be physically deleted. On the other hand if we define a permanent
dataset with the abovde disp, i think as far as the job is concerned it will behave just like a temporary dataset, but if it is not deleted explicitely then it will remain as uncataloged as long as it is not deleted externally. That is what i think, please post ur thoughts.
is a perfectly legal jcl
at job termination all the datasets allocate with PASS will be delete
if things have been setup properly, there will not be any name clashes
in order not to have any cleanup to do a jcl could be setup using
(NEW,PASS) for non temporary datasets
whit a last step with (OLD,CATLG),
in case of abnormal/condition_code_driven termination
the job could be rerun without any modifications
it would incur in jcl errors if rerun inappropriately