:REGISTER_OUTPUTFILE does not register file in pre process
search cancel

:REGISTER_OUTPUTFILE does not register file in pre process

book

Article ID: 258510

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

There's an oddity with :REGISTER_OUTPUTFILE where if you try to use it in the post process you get the following in messages:
U00020504 Runtime error in object 'REGISTER_OUTPUTFILE.UNIX' line '00005': JCL, statement or function is not allowed in POST PROCESS.

If you try to use it in the pre process of a UNIX job, nothing happens (but it also does nothing).  If you try to use it in the pre process of a Windows job, it throws an error

Docu is clear that it shouldn't work in either place, but the difference in behavior caused end users to think preprocess was fine because it didn't throw an error. 

Is this as designed?

Environment

Release : 21.0.4

Resolution

This behavior with REGISTER_OUTPUTFILE in the pre_process tab is currently considered as designed.  The REGISTER_OUTPUTFILE script function uses the REGISTER_OUTPUTFILE.* includes in client 0.  There's one for UNIX and and one for Windows.  The one for windows has this line in it which UNIX does not:

:     set &UC_PATH_JOBMD# = STR_SUB("&UC_JOBMD", "\", "\\")

and this is the reason that using REGISTER_OUTPUTFILE in the pre_process throws an error in windows.  

The line that throws an error in the Post Process tab is:

&UC_JOBMD MNR=&UC_MANDANT IPA=&UC_IP_ADDR JNR=&UC_REALNR PNR=&UC_IP_PORT TYP=O ULOGIN=&uc_register_ulogin OUTFILE="&uc_register_ofile" TRC=&UC_JOB_MD_TRC

which is JCL. The error that's thrown is:

U00020504 Runtime error in object 'REGISTER_OUTPUTFILE.UNIX' line '00005': JCL, statement or function is not allowed in POST PROCESS.

which is thrown because the line is OS JCL.  Pre Process tab allows the use of JCL, so it will throw an error.

There is no check in calling the messenger to see if it was successful or not, the pre process just checks to see that the messenger was run.

There is a workaround that could be done which is to copy the REGISTER_OUTPUTFILE.UNIX include to the working client, then add the following in before the &UC_JOBMD is done:

:set &uc_ip_addr = &uc_ip_addr
:if &uc_ip_addr = ''
:  stop no_msg
:endif

This will verify if the tab being used is the Pre Process tab (no uc_ip_addr has been created yet) and if so, it will stop processing and throw an error due to the stop no_msg.

To get this added into the product by default, an enhancement request is needed.