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
 
Using a dataset twice in a step

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

New User


Joined: 11 Sep 2006
Posts: 23

PostPosted: Fri Aug 03, 2007 9:25 pm    Post subject: Using a dataset twice in a step
Reply with quote

How come you can say

Code:
//DDN1      DD DISP=SHR,DSN=A.B.C
//DDN2      DD DISP=SHR,DSN=A.B.C


but you can't say

Code:
//DD1      DD DISP=(OLD,PASS,DELETE),DSN=&&ABC
//DD2      DD DISP=(OLD,PASS,DELETE),DSN=&&ABC


ie, you can reference the same dataset for two DD statements within a step if that dataset is cataloged, but not if it is a temporary dataset?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Aug 03, 2007 9:31 pm    Post subject:
Reply with quote

the disp parm OLD, requires exclusive control. You can't have 2 dd statements with exclusive control simultaneously.
Back to top
View user's profile Send private message
helga

New User


Joined: 11 Sep 2006
Posts: 23

PostPosted: Fri Aug 03, 2007 9:37 pm    Post subject: Re: Using a dataset twice in a step
Reply with quote

that makes sense I suppose ...and explains why MOD won't work either icon_lol.gif

seeing as I can't use SHR with passed datasets, I guess I'll just have to do this in two steps, or catalog the dataset icon_sad.gif


...unless there IS a way to use SHR with passed datasets and I just don't know it



thx
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 10:33 pm    Post subject:
Reply with quote

Hello,

What kind of code is running?

Do both DDs need to be opened at the same time?

If the data is processed serially, might one DD statement suffice?
Back to top
View user's profile Send private message
helga

New User


Joined: 11 Sep 2006
Posts: 23

PostPosted: Fri Aug 03, 2007 10:36 pm    Post subject: Re: Using a dataset twice in a step
Reply with quote

I was just doing a couple od SPLICEs using SORT

The reason the dataset was repeated was that I'm using Base + Overlay #1 then Base + Overlay #2

I was just saving a step, but I can get around it by using two steps instead.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 11:19 pm    Post subject:
Reply with quote

Hello,

I believe you could do that with only 1 dd for the base (unless i have misunderstood the process). In your control statements, just refer to the base DD multiple times. Each splice operation should be independent of the other(s). Might it be possible to splice base +Ov1, then base +Ov2. When the smoke clears will there be 1 or 2 output files? If 1, that should do it; if 2, one more splice would wrap it up.

If i've misunderstood, my bad. . .
Back to top
View user's profile Send private message
helga

New User


Joined: 11 Sep 2006
Posts: 23

PostPosted: Fri Aug 03, 2007 11:28 pm    Post subject: Re: Using a dataset twice in a step
Reply with quote

you mean instead of using

Code:
//IN1      DD <base>
//         DD <overlay #1>
//IN2      DD <base>
//         DD <overlay #2>
//TOOLIN   DD *
SPLICE FROM(IN1) TO(OUT1) ON ...
SPLICE FROM(IN2) TO(OUT2) ON ...


I could use

Code:
//IN1      DD <base>
//IN2      DD <overlay #1>
//IN3      DD <overlay #2>
//TOOLIN   DD *
COPY FROM(IN1) TO(TEMP1)
COPY FROM(IN2) TO(TEMP1)
SPLICE FROM(TEMP1) TO(OUT1) ON ...
COPY FROM(IN1) TO(TEMP2)
COPY FROM(IN3) TO(TEMP2)
SPLICE FROM(TEMP2) TO(OUT2) ON ...


?

It certainly looks like it would work. I'll give it a try.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 11:31 pm    Post subject:
Reply with quote

Drum roll. . . . . . .

And the verdict is. . . .
Back to top
View user's profile Send private message
helga

New User


Joined: 11 Sep 2006
Posts: 23

PostPosted: Sat Aug 04, 2007 12:20 am    Post subject: Re: Using a dataset twice in a step
Reply with quote

RC=0, but empty files.


gotta do some real work for a mo though icon_sad.gif



I'll be back icon_cool.gif
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Sat Aug 04, 2007 2:17 am    Post subject:
Reply with quote

It looks to me like files temp1 and temp2 would need to have disp mod.
You could also use "COPY FROM(IN1) TO(TEMP1,TEMP2)" to copy to both files at once.
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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 6 Fri Sep 22, 2017 7:08 am

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