Re: How to get the return code from a Unix command in Cobol



On Mon, 14 Jan 2008 19:49:54 -0800 (PST), Richard <riplin@xxxxxxxxxxxx> wrote:

On Jan 15, 2:26 pm, Robert <n...@xxxxxx> wrote:
On Mon, 14 Jan 2008 11:58:09 -0800 (PST), Richard <rip...@xxxxxxxxxxxx> wrote:

Several adequate mechanisms were provided at the time (plus your
unworkable one).

The only suggestion was ugly: overwriting a file.

Daniel (LX-I) wrote:
There was one process that we couldn't do from within
the program, so the program writes a sequence of commands
to a file, "add"s it to the run (which means it starts
executing when this program stops), and finishes.
The last statement in the file re-executes the checker to
check that final process.

Terminating is hardly a solution to 'call the compiler and get its return code.'

Simon Tobias wrote:
Cob -- which isn't COBOL, by the way -- will return a zero
return-code is the compilation is successful, so I would
*assume* that the return-code will trickle back down from
a CALL "SYSTEM" to the calling COBOL app.

That's precisely what did not work.

So that was three, which counts as 'several'.

The point about overwriting the file before the CALL "SYSTEM" is that
if the CALL fails, or the SYSTEM fails, or the command file fails,
then the program will not pick up the previous 'result file' which may
still contain 'success'.

These failure safeguards should be readily understood by someone who
is no longer a newbie.

I'd rather have 'looks ugly' than your 'does ugly' anyday.

My solution detects all those exceptions.

.



Relevant Pages

  • Re: How to get the return code from a Unix command in Cobol
    ... overwriting a file. ... so the program writes a sequence of commands ... if the CALL fails, or the SYSTEM fails, or the command file fails, ...
    (comp.lang.cobol)
  • Re: Writing extensions in C: questions:
    ... The correct way to set the interpreter ... >provide], which says it is invoked when the package is finally loaded, ... It seems to me this would result in additional commands being ... >created commands if anything subsequently fails during init? ...
    (comp.lang.tcl)
  • Re: scheduled task notifications
    ... It's very rare and only time it fails is from a ... or a sequence of commands that you put into a batch file. ... Task Scheduler cannot know if your commands worked or failed - this is up ... Instead of using blat.exe you could also use a VB Script to send you some ...
    (microsoft.public.windows.server.general)
  • Re: [9fans] devip connect error state
    ... and subsequent writes of 'connect' commands fail because Econinuse. ... fails we close the fd to the ctl file. ... using a slight different (more socket-ish) semantic. ... underlying fd goes into a peculiar state when the connect fails. ...
    (comp.os.plan9)
  • Re: Adding multiple entries for the same user with xcacls...
    ... You need to use the Edit option for xcacls.vbs to prevent the second operation from overwriting the DACL. ... So make the commands look like this: ... accomplish this, I am open to other possibilities. ...
    (microsoft.public.windows.server.scripting)