SYSOBJH error 42 running via ksh script in AIX 6.1

Hello everyone,

I cannot shake an rc=42 upon completion of the script running SYSOBJH.
I do get the correct output from it - work files 1, 3, and 4 get populated accordingly, but for some reason the script terminates with an rc=42.
Any idea of why this might be?

The command list that I populate into CMSYNIN for execution is as follows:

echo LOGON SYSOBJH > $CMSYNIN
echo SYSOBJH UNLOAD TRACS* LIB SYSTEM OBJTYPE N NATTYPE V WHERE TRANSFER >> $CMSYNIN
echo STOP >> $CMSYNIN

I’m looking to unload DDM-s prefixed with TRACS from library SYSTEM.

Any suggestions are greatly appreciated!
Thank you very much,
Lawrence

Hey, Lawrence. :slight_smile:

I don’t see this error under Windows 10 and Natural 9.1.

Does CMPRINT end with “NAT9995 Natural session terminated normally.”?

Any clues provided in the log (NATLOG=ALL)?

1 Like

Exit code 42 is a “batch mode driver error”, usually CMPRINT provides more information like pointing to a premature end of input etc, don’t you see any hint on CMPRINT ?

1 Like

Hi Ralph,

Long time no talk! :slight_smile:
CMPRINT contains:
NEXT LOGON SYSOBJH
Logon accepted to library SYSOBJH.
NEXT SYSOBJH UNLOAD TRACS* LIB SYSTEM OBJTYPE N NATTYPE V WHERE TRANSFER
Input Command Data or ‘.’ to exit …

DATA
NAT9987 Natural session terminated abnormally - RC=:1:.
NAT9987 Natural session terminated abnormally - RC=-1.

…so the immediate rc from Natural appears to be 1 - I guess 42 is what it translates into, by the time the shell script passes it back on Exit!?

CMPRT31 at our installation - North America, contains the following:

Page 1 06/18/19 12:06:13

SYSOBJH direct command processing:
Function completed successfully.
Page 2 06/18/19 12:06:13

12:06:13 *** SYSOBJH Error Report *** 06/18/2019

Error 6016 occurred in OBJHCMD in line 1108

Object Handler will be stopped.

I cannot see the code for OBJHCMD. Interestingly enough, I can execute OBJHCMD directly and get a return code of 0, BUT, on a couple of those runs I actually got data unloaded to files, while on some other runs, I got a 0 return code, got NO data, and when looking up CMPRT31 I’ve been told to executed SYSOBJH instead.
The execution of OBJHCMD is inconsistent from run to run. Thus, I quit trying that and went back to SYSOBJH, and I could NOT shake off the non-zero return code, though I’m actually unloading the data.

Thank you very much for your reply!
L

Thank you Mark,

As I replied to Ralph, CMPRINT contains:

CMPRINT contains:
NEXT LOGON SYSOBJH
Logon accepted to library SYSOBJH.
NEXT SYSOBJH UNLOAD TRACS* LIB SYSTEM OBJTYPE N NATTYPE V WHERE TRANSFER
Input Command Data or ‘.’ to exit …

DATA
NAT9987 Natural session terminated abnormally - RC=:1:.
NAT9987 Natural session terminated abnormally - RC=-1.

There are several more blank lines between the line starting with “Input command” and the line containing “DATA”.
Nothing else is displayed.

As in the reply to Ralph the CMPRT31 contains a reference to some error inside OBJHCMD, the code of which is NOT available to me for lookup.

Once I remembered one of the peculiarities of your organization’s scripts, I was able to duplicate your error.

The simplest fix is to change your Natural step to something like

natural.exe batchmode parm=xxx cmsynin="%mydir%\Zbrog.in" cmobjin="%mydir%\Zbrog.in" ...

That is, have both CMSYNIN and CMOBJIN pointing to the same input stream.

NB I don’t have a Linux shell handy, so you will have to adjust my Windows example.