READ WORK in Linux BATCHMODE

Hi,

I’m trying to read a work file with Natural for Linux in Batch Mode with the following parameters:



natural BATCHMODE CMSYNIN=cmd.nat CMOBJIN=data CMPRINT=out.txt CMWRK01=data.in NATLOG=ALL

cat cmd.nat:
LOGON SYSEXBAT
EXECUTE RPTEST01
FIN


cat RPTEST01:
DEFINE DATA
LOCAL
1 #IN (A70)
END-DEFINE
DEFINE WORK FILE 1 'data.in' TYPE 'CSV'

INPUT (IP=OFF AD=M) #IN
DISPLAY #IN

READ WORK FILE 1 #IN
  DISPLAY #IN
END-WORK
END

cat data:
Test

cat data.in:
Ben Smith

And get the following unhelpful error message:

Natural Run-Time Error: 61

Execution or compilation error occured.

What am I doing wrong?

Regards,
Rok

Is the environment secured? Natural Security might be expecting the first input line to contain library,userid,password rather than “LOGON SYSEXBAT”. This might resolve the problem.

By the way, since you have specified the file name for CMWRK01 in your script, there is no need to duplicate it in the program.

DEFINE WORK FILE 1 TYPE 'CSV'

The environment is not yet secured, it is a simple “out-of-the-box” installation of Natural for Linux. Other sample programs from the SYSEXBAT Library work fine (also without providing Login Information).

Perhaps there is something missing in the NATPARM Batch Paramter Configuration…

That was my first assumption why it didn’t work - that perhaps I have to define the Work file explicitly in the Program…

Exit code 61 is a generic message simply indicating that something went wrong. There should be additional information in out.txt.

Try running it on-line. With the program in the editor, ensure that the DEFINE WORK contains the file name (that I previously suggested you remove), and RUN. If successful, you know the issue is in the script.

Also, try fully qualifying the file name. That goes for both script and on-line methods.

Hello Ralph,

thanks for your help.

That was it… The Workfile couldn’t be found until I specified the full path with CMWRK01…

Regards,
Rok