Opening a workfile in APPEND mode in BATCH mode

Hi Everybody,

Is there a way to set the Workfile Attribute to APPEND and/or DELETE from a script on Unix? I combed through the documentation and tried a few things myself but I do not seem to be able to do it. I was expecting to be able to do one of the following:

  1. Pass a dynamic parameter WORKATTRnn=APPEND to override the default natparm.
  2. Adding something to the CMWRKnn definition: CMWRKmm=“$USERDIR/temp/WORKFILE.TXT;APPEND”
    or
  3. Passing another input in the batch script CMATTRnn=APPEND

None of these are working. It is not practical for us to set the defaults in the natparm module we use as we would like the developers and users to override it as needed, more or less like in JCL’s DISP= statement.

Thanks in advance for any hints/help.
Cicero

[url]http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat634unx/sm/definewo.htm[/url]

 DEFINE WORK FILE  n  [operand1] [TYPE  operand2] [ATTRIBUTES   {operand3}...]

ATTRIBUTES Clause:

operand3 specifies a work file attribute.

Several attributes separated by a comma or a blank can be specified, for example:

DEFINE WORK FILE ATTRIBUTES ‘APPEND,KEEP’


If you need to set this dynamically, pass a parameter to the program from your script and set the ATTRIBUTES operand accordingly.

This is a rather new feature of Natural, isn’t it? There’s no ATTRIBUTES option in my DEFINE WORK FILE documentation (Nat 6.1.1).

Thanks for the reply Wolfgang. We will just stick with the “workfile shuffle” in the script to append the two files after the job finished.

Cicero

It first appeared in Natural 6.2