Automic Community

Expand all | Collapse all

Display long String to use as a variable

  • 1.  Display long String to use as a variable

    Posted 04-15-2019 03:53 AM

    Hi,

     

    I encounter the following problem;

     

    I need a Base64 string to use as attachement for an external ticket system.

    The string is larger than 8000 characters.
    But some how the string is truncated to 7999 characters (32bit?!)

    I made a small test to make this clear.

     

    In the following example

    • /tmp/load_1000_11.pja has more then 10000 characters
    • The report only shows the first 7999 characters.

     

    . ~/.bash_profile

    ls -alrt /tmp/load_1000_11.pja
    !cat /tmp/load_1000_11.pja

    !ATTACHMENT=`cat /tmp/load_1000_11.pja`
    !echo $ATTACHMENT

    echo ATTACHMENT:`cat /tmp/load_1000_11.pja`

     

    Running this JOBS generates the following report;
    ************************************************************************
    ** ucxjlx6m version 11.2.2+build.622 changelist 7627775 **
    ** JOB 01665920 (ProcID:0000017544) START AT 12.04.2019 / 11:37:09 **
    ** UTC TIME 12.04.2019 / 09:37:09 **
    ** TEXT=" Job started " **
    ************************************************************************
    -rw------- 1 automic automic 62038 Apr 9 12:23 /tmp/load_1000_11.pja

    ATTACHMENT:UGF0Y2hEYXRlO0FwcGxpY2F0aW9uO1NlcnZlcm5hbWU7QnJhbmQ7RW52aXJvbm1lbnQ7UGF0Y2hD eWNsZTtQYXRjaFdlZWs7UGF0Y2hEYXk7V2luZG93U3RhcnQ7V2luZG93RW5kCjA5LUFQUi0xOTtB UFBMSUNBVElPTlMgTUFOQUdFUjtzbG5jN3IxNDU3O0xpbnV4O1Byb2R1Y3Rpb247SGFsZiBZZWFy bHk7V0syO1R1ZXNkYXk7VHVlc2RheSwgMDktQXByaWwtMjAxOSBhdCAwMDowMDtUdWVzZGF5LCAw OS1BcHJpbC0yMDE5IGF0IDA2OjMwCjA5LUFQUi0xOTtDQjtzbGRjbHIwMDM3O0xpbnV4O1Byb2R1
    ...
    ZXNkYXksIDEwLUFwcmlsLTIwMTkgYXQgMDA6MDA7V2VkbmVzZGF5LCAxMC1BcHJpbC0yMDE5IGF0 IDA2OjMwCjEwLUFQUi0xOTtGTVMgSElHSFVTQUdFIEFORCBGUkFVREU7c2xuYzdyMTM1NjtMaW51 eDtQcm9kdWN0aW9uO0hhbGYgWWVhcmx5O1dLMjtXZWRuZXNkYXk7V2VkbmVzZGF5LCAxMC1BcHJp bC0yMDE5IGF0IDAwOjAwO1dlZG5lc2RheSwgMTAtQXByaWwtMjAxOSBhdCAwNjozMAoxMC1BUFIt MTk7Rk1TIE1PQklFTDtsODEwMTtMaW51eDtQcm9kdWN0aW9uO0hhbGYg

    ************************************************************************
    ** ucxjlx6m version 11.2.2+build.622 changelist 7627775 **
    ** JOB 01665920 (ProcID:0000017544) ENDED AT 12.04.2019 / 11:37:09 **
    ** UTC TIME 12.04.2019 / 09:37:09 **
    ** TEXT=" Job ended " RETCODE=00 **
    ************************************************************************

    In the post-processing I want to do somethin like;


    :SET &LINE# = PREP_PROCESS_REPORT(,,,"ATTACHMENT:*", "COL=DELIMITER", "DELIMITER=*:*")
    :PROCESS &LINE#
    : SET &LOCAL_CONTENT# = GET_PROCESS_LINE(&LINE#, 2)
    :ENDPROCESS
    :CLOSE_PROCESS &LINE#
    :PUBLISH &LOCAL_CONTENT#,, "TOP"

     

    My questing is ... how can I fill the variable (&LOCAL_CONTENT#) with the complete string and not only the first 7999

     

    Of course ... any other suggestion to achieve this is welcome.

     

    Thanks in advance.



  • 2.  Re: Display long String to use as a variable

    Posted 04-16-2019 10:55 PM

    Hi,

    I believe Linux has a command line arg limit.  You may be running in to that.  Check this link for more details.

     

    HTH,

    Nitin Pande

    Broadcom



  • 3.  Re: Display long String to use as a variable

    Posted 04-17-2019 03:01 AM

    Hi,

     

    Thanks for your respons

     

    I checked. 

     

    Executing the same command on the (used) Linux server. (echo ATTACHMENT:`cat /tmp/load_1000_11.pja`)

    displays the full output and NOT only the first 7999

     

    So I don't assume the arg limit is the issue 

     

    More/other suggestions are welcome

     

    Thanks in advance

     

     



  • 4.  Re: Display long String to use as a variable

    Posted 04-17-2019 09:54 AM

    So how and where exactly are you attaching this?

    Maybe you can put output in a file and attach that, rather than a variable.

     

    Nitin Pande

    Broadcom



  • 5.  Re: Display long String to use as a variable

    Posted 04-17-2019 10:21 AM

    I need this variable in a Webserver XML request.

    So unfortunately I can't use something else. 

     

    I don't think the length is a problem.

    If I 'build' the variabele .. such as ;

    :PSET &ATT# = "&ATT# <long string>"

    :PSET &ATT# = "&ATT# <long string>"

    :PSET &ATT# = "&ATT# <long string>"

    :PSET &ATT# = "&ATT# <long string>"

    . . .

    :PSET &ATT# = "&ATT# <long string>"

     

    I see the complete string (> 10000 characters) back in the Activation tab. 

     

    Still my conclusion is that there is some limit on the report display of a string 

    and the related question  . . . how can I bypass that (possible) limit ?!

     

    More/other suggestions are welcome

     



  • 6.  Re: Display long String to use as a variable

    Posted 04-17-2019 11:46 AM

    So what exactly are you using?  

    Which product is this related to?

     

    Nitin Pande

    Broadcom



  • 7.  Re: Display long String to use as a variable

    Posted 04-18-2019 03:37 AM

    Hi,

     

    Not sure what you exactly want to know...

    But maybe some ScreenPrints explains same ...

    Object

     

    ObjectCode

    In the XMLdefenition I need the variabele &LOCAL_CONTENT# 

     

    More/other suggestions are welcome



  • 8.  Re: Display long String to use as a variable

    Posted 04-18-2019 10:47 AM

    Are you using ESP or CA7?

    If yes, then in that case you will be using the CA WA Agent to run the WebService job.  Anyhow, I tested a simple script that produces 10000 characters.  The WA Agent was able to run it and show it in the spool.  So, I think this is limitation on your specific web services side.

     

    Nitin Pande

    Broadcom



  • 9.  Re: Display long String to use as a variable

    Posted 04-19-2019 04:11 AM

    Hi,

     

    I think this is going the wrong way. The issue is not in the Webservice. 

     

    I also created a simple Linux test-job (JOBS.LINUX.TEST_02) to explain which issue I'm facing. 

    Below is the code from the process -tab.  

    ! ## Start TEST

    . ~/.bash_profile

    :SET &ATT# = ""
    :SET &ATT# = "&ATT#1234567890123456789012345678901234567890123456789012345678901 "
    :SET &ATT# = "&ATT#2345678901234567890123456789012345678901234567890123456789012 "

    ... <a lot of the same to create a string > 10000 characters>

    :SET &ATT# = "&ATT#9012345678901234567890123456789012345678901234567890123456789 "
    :SET &ATT# = "&ATT#0123456789012345678901234567890123456789012345678901234567890 "


    :PRINT &ATT#

    echo ATTACHMENT:"&ATT#"

    ! ## End TEST


    Is there some possibility that I upload a export of JOBS.LINUX.TEST_02. Or can you create the same so you can execute/try it on your site. ?!

     

    Regards



  • 10.  Re: Display long String to use as a variable

    Posted 04-20-2019 12:14 AM

    Again, I'm not sure what CA product are you using here.  Please provide the CA Product name where you are running this Linux Job.

     

    Nitin Pande

    Broadcom



  • 11.  Re: Display long String to use as a variable

    Posted 04-23-2019 02:50 AM

    Sorry,

    I don't recognize the 2 product-names you mention. 

     

    We are using a Automic product ... 

    Help About entry

    I hope you reconize this as a product.

    Otherwise where can you tell me where I can find the productname you are looking for.

     

    Regards



  • 12.  Re: Display long String to use as a variable

    Posted 04-23-2019 10:50 AM

    Why don't you process the file in script directly with prep_process_file?

    I think you don't need the file output in the Job report.



  • 13.  Re: Display long String to use as a variable

    Posted 04-24-2019 02:45 AM

    Hi Nicole,

     

    Thanks for your suggestion.

     

    I did a quick, succesfull, test to see if it can work.

    :SET &HND#=PREP_PROCESS_FILE(&CURRENT_HOSTNAME#,"/tmp/load_1000_11.pja")
    :PROCESS &HND#
    : SET &LINE#=GET_PROCESS_LINE(&HND#)
    : SET &BIGLINE#="&BIGLINE#&LINE#"
    :ENDPROCESS

    :SET &LEN#=STR_LNG(&BIGLINE#)
    :PRINT "LENGTH BIGLINE : &LEN#"

    Looking at the Print output ;

    2019-04-24 08:25:04 - U00020408 LENGTH BIGLINE : 0000000000061232

    It seems the variable has the complete content of the file

    So it looks like this will work 

     

    I was too focused on the limitations of the output, that I not thought of other options 

     

     

    I will work this further out in the total picture I need this

     

    Regards