Output Registration

To register output, you run the FILESIZE function.

To register output in Applications Manager, you run FILESIZE as part of the program type script with the file name and exit error value as arguments.

The code is:

UNIX:

$AW_HOME/exec/FILESIZE $file $err

Windows:

%AW_HOME%\exec\FILESIZE %file% %err%

The FILESIZE script is located in the exec directory under AW_HOME.

FILESIZE Function

FILESIZE registers the program output file.

Either way, FILESIZE records the location of the program output file. FILESIZE does not register the standard out/log file. Instead, the standard out/log file is placed in the default output directory (out) by the BODY script.

When you view the output from a task in the Backlog or History, you see the locations of the output files in the Output Files tab. The image below shows an example of UNIX output files.

FILESIZE registers the locations of the 'b' files.

Registering Multiple Output Files

To avoid overwriting the same output file with multiple executions of the same program, use the Applications Manager environment variable file. By default, the value of file is b.$jobid (UNIX) or o%jobid%.lis (Windows). The default name for your files may be redefined by editing the awenv.ini file. For more information, see the Administration Guide.

jobid has only one value per execution of a task, so to register more than one output file, do not use the file variable. Instead, use jobid with an extension to make each file unique (example: $jobid.log1, $jobid.log2, etc.). The FILESIZE script should then be used on each of these individual files.

Changing the Output Directory

The Applications Manager environment variable OUTPUT holds the value $AW_HOME/out (UNIX) or %AW_HOME\out% (Windows) by default. This is set as part of the definition of the automation engine agent. If the OUTPUT variable is reset in the program type script (or from the User or Jobs windows) before FILESIZE is run, Applications Manager will move the output file to the specified location instead of the default location. This will work only if the variable file contains just the file name. If file contains a pathed file name, OUTPUT is ignored.

The sample script below shows the use of OUTPUT:

UNIX:

file=$seq_no.log

OUTPUT=/accounting/reports

$AW_HOME/exec/FILESIZE $file $err

Windows:

set OUTFILE=%file%

set INFILE=%par%

call %program%