Code Comments
Programming Forum and web based access to our favorite programming groups.Does anyone know how to allocate DD statements or DSN=? within a COBOL program without using JCL. Thanks...
Post Follow-up to this messageGiulio 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.
Post Follow-up to this messageAssuming you are using a currently supported COBOL compiler, then you can u se (set and use) an "environment variable" to dynamically allocate files in COB OL. (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 pro gram > without using JCL. > > Thanks... > >
Post Follow-up to this messageBPXWDYN "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... > >
Post Follow-up to this messageGo 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... > >
Post Follow-up to this messageIn 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.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.