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

Difference bw DISP=(new,pass,delete) and DSN=&&temp


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

New User


Joined: 22 Jan 2008
Posts: 7
Location: India

PostPosted: Thu Jun 12, 2008 12:02 pm
Reply with quote

Hi,


what is the difference between Disp=(new,pass,delete)

and

DSN=&&temp?


Both are temporary files
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Jun 12, 2008 12:04 pm
Reply with quote

One is a disposition statement and the other is a dataset name statement.

Two different animals.
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: Thu Jun 12, 2008 1:17 pm
Reply with quote

Hello,

Quote:
Both are temporary files
Why would you think so?

There is nothing in disp=(new,pass,delete) that defines a temporary file.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Jun 12, 2008 1:38 pm
Reply with quote

Hi,

One of my PROC uses this:
Code:
//PGREPORT DD  DSN=&&TEMPFILE,               
//             UNIT=&SYSDA,AVGREC=M,         
//             DATACLAS=LARGE,               
//             DSORG=PS,RECFM=FBA,LRECL=143, 
//             BLKSIZE=0                     


Other PROC uses
Code:
//OTEMPFIL DD  DSN=&&TEMPFIL,               
//             DISP=(NEW,DELETE,DELETE),   
//             RECFM=FB,LRECL=160,BLKSIZE=0,
//             UNIT=&SYSDA,                 
//             DATACLAS=LARGE,             
//             MGMTCLAS=WORK               


What's Your opinion now.. icon_wink.gif ..?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jun 12, 2008 2:15 pm
Reply with quote

Hi Anuj,

I'm not sure, it's probably just me but I find some of your replies as very cryptic.


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

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Jun 12, 2008 5:51 pm
Reply with quote

You can use a regular dataset name with the DISP=(NEW,PASS,DELETE) option.

If a succeeding step fails, but before the dataset was deleted, then I think the dataset is still there, but since it is not catalogued, you need to find the VOL from the JESlog.

Is this correct?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Jun 12, 2008 6:14 pm
Reply with quote

gcicchet wrote:
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...
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: Thu Jun 12, 2008 6:29 pm
Reply with quote

Hi Anuj,

Quote:
What's Your opinion now..
I don't see how the examples you posted relate to how "new,pass,delete" signifies a temporary file. . .

The issue was the "pass" for a non && dataset and those examples show only && datasets.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Jun 12, 2008 7:08 pm
Reply with quote

Hi Anuj,

Your first code snippet shows no DISP= parameter, so the default DISP=(NEW,DELETE) applies.

Both snippets have DSN=&&TEMPFILE, so both are temp datasets.

Regards,
Garry
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Jun 12, 2008 11:22 pm
Reply with quote

The OP asked:
Quote:
what is the difference between Disp=(new,pass,delete)

and

DSN=&&temp?


One difference is that you can get a JCL err when attempting to allocate a permanent file that already exists, whereas, with && you won't. The sys uniquely names temp files.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Fri Jun 13, 2008 5:46 pm
Reply with quote

You'll get a JCL ERR with dupe &&temp in the same job.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jun 14, 2008 8:45 pm
Reply with quote

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.
Back to top
View user's profile Send private message
tangentray

New User


Joined: 30 Dec 2006
Posts: 20
Location: Kolkata, India

PostPosted: Mon Jun 16, 2008 5:06 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 16, 2008 5:11 pm
Reply with quote

A temporary dateset (&&somename) is unknown outside of the job defining it, but a permanent dataset with a disp of (nrew,pass,delete) could cause a conflict with another job running at the same time.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Jun 16, 2008 5:37 pm
Reply with quote

Code:
000001 //IBMUSERA JOB CLASS=A,NOTIFY=&SYSUID,
000002 // MSGCLASS=X
000003 //S1  EXEC PGM=IDCAMS
000004 //DS1     DD DISP=(NEW,PASS,DELETE),DSN=IBMUSER.DS1,
000005 // UNIT=SYSDA,SPACE=(CYL,(1,1)),DCB=(RECFM=FB,LRECL=80)
000006 //SYSPRINT DD SYSOUT=*
000007 //SYSIN DD *
000008   SET MAXCC = 0
000009 //S2  EXEC PGM=IDCAMS
000010 //DS2     DD DISP=(NEW,PASS,DELETE),DSN=IBMUSER.DS2,
000011 // UNIT=SYSDA,SPACE=(CYL,(1,1)),DCB=(RECFM=FB,LRECL=80)
000012 //SYSPRINT DD SYSOUT=*
000013 //SYSIN DD *
000014   SET MAXCC = 0


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

the jcl has been tested
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Mon Jun 16, 2008 6:11 pm
Reply with quote

I think Expat had given the only correct answer to that question of the TS.

All others deal with temp-datasets and how to fedine and handle them.
But the question was about the difference of two JCL-Statements. :-)

Regards, UmeySan
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 DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top