Automation Engine Script Guide > Ordered by Function > Handle Objects > :REGISTER_OUTPUTFILE

:REGISTER_OUTPUTFILE

Script statement: Registers a file as an external job output.

Syntax

:REGISTER_OUTPUTFILE File, User Login

Syntax

Description/Format

File

Fully qualified path and name of the file that should be registered as a job output.

Wildcard characters are not allowed. Always specify the absolute path.

Format: script literals

User Login

Use the user's login.

Allowed values: "Y" or "N"

Format: script literals

 

Automic strongly recommends you copy the Include objects REGISTER.OUTPUTFILE.WINDOWS and *.UNIX from the system client's REGISTER folder to that folder into any other client of the AE system, before you adapt them to your needs.
Explanation: After delivery of new initial data by Automic, these Include objects in the system client will be overwritten with the default data.

Comments 

You can use this script statement in the Process tab of UNIX and Windows jobs only.

External files can also be registered as job output using the Output tab. The difference lies in the registration time: The files of the Output tab are registered immediately when the job is executed, regardless of whether the job could create the file or not. If the script element is used, the specified file is only registered when it is called.

The specified file must be stored on the computer of the agent on which the job is executed or must be accessible from there. It makes sense to only specify files that are generated by the job.

After the job has been executed, the file is listed in the Directory tab and in the report dialog of the default job output. There, the file can be opened or stored directly via the UserInterface.

Example

The following sample script of a Windows job writes the file list of the directory C:\temp to the file C:\temp\test.txt. The system then verifies whether the command could successfully be executed. If so, this file is registered as job output. Otherwise, the job aborts.

dir C:\temp /S >> C:\temp\test.txt
@set retcode=%errorlevel% !
@if NOT %ERRORLEVEL% == 0 goto :retcode
:REGISTER_OUTPUTFILE "C:\temp\test.txt", "N"

In this example an external output file will be registered, when you use Perl in an external interpreter script in the Process tab of a Job object:

:  IF&$EXT_INTERPRETER# = 'PERL'or 'perl' or 'Perl'
system("&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=O ULOGIN=&uc_register_ulogin OUTFILE=\"&uc_register_ofile\"");
:  ELSE

 

See also: