XML Export via AWI adds CR LF which leads to error via :IMPORT script
search cancel

XML Export via AWI adds CR LF which leads to error via :IMPORT script

book

Article ID: 205504

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

Export of an include object via AWI -> Transfer --> Export adds an extra CRLF between

<MSCRI>
<![CDATA[!set global variables based on contents of GLOBAL VARA object

If the object is imported via the AWI this does not have any impact.
If the object is imported via the script :IMPORT the CRLF remains and objects fail to run, i.e.

U00020325 Runtime error in include 'JOBI.32417915' (Object 'SCRI.32417915.INC'), line '00002'. A JCL line was found. This is only permitted in Jobs. Content: ' !set global variables based on contents of GLOBAL VARA object'

This does not occur if the script :EXPORT is used.

 

The following script of an include object is exported via AWI.

 

If this script is imported via script utilizing :IMPORT 

:SET &FILE#  = "C:\temp\export.xml"
:SET &FOLDER# = "\CASES\ALEXANDER\2020\12_DECEMBER\32417915"
:SET &RET#    = IMPORT(&FILE#,&FOLDER#,"1")

The include object looks like this:

            !set global variables based on contents of GLOBAL VARA object
:set &GVarsObj# = "P8LP.LPI.GLOBAL.SSIS_VARS"

:set &DTExecPath64# = get_var(&GVarsObj#,"PATH_DTEXEC_X64")
:set &DTExecPath32# = get_var(&GVarsObj#,"PATH_DTEXEC_X86")
:SET &POWER_SHELL# = GET_VAR(&GVarsObj#, "POWER_SHELL")

:SET &BASE_API_URL# = get_var(&GVarsObj#,"BASE_API_URL")
:SET &Config_API# = get_var(&GVarsObj#,"Config_API")
:SET &ENV# = get_var(&GVarsObj#,"ENV")
:SET &ID_Server# = get_var(&GVarsObj#,"ID_Server")
:SET &HOST# = get_var(&GVarsObj#,"HOST")
:SET &SQLSERVER# = GET_VAR(&GVarsObj#, "SQLSERVER")
:SET &SSIS_SQL_SERVER# = GET_VAR(&GVarsObj#, "SSIS_SQL_SERVER")
:SET &TKA_DB_LOCATION# = GET_VAR(&GVarsObj#, "TKA_DB_LOCATION")

:SET &ElasicSearch_Password# = GET_VAR(&GVarsObj#, "ElasicSearch_Password")
:SET &ElasicSearch_UserName# = GET_VAR(&GVarsObj#, "ElasicSearch_UserName")

!:SET &HND# = PREP_PROCESS_AGENTGROUP("P8LP.HOSTGROUP",,BY_RULE)
!:PROCESS &HND#
!: PSET &HOST# = GET_PROCESS_LINE(&HND#,1)
!:ENDPROCESS

Environment

Release : 12.3

Component : Application Interface (JavaAPI)

Cause

Defect.

Cause:

Exporting objects with a script and then importing them again using the script function IMPORT() while using AWI with Java version 9 or higher (lower than 14) caused additional line breaks and spaces to be inserted in the script of the imported object.

 

Resolution

Update to a fix version listed below or a newer version if available.

This bug is fixed in the following releases:

AE 21.0.1          :      released

AE 12.3.8       :      released

If you are using a JavaAPI to export/import the objects, make sure that the uc4.jar is on the fixed version (12.3.8+ or 21.0.1+).

Article title: How to register to Broadcom Software Product updates and Critical Alerts

https://knowledge.broadcom.com/external/article?articleId=133819

Additional Information

This problem has particularly heavy impact when a Z/OS (MVS) JOBs  that has a  maximum return codes specified at the step-level, the AE includes '-1' in the body of the MaxRetCode element, see example below. The resulting XML export will be corrupted and cannot be important without applying the manual workaround.

 

Workaround: Modify the export.xml and remove the CR LF before importing it with :IMPORT:

To:

Please note :

The bug that, during import of XML contained raised the following error messages :

"MaxRetCode : Function 'DS_XML_CHECK': Text 'MaxRetCode' is longer than '11'"

is also corrected in this fix version.