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

Using a dataset twice in a step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Fri Aug 03, 2007 9:31 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Aug 03, 2007 10:33 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Aug 03, 2007 11:19 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Aug 03, 2007 11:31 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top