Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Dynamic Allocation-Related Question
Hi,

To explain up front, I'm working from examples given to me a long time
ago. I have a subroutine program (written in Assembler) to invoke SVC
99 and dynamically allocate files. Even though it was written years
ago, it's still a pretty good little utility program to handle all
types of files on all types of devices.

I also have a copy of a COBOL program that calls the subroutine,
specifically showing me how to allocate output files. Here's the catch
-- it appears that the program only allocates empty output files which
in my example were populated later, in another program.

Does anyone have an example of how to write to a dynamically allocated
output file in the same program where it was allocated? Assuming I have
the DDNAME, DSN, and any other file-related info available to me
(obviously, not in the FILE SECTION), how would I set up the OPEN,
CLOSE and WRITE statements? Can this even be done?

Thanks,

John


Report this thread to moderator Post Follow-up to this message
Old Post
OppThumb
05-31-06 11:55 PM


Re: Dynamic Allocation-Related Question
"OppThumb" <calahanj@gmail.com> a écrit dans le message de news:
1149084163.762998.123860@i39g2000cwa.googlegroups.com...
> Hi,
>
> To explain up front, I'm working from examples given to me a long time
> ago. I have a subroutine program (written in Assembler) to invoke SVC
> 99 and dynamically allocate files. Even though it was written years
> ago, it's still a pretty good little utility program to handle all
> types of files on all types of devices.
>
> I also have a copy of a COBOL program that calls the subroutine,
> specifically showing me how to allocate output files. Here's the catch
> -- it appears that the program only allocates empty output files which
> in my example were populated later, in another program.
>
> Does anyone have an example of how to write to a dynamically allocated
> output file in the same program where it was allocated? Assuming I have
> the DDNAME, DSN, and any other file-related info available to me
> (obviously, not in the FILE SECTION), how would I set up the OPEN,
> CLOSE and WRITE statements? Can this even be done?

the only thing do Dynalloc ( SVC 99 ), is to allocate your file, so you
do not need a DD Statement in your JCL for this file.

To Open, Close and Write on this file you MUST have a
SELECT, FD , OPEN, WRITE and CLOSE in your COBOL program
just like any other files.
You must call Dynalloc before OPEN.

You may also call a sub-program to handle all this, if you don't want
it in the main program.


Report this thread to moderator Post Follow-up to this message
Old Post
Pépé le Pew
05-31-06 11:55 PM


Re: Dynamic Allocation-Related Question
First - for those who don't recognize the reference to SVC 99 - this is an I
BM
mainframe question (not specified by original poster).

If you have a currently supported version of COBOL, then I would *strongly*
recommend switching from an Assembler/SVC 99 approach to using the
COBOL-specific method with "environment variables".  See:

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

and

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

and

http://publibz.boulder.ibm.com/cgi-...gy3pg30/3.4.2.3

(and elsewhere)

--
Bill Klein
wmklein <at> ix.netcom.com
"OppThumb" <calahanj@gmail.com> wrote in message
news:1149084163.762998.123860@i39g2000cwa.googlegroups.com...
> Hi,
>
> To explain up front, I'm working from examples given to me a long time
> ago. I have a subroutine program (written in Assembler) to invoke SVC
> 99 and dynamically allocate files. Even though it was written years
> ago, it's still a pretty good little utility program to handle all
> types of files on all types of devices.
>
> I also have a copy of a COBOL program that calls the subroutine,
> specifically showing me how to allocate output files. Here's the catch
> -- it appears that the program only allocates empty output files which
> in my example were populated later, in another program.
>
> Does anyone have an example of how to write to a dynamically allocated
> output file in the same program where it was allocated? Assuming I have
> the DDNAME, DSN, and any other file-related info available to me
> (obviously, not in the FILE SECTION), how would I set up the OPEN,
> CLOSE and WRITE statements? Can this even be done?
>
> Thanks,
>
> John
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
05-31-06 11:55 PM


Re: Dynamic Allocation-Related Question
In article <1149084163.762998.123860@i39g2000cwa.googlegroups.com>,
"OppThumb" <calahanj@gmail.com> wrote:

> Hi,
>
> To explain up front, I'm working from examples given to me a long time
> ago. I have a subroutine program (written in Assembler) to invoke SVC
> 99 and dynamically allocate files. Even though it was written years
> ago, it's still a pretty good little utility program to handle all
> types of files on all types of devices.
>
> I also have a copy of a COBOL program that calls the subroutine,
> specifically showing me how to allocate output files. Here's the catch
> -- it appears that the program only allocates empty output files which
> in my example were populated later, in another program.
>
> Does anyone have an example of how to write to a dynamically allocated
> output file in the same program where it was allocated? Assuming I have
> the DDNAME, DSN, and any other file-related info available to me
> (obviously, not in the FILE SECTION), how would I set up the OPEN,
> CLOSE and WRITE statements? Can this even be done?
>
> Thanks,
>
> John

If you look at your assembler routine, you will see a list of text
units.  They are length prefixed strings that are equal to the related
JCL commands.

Find the one that does NEW & CATALOG and change it to SHR.

Report this thread to moderator Post Follow-up to this message
Old Post
Joe Zitzelberger
06-17-06 11:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:16 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.