GOGO
(Fresh Scripter)
2007-11-14 04:08 PM
exit codes with @error after shell command

Hi everyone,

i got a problem with exitcodes and none of my collegues is very helpfull because they just question my kixskript.
I've a client - HOST application, made with COBOL and a GUI made with ISA Dialog Manager. Client-HOST (BS2000) communication is done with siemens's UPIC client.
The client part is located on a fileserver, started with kix from the local machine.

 Quote:

SHELL $pathname + "\AKIT.exe"
IF @ERROR <> 0
$errormessage = "error! " + @ERROR
error($errormessage, $computername)
ENDIF


Sometimes the app crashes. The crash is not reproducable and user discribtions are more confusing than helpful.

These exitcodes are protocolled by the error-function:

1
3
32
44
1073807364
-1073740972
-1073741502
-1073741515
-1073741521
-1073741701
-1073741818
-1073741819
-2147483645

Both microfocus (COBOL-compiler) and ISA (GUI) said, these are no exit codes produced by their tools.
Couldn't find anything helpful with google or microsoft techsupport.

What are the meanings of these exit codes?
Does anyone has a hint for me?

Thanks
GOGO


Richard H.Administrator
(KiX Supporter)
2007-11-14 04:24 PM
Re: exit codes with @error after shell command

Display @SERROR as well as @ERROR.

@SERROR is the text version of the error message, and may sometimes help.

You can also display the text version of the non-negative numbers by using "NET HELPMSG"
 Quote:
H:\>net helpmsg 1

Incorrect function.


H:\>net helpmsg 13

The data is invalid.


H:\>net helpmsg 32

The process cannot access the file because it is being used by another process.


H:\>net helpmsg 44
44 is not a valid Windows network message number.

More help is available by typing NET HELPMSG 3871.


Mart
(KiX Supporter)
2007-11-14 04:26 PM
Re: exit codes with @error after shell command

The first few codes are system error codes. Have a looks at the link below to find out what each code means.

System error codes at MS website

The negative error codes are com errors I guess. There is a UDF to translate the com error to system error codes.
Once these error codes are translated they can be found in the system error codes list above.

UDF Library fnCOMErr() - Converts COM error codes into Win32 API error codes


Richard H.Administrator
(KiX Supporter)
2007-11-14 04:36 PM
Re: exit codes with @error after shell command

A quick script to convert:
 Code:
For Each $ERROR in Split("1 3 32 44 1073807364 -1073740972 -1073741502 -1073741515 -1073741521 -1073741701 -1073741818 -1073741819 -2147483645")
   $=fnComErr($ERROR)
   ""+$ERROR+" -> ["+@ERROR+"] "+@SERROR+@CRLF
Next

Function fnCOMErr($lErr)
    If $lErr<0 $lErr=VAL("&"+Right(DecToHex($lErr),4)) EndIf
    Exit $lErr
Endfunction


Results are:
 Quote:
1 -> [1] Incorrect function.
3 -> [3] The system cannot find the path specified.
32 -> [32] The process cannot access the file because it is being used by another process.
44 -> [44] Error (317 / 13D) while retrieving error information for 2C
1073807364 -> [1073807364] Error (317 / 13D) while retrieving error information for 40010004
-1073740972 -> [852] Error (317 / 13D) while retrieving error information for 354
-1073741502 -> [322] Error (317 / 13D) while retrieving error information for 142
-1073741515 -> [309] Error (317 / 13D) while retrieving error information for 135
-1073741521 -> [303] The file cannot be opened because it is in the process of being deleted.
-1073741701 -> [123] The filename, directory name, or volume label syntax is incorrect.
-1073741818 -> [6] The handle is invalid.
-1073741819 -> [5] Access is denied.
-2147483645 -> [3] The system cannot find the path specified.


Note, this only works properly for Windows / MS error codes. The COBOL application and runtime may issue their own bespoke codes which won't translate into any sensible message.

Have you checked the clients for error logs or entries in the application event log?


GOGO
(Fresh Scripter)
2007-11-14 04:51 PM
Re: exit codes with @error after shell command

fast and helpful as always, i love the forum!

i will change my script, but as i'm not allowed to change production the quick and dirty way, it will take me some time to get results.

What is the application event log? (Sorry for my bad english)Part of the event log? Hm, probably not :-(
I checked Dr. Watson, but that didn't helped much. Two different messages types, which not match the exit codes. Just can't find my printouts...

Let me have a look at my skript, i will be back soon.

Thanks GOGO


Mart
(KiX Supporter)
2007-11-14 05:00 PM
Re: exit codes with @error after shell command

 Originally Posted By: GOGO

....
What is the application event log? (Sorry for my bad english)Part of the event log? Hm, probably not :-(
....


Yes it is.