Re: COBOL for utility program under Linux.
- From: "Michael Mattias" <mmattias@xxxxxxxxxxxxxx>
- Date: Wed, 27 Aug 2008 07:49:26 -0500
"Richard" <riplin@xxxxxxxxxxxx> wrote in message
news:7305512a-f9cc-48be-96a0-c82e9ab18f5e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
MCM wrote<> 'stdin' and 'stdout')
CGI really only needs ACCEPT and DISPLAY 'UPON COMMAND LINE'
CGI generally is reading from or writing to STDIN and STDOUT. (on unix,
'UPON COMMAND LINE' is not stdin and stdout, it is the stuff following
the program name as parameters to the command.
'UPON CONSOLE' probably is stdin and stdout (depending on
implementation).
Woo, the seven years since I last did anything in COBOL has apparently taken
its toll. (Or maybe it's the increased number of candles on the birthday
cake?)
When ACCEPTing from stdin (or CGI) it is usually necessary to use the
length of the text (which is supplier in an environment variable) as a
limit on the data as otherwise it will require a timeout or similar.
Surely there is another way to use standard handles with COBOL other than
DISPLAY/ACCEPT. (READ and WRITE come to mind) .
Why would you need 'another way' ?
Because as you point out, you may need the length to execute the ACCEPT,
which you don't have. Under Windows using my BASIC complier, you can detect
"end of file" on STDIN when reading the HTML submitted by the caller...
thereby giving you everything you need to process. Granted it's clunkier to
do that in COBOL, but it should be doable. Maybe you have to read it in a
byte at a time, but when EOF is detected, that's all there is, there ain't
no more.
But I guess..... you could ACCEPT a byte at a time until there ain't no
more? IOr maybe is there a facility with ACCEPT to detect "no data
availale?" Damn, I simply can't remember anymore. I suppose I could look it
up.....wow, I forgot about all the MF extensions to ACCEPT... both TIME-OUT
and ON EXCEPTION look like they will support handilng the
unknown-when-you-start-variable-lengthness of the input. So I guess you are
correct about ACCEPT being plenty, as long as the conpiler supports
something akin to the MF extensions.
I was just trying to help.
MCM
.
- Follow-Ups:
- Re: COBOL for utility program under Linux.
- From: Richard
- Re: COBOL for utility program under Linux.
- References:
- COBOL for utility program under Linux.
- From: PR
- Re: COBOL for utility program under Linux.
- From: Richard
- Re: COBOL for utility program under Linux.
- From: Michael Mattias
- COBOL for utility program under Linux.
- Prev by Date: Re: COBOL for utility program under Linux.
- Next by Date: Re: COBOL for utility program under Linux.
- Previous by thread: Re: COBOL for utility program under Linux.
- Next by thread: Re: COBOL for utility program under Linux.
- Index(es):
Relevant Pages
|