Page 1 of 1 1
Topic Options
#182628 - 2007-11-14 04:08 PM exit codes with @error after shell command
GOGO Offline
Fresh Scripter

Registered: 2004-09-13
Posts: 16
Loc: Hannover, Germany
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

Top
#182633 - 2007-11-14 04:24 PM Re: exit codes with @error after shell command [Re: GOGO]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
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.

Top
#182634 - 2007-11-14 04:26 PM Re: exit codes with @error after shell command [Re: GOGO]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
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


Edited by Mart (2007-11-14 04:26 PM)
Edit Reason: typo
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#182636 - 2007-11-14 04:36 PM Re: exit codes with @error after shell command [Re: Mart]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
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?

Top
#182640 - 2007-11-14 04:51 PM Re: exit codes with @error after shell command [Re: Richard H.]
GOGO Offline
Fresh Scripter

Registered: 2004-09-13
Posts: 16
Loc: Hannover, Germany
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

Top
#182641 - 2007-11-14 05:00 PM Re: exit codes with @error after shell command [Re: GOGO]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
 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.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.029 seconds in which 0.011 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org