For Programmers: Free Programming Magazines  


Home > Archive > Cobol > September 2005 > Dynamic Allocation of files in an IBM Environment









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Dynamic Allocation of files in an IBM Environment
Giulio Belrango

2005-09-20, 9:55 pm


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

Thanks...



Colin Campbell

2005-09-20, 9:55 pm

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.
William M. Klein

2005-09-20, 9:55 pm

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-...gy3pg30/1.9.4.1

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

http://publibz.boulder.ibm.com/cgi-...gy3lr30/4.2.3.1

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

http://publibz.boulder.ibm.com/cgi-...gy3lr30/4.2.3.4
and
http://publibz.boulder.ibm.com/cgi-...gy3lr30/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@rogers.com> wrote in message
news:o-SdnZr3M9YyMq3eRVn-iw@rogers.com...
>
> Does anyone know how to allocate DD statements or DSN=? within a COBOL program
> without using JCL.
>
> Thanks...
>
>



news-server.tampabay.rr.com

2005-09-21, 3:55 am

BPXWDYN

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



charles hottel

2005-09-21, 6:55 pm

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@rogers.com> wrote in message
news:o-SdnZr3M9YyMq3eRVn-iw@rogers.com...
>
> Does anyone know how to allocate DD statements or DSN=? within a COBOL
> program without using JCL.
>
> Thanks...
>
>



Joe Zitzelberger

2005-09-23, 7:55 am

In article <o-SdnZr3M9YyMq3eRVn-iw@rogers.com>,
"Giulio Belrango" <giuliobelrango@rogers.com> wrote:

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


On current versions of the Cobol compiler, you can invoke TSO services
and pass a rexx/clist/tso style "allocate" command.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com