Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

is it possible to allocate two dd to same temp file ?

60 views
Skip to first unread message

Weizman arbel

unread,
Sep 2, 2021, 2:00:22 AM9/2/21
to
i want to free one of them (sortout)
and browse the file from the second dd.
( At the moment i am alloc 2nd dd copy the first and free the first )
( I do not want a fixed file )


thanks
weizman

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@listserv.ua.edu with the message: INFO IBM-MAIN

Sri h Kolusu

unread,
Sep 2, 2021, 8:56:56 AM9/2/21
to
> i want to free one of them (sortout)
> and browse the file from the second dd.
> ( At the moment i am alloc 2nd dd copy the first and free the first )
> ( I do not want a fixed file )

Weizman arbel,

You can route the contents to an OUTFIL file and DFSORT will still write
out the contents to SORTOUT dd.

Here is an example.

//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//OUT01 DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT01
/*

Both SORTOUT and OUT01 will have ABC

Thanks,
Kolusu
DFSORT Development
IBM Corporation

Paul Gilmartin

unread,
Sep 2, 2021, 9:10:22 AM9/2/21
to
On Thu, 2 Sep 2021 01:00:11 -0500, Weizman arbel wrote:

>i want to free one of them (sortout)
>and browse the file from the second dd.
>( At the moment i am alloc 2nd dd copy the first and free the first )
>( I do not want a fixed file )
>
>
Perform the first allocation with:
CALL BPXWDYN 'ALLOC RTDSN(D) RTVOL(V) ...'

Reallocate with:
CALL BPXWDYN 'ALLOC DSN('D') VOL('V') ...'

What do you mean by 'fixed file'?

-- gil

Charles Mills

unread,
Sep 2, 2021, 10:12:30 AM9/2/21
to
I would guess that by "fixed file" the OP means "a hard-coded DSN as opposed to a system temp DSN."

Can one allocate two DD's to the same temp dataset? Would the following work? (Untested)

//DD1 DD DISP=NEW,DSN=&FOO
//DD2 DD DDNAME=DD1

I have never done that. I have only used DDNAME= in the situation where I wrote to that DD rather than the referred-to DD name.

Charles

Seymour J Metz

unread,
Sep 2, 2021, 10:42:51 AM9/2/21
to
No, DDNAME= won't do it. However, this should work:

//DD1 DD DSN=&&FOO,DISP=(,PASS)
//DD2 DD DSN=&&FOO, DISP=OLD


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [IBM-...@LISTSERV.UA.EDU] on behalf of Charles Mills [char...@MCN.ORG]
Sent: Thursday, September 2, 2021 10:12 AM

Weizman arbel

unread,
Sep 2, 2021, 11:04:24 AM9/2/21
to
i am want it from rexx foreground
"ALLOC F(SORTOUT) REUSE NEW RECFM(F B)",
" SPACE(2,2) CYL RELEASE DSO(PS) BLKSIZE(0)"

i am want to relese (free) sortout and
browse/use the temp file by 2nd dd

like
"ALLOC F(SORTOUT dd2nd) REUSE NEW RECFM(F B)",
...

"FREE F(SORTOUT)"

browse the file by dd2nd

In the situation now I'm copying the SORTOUT to dd2nd
And it takes time for big file

Sri h Kolusu

unread,
Sep 2, 2021, 11:16:47 AM9/2/21
to
> i am want it from rexx foreground

Weizman,

Can you briefly describe as to what you are trying to accomplish? This
question and other question about turning on HX in the exec. DFSORT has
functions that can covert a string into hex and then convert it back. So
may be if you explain what you are trying to accomplish, then we can
suggest alternatives.
As is REXX will be slow when compared to DFSORT I/O processing especially
when there are large files involved.

Thanks,
Kolusu
DFSORT Development
IBM Corporation


Seymour J Metz

unread,
Sep 2, 2021, 11:20:42 AM9/2/21
to
Don't free SORTOUT - that will delete the temporary dataset. Use bpxwdyn to redefine the ddname to what you need,


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [IBM-...@LISTSERV.UA.EDU] on behalf of Weizman arbel [wwa...@GMAIL.COM]
Sent: Thursday, September 2, 2021 11:04 AM
To: IBM-...@LISTSERV.UA.EDU
Subject: Re: is it possible to allocate two dd to same temp file ?

Weizman arbel

unread,
Sep 2, 2021, 11:29:40 AM9/2/21
to
about allocate two dd (sortout , DD2nd)
it is to save time/performens
I am currently copying sortout to DD2nd
free sortout and continu with DD2nd


about HX
I just wanted to implement the command from edit macro
I know how to do this in indirect ways by code

Weizman arbel

unread,
Sep 2, 2021, 11:47:48 AM9/2/21
to
Sort was just for example

I need many other cases to
Release specific DD
And continue with another

I am currently copying

The sort example helps me very much


thanks

Paul Gilmartin

unread,
Sep 2, 2021, 12:14:09 PM9/2/21
to
On Thu, 2 Sep 2021 10:04:14 -0500, Weizman arbel wrote:

>i am want it from rexx foreground
>"ALLOC F(SORTOUT) REUSE NEW RECFM(F B)",
>" SPACE(2,2) CYL RELEASE DSO(PS) BLKSIZE(0)"
>
Change that to:
call BPXWDYN "ALLOC" ,
"RTDSN(D) RTVOL(V)" , /* Add these options. */
F(SORTOUT) REUSE NEW RECFM(F,B)",
" SPACE(2,2) CYL RELEASE DSO(PS) BLKSIZE(0)"

