× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Actually, I was thinking more about this...   and you said the return
status is 7, didn't you?  With a number that low, (i.e. less than 0xFF)
the program is probably getting run, and actually returning a 7 to you.

Okay, that probably made perfect sense to me and other people with Unix
experience, but not to you, so let me elaborate :)

In Unix, and MS-DOS, and similar command line operating systems, the
programs that you run return a value.   For example, in C you'd code:

int main(void) {

 /* do something here */

return XXX;     <-whatever the value of XXX is would be the exit status.
}

Or, SOMEWHERE in the program, it calls exit().  Maybe something like:

    fd = open(somefile, O_RDONLY);
    if (fd == -1) {
         fprintf(stderr, "ack!\n");
         exit(7);     <--- in this example, 7 would be the exit status.
    }

Although a programmer can return any status that he likes, the "standard"
is to return 0 if your program was successful, or a positive integer if
your program was not.

In the normal OS/400 environment (i.e., non-QShell) if your program
failed, you would usually exit with an *ESCAPE message to indicate an
error.  That's kind of what returning a positive integer means in Unix.

(Frankly, the OS/400 way is a lot better, since people can't just ignore
the return values, but since you're running QShell, you have to live with
the Unix way)

ANYWAY...  the underlying problem is most likely that something is not
set up the way that the command you're running is expecting it to be.
Like, maybe it expects stdin, stdout and stderr to already be opened up
by the shell so it can write its output, etc.

Unfortunately, I don't know how you can tell the exact meaning of the
exit status in this case.   You might try reading about it in the manual,
most in the cases that I've looked at, the manual is rather vague.

For example, take the ls command.  Here's the info center page:
http://publib.boulder.ibm.com/pubs/html/as400/v4r5/ic2924/info/java/rzahz/ls.htm

Near the bottom, it says "Exit status:  0 on success, >0 if an error
occurs".   Not that helpful...

If you'd like an example of converting WIFxxxx procs to RPG, let me know.


On Fri, 5 Apr 2002, David Morris wrote:
>
> Scot,
>
> Thanks for the tips. Did I mention that I did
> think this would be simple -- and am now being
> schooled by an API that takes a single parm
> and is documented in less than two pages?
>
> David Morris
>



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.