Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Temp dataset unusual behavior

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sheersh

New User


Joined: 24 May 2008
Posts: 17
Location: Gurgaon

PostPosted: Tue May 08, 2018 9:52 pm    Post subject: Temp dataset unusual behavior
Reply with quote

Hi, We are having strange behavior of temp dataset. when temp dataset with same name is allocated more than once without deleting, system is not giving JCL error and later use of temp dataset is causing unpredictable reference to data. for ex.

JSTEP010.STEP010 create &&TEMP1 (DISP=NEW,PASS)

JSTEP010.STEP020 read &&TEMP1 with DISP=SHR (&&TEMP1 is not deleted)

JSTEP020.STEP010 create &&TEMP1 (DISP=NEW,PASS)

JSTEP020.STEP020 read &&TEMP1 - this may pick up the &&TEMP1 dataset created in JSTEP010.STEP010 which is not intended.

Can someone please explain this behavior?
Back to top
View user's profile Send private message

steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 672
Location: The Universe

PostPosted: Wed May 09, 2018 12:40 am    Post subject:
Reply with quote

I prepared and ran this job, which roughly duplicates the job described in the first post.
Code:
//PROC1   PROC
//STEP010 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT2   DD  DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1)),DSN=&&TEMP1
//STEP020 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DISP=SHR,DSN=&&TEMP1
//SYSUT2   DD  SYSOUT=*
//SYSIN    DD  DUMMY
//        PEND
//PROC2   PROC
//STEP010 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT2   DD  DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1)),DSN=&&TEMP1
//STEP020 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DISP=(OLD,DELETE),DSN=&&TEMP1
//SYSUT2   DD  SYSOUT=*
//SYSIN    DD  DUMMY
//        PEND
//JSTEP010 EXEC PROC1
//SYSUT1   DD  *
TEMP DATA SET CREATED IN JSTEP10
//JSTEP020 EXEC PROC2
//SYSUT1   DD  *
TEMP DATA SET CREATED IN JSTEP20
I got the same result - I think - described in the first post. In other words, the SYSUT2 data set in JSTEP020.STEP020 contains the text TEMP DATA SET CREATED IN JSTEP10.

Looking at the run output, notice this message -

STMT NO. MESSAGE
13 IEF648I INVALID DISP FIELD- PASS SUBSTITUTED

where stmt 13 is
13 ++SYSUT1 DD DISP=SHR,DSN=&&TEMP1

Now, when you get to JSTEP020/STEP020 there are two data sets in the passed data set queue: the &&TEMP1 from JSTEP010 and the &&TEMP1 from STEP010 in JSTEP020. It picked the first one. This is the behavior I would expect. Nothing strange about it.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8405
Location: Dubuque, Iowa, USA

PostPosted: Wed May 09, 2018 1:19 am    Post subject: Reply to: Temp dataset unusual behavior
Reply with quote

The MVS JCL Reference manual says:
Quote:
To ensure that a temporary data set name is unique, do not code a temporary data set name. Allow the system to assign one.
So the behavior you're seeing is expected and normal.

Furthermore, there is an option SYSTEM TEMPDSFORMAT(UNIQUE) in PARMLIB member ALLOCxx that enables allocation to use a more unique format for DSN=&&dsn names. You might want to talk to your site support group about that option.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 282
Location: Cincinnati OH USA

PostPosted: Wed May 09, 2018 2:40 am    Post subject:
Reply with quote

What system names were generated/referenced for the &&TEMP1 datasets at each step in the job?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 672
Location: The Universe

PostPosted: Wed May 09, 2018 5:48 am    Post subject:
Reply with quote

You can see the data set names in the SYSMSGS data set.

As Mr. Sample says, you can persuade the system to generate fully unique names, but then there is the problem of retrieving the names. In terms of the initial request, the JCL becomes
Code:
//PROC1   PROC
//STEP010 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT2   DD  DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1))
//STEP020 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DISP=SHR,DSN=*.STEP010.SYSUT2
//SYSUT2   DD  SYSOUT=*
//SYSIN    DD  DUMMY
//        PEND
//PROC2   PROC
//STEP010 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT2   DD  DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1))
//STEP020 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DISP=(OLD,DELETE),DSN=*.STEP010.SYSUT2
//SYSUT2   DD  SYSOUT=*
//SYSIN    DD  DUMMY
//        PEND
//JSTEP010 EXEC PROC1
//SYSUT1   DD  *
TEMP DATA SET CREATED IN JSTEP10
//JSTEP020 EXEC PROC2
//SYSUT1   DD  *
TEMP DATA SET CREATED IN JSTEP20
Often, though, you have to use names, as in the infamous &&GOSET(GO)). One of my mentors when I was starting out ran multiple step FORTGCLG jobs, and we had to remember to delete the @#%$ data set between the job steps.
Back to top
View user's profile Send private message
sheersh

New User


Joined: 24 May 2008
Posts: 17
Location: Gurgaon

PostPosted: Wed May 09, 2018 9:59 am    Post subject: Reply to: Temp dataset unusual behavior
Reply with quote

Thanks all for insight. It was really helpful.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Get line number where cursor is from ... satish.ms10 CLIST & REXX 3 Wed Oct 24, 2018 12:23 am
No new posts Zipping a mainframe dataset using OSH... raviyuvi All Other Mainframe Topics 12 Thu Sep 06, 2018 7:13 pm
No new posts What is the purpose of z/OS dataset e... vasanthz All Other Mainframe Topics 3 Fri Aug 31, 2018 12:56 am
No new posts FILE versus DATASET jerryte All Other Mainframe Topics 9 Fri Jun 29, 2018 10:47 pm
No new posts Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us