Interesting code. I don't know that I like using C functions to OPEN and
READ the file in COBOL. It seems to bypass some of the normal COBOL
functionality that COBOL programmers would want. I'd likely use "environment
variable" facility in the ASSIGN clause as documented:

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

You could prompt the programmer for the dataset/file name the same way. I
don't know if that is easier than just doing a CALL of BPX1RED. Use LE's
CEEENV routine to set the environment variable (which is equivalent to what
we think of as the DD name):

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA31B0/2.2.5.34

==

I don't know exactly what the OP wanted either. But the question did raise
one in my mind. Suppose that I have a batch program. In TSO, I can run the
program by doing some ALLOCATE commands to allocate my files and then invoke
my program using the CALL command. Without changing the program in any way
(do to dynamic allocation or anything else), how can I run this same program
from a UNIX shell prompt?

For a "pure" COBOL program, I think the above can be done by replacing the
ALLOCATE commands with export commands to define the environment variables
(DD names) with the proper dataset names. If you need something like SYSIN
or SYSPRINT to point to the UNIX shell input / output, I think you could do:

export SYSIN='/dev/fd/0'
export SYSPRINT='/dev/fd/1'

The do your method with the chmod 1755 to a filename in the current
directory which is the same as the program name in the PDS and export the
name of the PDS in STEPLIB.

But this wouldn't work in general, like for HLASM programs.

--
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to