Antoine_Sauteron_1266

Send Mail - STR_CAT limited to 1023 characters

Discussion created by Antoine_Sauteron_1266 on Apr 6, 2017
Latest reply on Feb 21, 2018 by Antoine_Sauteron_1266
I want to send mail with text that contains more than 1023 characters. I have created this script:

!CHECK JOBS WITHOUT HOSTGROUP :DEFINE &MAIL_MESSAGE#, string, 5 :SET &NUMBER# = 0 :SET &NL# = UC_CRLF() :SET &OMU_RUNNR# = SYS_ACT_ME_NR() :SET &CLIENT# = SYS_ACT_CLIENT() :SET &CLIENT# = FORMAT (&CLIENT#) :PRINT "CURRENT CLIENT: &CLIENT#" :SET &OMU_JOBNAME# = SYS_ACT_ME_NAME() :SET &HOST_1# = "" :PRINT "JOB NAME IS &OMU_JOBNAME#" :PRINT "CHECK JOBS WITHOUT HOSTGROUP FOR CLIENT &CLIENT#" :PRINT "---------------------------------------------------"
:SET &HND# = PREP_PROCESS_VAR(VARA.SQLI.UC4_ADMIN_CHECK_JOBS_WITHOUT_HOSTGROUP)
:PROCESS &HND# :  SET &HOST_2# = GET_PROCESS_LINE(&HND#,2) :  SET &JOB_NAME# = GET_PROCESS_LINE(&HND#,6) :  SET &HOST_FOUND# = STR_MATCH(&HOST_1#, &HOST_2#) :    IF &HOST_FOUND# = "N" :      PRINT "NO HOSTGROUP FOR HOST &HOST_2#:" :      PRINT "  &JOB_NAME#" :    ELSE :      PRINT "  &JOB_NAME#" :    ENDIF :  SET &HOST_1# = &HOST_2# :  SET &MESSAGE# = "&HOST_1#-&JOB_NAME#" :  SET &LENGTH# = STR_LENGTH ( &MAIL_MESSAGE#[&NUMBER#]) :  IF &LENGTH# > 900 :    SET &NUMBER# = &NUMBER# + 1 :  ENDIF :  SET &MAIL_MESSAGE#[&NUMBER#] = STR_CAT (&MAIL_MESSAGE#[&NUMBER#],  &MESSAGE#)   :ENDPROCESS
!:SET &OUT# = SEND_MAIL("mailme@mydomain.com",, "UC4_ADMIN_CHECK_JOBS_WITHOUT_HOSTGROUP","&MAIL_MESSAGE[]")

but i receive this error: Array index out of bounce.

So i want to create an array to avoid the error message "STR_CAT Limited to 1023 characters".
But with the array , i receive another message.

1 - The error "STR_CAT Limited to 1023 characters" is caused by the limitation of JCL lines to 1024 characters in versions prior to v11.1. The only way to avoid getting it is to upgrade to version 11.1 or later.

2 -SEND_MAILdoes not accept a script array as a parameter for text. It has to be eitherscript literalorscript variable.

The character limit cannot be overcome unless you upgrade your Automation Engine.
You may use a solution that relies on a notification object instead.

Best regards,
Antoine

Outcomes