Prev: Management wars
Next: Tandem
From: Giulio Belrango on

Does anyone know how to allocate DD statements or DSN=? within a COBOL
program without using JCL.

Thanks...



From: Colin Campbell on
Giulio Belrango wrote:

>
>Does anyone know how to allocate DD statements or DSN=? within a COBOL
>program without using JCL.
>
>Thanks...
>
>
>
In my former shop, we used an Assembler Language subroutine to manage
dynamic allocation. The calling program would pass the information
(DDname and DSName), the subroutine would call the operating system's
dynamic allocation service (SVC 99), and the calling program could then
open, process, and close the file.

COBOL has an option, CBLQDA, which allows or prohibits dynamic
allocation depending on the setting of the option at run time. However,
it is extremely simple minded, and does not allow specifying a data set
name. It essentially allows creation of a temporary data set, which is
deleted at the end of the run unit.

The Assembler Language subroutine is not very difficult to code. I am
now retired, but I might have a copy of the code, since I was the author.
From: William M. Klein on
Assuming you are using a currently supported COBOL compiler, then you can use
(set and use) an "environment variable" to dynamically allocate files in COBOL.
(Unlike CBLQDA, this allows for creating NEW files that are catalogued *and*
accessing already catalogued files).

See among other references:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3pg30/1.9.4.1

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3pg30/1.8.3

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr30/4.2.3.1

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3pg30/3.4.2.3
shows how to set an environment variable, while

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr30/4.2.3.4
and
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr30/4.2.3.2
show what to put in the environment variables (for dynamic file allocations)

--
Bill Klein
wmklein <at> ix.netcom.com
"Giulio Belrango" <giuliobelrango(a)rogers.com> wrote in message
news:o-SdnZr3M9YyMq3eRVn-iw(a)rogers.com...
>
> Does anyone know how to allocate DD statements or DSN=? within a COBOL program
> without using JCL.
>
> Thanks...
>
>


From: news-server.tampabay.rr.com on
BPXWDYN

"Giulio Belrango" <giuliobelrango(a)rogers.com> wrote in message
news:o-SdnZr3M9YyMq3eRVn-iw(a)rogers.com...
>
> Does anyone know how to allocate DD statements or DSN=? within a COBOL
> program without using JCL.
>
> Thanks...
>
>


From: charles hottel on
Go to google groups and search comp.lang.cobol for "dynamic allocation".
Several different methods have been posted in the past.

<top post - no more follows>

"Giulio Belrango" <giuliobelrango(a)rogers.com> wrote in message
news:o-SdnZr3M9YyMq3eRVn-iw(a)rogers.com...
>
> Does anyone know how to allocate DD statements or DSN=? within a COBOL
> program without using JCL.
>
> Thanks...
>
>


 |  Next  |  Last
Pages: 1 2
Prev: Management wars
Next: Tandem