(Do you need LRECL, also?)

>i am want to relese (free) sortout and
>browse/use the temp file by 2nd dd
>
>"ALLOC F(SORTOUT dd2nd) REUSE NEW RECFM(F B)",
>...

Becomes:
call BPXWDYN ""ALLOC F(Sdd2nd) DSN("D" VOL("V") REUSE OLD",
(RECFM should be unnecessarry.)

>"FREE F(SORTOUT)"
>
>browse the file by dd2nd

-- gil

Weizman arbel

unread,
Sep 2, 2021, 1:46:05 PM9/2/21
to
Fnames is very good solusion for sort
Because it is give me a flexible way to allocate
Diffferent dd from different screen at the same time.
( Rexx forground ).

Paul Gilmartin

unread,
Sep 2, 2021, 2:31:24 PM9/2/21
to
I notice that Arbel is responding to other plies in this thread but not
to mine. I wonder if my messages are going into Arbel's spam?
My postings appear on the UA.EDU website and are REPROed to me.

On Thu, 2 Sep 2021 15:20:30 +0000, Seymour J Metz wrote:

>Don't free SORTOUT - that will delete the temporary dataset. Use bpxwdyn to redefine the ddname to what you need,
>
It should be OK ro FREE SORTOUT after allocating the other DDNAME to the same data set.

>________________________________________
>From: Weizman arbel [wwa...@GMAIL.COM]
>Sent: Thursday, September 2, 2021 11:04 AM
>
>i am want it from rexx foreground
>"ALLOC F(SORTOUT) REUSE NEW RECFM(F B)",
>" SPACE(2,2) CYL RELEASE DSO(PS) BLKSIZE(0)"
>
>i am want to relese (free) sortout and
>browse/use the temp file by 2nd dd
>
>like
>"ALLOC F(SORTOUT dd2nd) REUSE NEW RECFM(F B)",
>...
>
>"FREE F(SORTOUT)"
>
>browse the file by dd2nd
>
>In the situation now I'm copying the SORTOUT to dd2nd
>And it takes time for big file

-- gil

Clark Morris

unread,
Sep 2, 2021, 8:59:05 PM9/2/21
to
[Default] On 2 Sep 2021 07:12:26 -0700, in bit.listserv.ibm-main
char...@MCN.ORG (Charles Mills) wrote:
I have used

//SORTIN DD DSN=&&X,DISP=(OLD,PASS)
//SORTOUT DD DSN=&&X<DISP=(OLD,PASS),VOL=REF=*.SORTIN

I'm not certain what would happen if there were 2 separate concurrent
OPEN OUTPUT statements to the same output file although I suppose if
DISP=(SHR,PASS) they would work.

Clark Morris

Sri h Kolusu

unread,
Sep 2, 2021, 9:38:03 PM9/2/21
to
> I have used
>
> //SORTIN DD DSN=&&X,DISP=(OLD,PASS)
> //SORTOUT DD DSN=&&X<DISP=(OLD,PASS),VOL=REF=*.SORTIN

Clark Morris,

Please don't ever do that with a COPY operation. For SORT operation you
would be OK to refer the same file but for a copy operation it is not
recommended as it can cause lost or incorrect data and we do document that
restriction.

For a copy application, the SORTIN data set should not be the same as the
SORTOUT data set or any OUTFIL data set because this can cause lost or
incorrect data or unpredictable results.

https://www.ibm.com/docs/en/zos/2.4.0?topic=statement-general-coding-notes


Thanks,
Kolusu
DFSORT Development
IBM Corporation



Gibney, Dave

unread,
Sep 2, 2021, 11:21:55 PM9/2/21
to
I don't know about now, and it was the other Sort product. My very first screw-up of production data was pointing SORTIN and SORTOUT at the same dataset, It was a SORT operation. In the early 80s. The step successfully read all the data, closed for input, opened for output and die for lack of region, I guess while allocating the output buffers.
Ands, at least in those days, this resulted in the tape being closed with an EOF mark right at the front.

> -----Original Message-----
> From: IBM Mainframe Discussion List <IBM-...@LISTSERV.UA.EDU> On
> Behalf Of Sri h Kolusu
> Sent: Thursday, September 02, 2021 6:37 PM
> To: IBM-...@LISTSERV.UA.EDU
> Subject: Re: is it possible to allocate two dd to same temp file ?
>
> > I have used
> >
> > //SORTIN DD DSN=&&X,DISP=(OLD,PASS)
> > //SORTOUT DD DSN=&&X<DISP=(OLD,PASS),VOL=REF=*.SORTIN
>
> Clark Morris,
>
> Please don't ever do that with a COPY operation. For SORT operation you
> would be OK to refer the same file but for a copy operation it is not
> recommended as it can cause lost or incorrect data and we do document that
> restriction.
>
> For a copy application, the SORTIN data set should not be the same as the
> SORTOUT data set or any OUTFIL data set because this can cause lost or
> incorrect data or unpredictable results.
>
> https://urldefense.com/v3/__https://www.ibm.com/docs/en/zos/2.4.0?top
> ic=statement-general-coding-
> notes__;!!JmPEgBY0HMszNaDT!67oSZvWWMHtXxvlzXF1hwDMePWkQJyuQr
> TSOUWDSwa5gKCnubhTR8ywfq8wMXQ$

Paul Gilmartin

unread,
Sep 3, 2021, 8:00:12 AM9/3/21
to
On Thu, 2 Sep 2021 18:37:28 -0700, Sri h Kolusu wrote:

>> I have used
>>
>> //SORTIN DD DSN=&&amp;X,DISP=(OLD,PASS)
>> //SORTOUT DD DSN=&&amp;X<DISP=(OLD,PASS),VOL=REF=*.SORTIN
>
>Clark Morris,
>
>Please don't ever do that with a COPY operation.
>
It might appear to work in a small test case where the data don't
exceed a single block then fail spectacularly in a larger production job.

At times when I want to overwrite SYSUT2 if the data set exists but
create it if it does not, I have used:

//HANDLE DD DISP=(MOD,CATLG),DSN=&SHSUID..Q2.Q3,
// UNIT=SYSALLDA,SPACE=...
//SYSUT2 DD DISP=SHR,DSN=*.HANDLE,VOL=REF=*.HANDLE

Alas, referbacks work only in batch JCL.

-- gil
0 new messages