Automic Workload Automation

  • 1.  Script issue upgrading from v10 to v12.1

    Posted May 02, 2018 12:28 PM

    We are in the testing phase of upgrading from version 10 to version 12.1.  We have a script that has worked in version 10 for years but doesn't want to seem to work in version 12.  I think there is either something that has slightly changed with a function or a spacing issue. Can anyone see a function in this script that may have changed in the version upgrade process?  There is a setup script previous to this one and I think it is working so I am just adding this script.  I didn't write this but I believe it is suppose to create a vara in the "No Folder" and then populating it with filenames.  The vara is being created but it is not being populate with file names.  I have read issues with PREP_PROCESS, but I believe they were supposed to be resolved in version 12.1.  Thanks

     

    This is in the Process tab.

    : READ &FILENAME# ,,

     

    This is in the Post Process tab.

    : SET &VARA_NAME# = "VARA.FILES.INF_IN"
    : SET &SIZE_VARA# = 0
    : SET &COUNTER# = 0

    ! Grab the highest line num in vara to determine the size of the vara
    : SET &HND_CHECKVARA# = PREP_PROCESS_VAR (&VARA_NAME#)
    : PROCESS &HND_CHECKVARA#
    : SET &SIZE_VARA# = ADD(&SIZE_VARA#, 1)
    : ENDPROCESS
    : CLOSE_PROCESS &HND_CHECKVARA#

    ! Initialize the counter, or increment if != 0
    ! : IF &SIZE_VARA# = 0
    : SET &COUNTER# = '0000000000000001'
    ! : ELSE
    ! : SET &COUNTER# = ADD(&SIZE_VARA#,1)
    ! : ENDIF

    : SET &CUR_DATE# = SYS_DATE_PHYSICAL ( 'YYYYMMDD')
    : SET &CUR_TIME# = SYS_TIME_PHYSICAL ( 'HHMMSS')

    : SET &SIZE_VARA# = FORMAT(&SIZE_VARA#)
    : PRINT "Number of lines in &VARA_NAME#: &SIZE_VARA#"

    ! Get filename from this report and put into VARA object for other uses
    : SET &REPORT_HANDLE# = PREP_PROCESS_REPORT("JOBF",,"REP","*U0011125*")
    : PROCESS &REPORT_HANDLE#
    : SET &LINE# = GET_PROCESS_LINE(&REPORT_HANDLE#)
    : SET &START# = STR_FIND(&LINE#,"'")
    : SET &START# = ADD(&START#,1)
    : SET &END# = STR_FIND(&LINE#,"'",&START#)
    : SET &LNG# = SUB(&END#,&START#)
    : SET &FILENAME# = STR_CUT(&LINE#,&START#,&LNG#)
    ! : PRINT "Index and filename added to VARA: &COUNTER# &FILENAME#"
    ! : PUT_VAR "&VARA_NAME#",&COUNTER#, &FILENAME#
    : PUT_VAR "&VARA_NAME#","D&CUR_DATE#_T&CUR_TIME#-&COUNTER#", "&FILENAME#"
    : PRINT "Index and filename added to VARA: D&CUR_DATE#_T&CUR_TIME#-&COUNTER# &FILENAME#"
    : SET &COUNTER# = ADD(&COUNTER#,1)
    : ENDPROCESS
    !: CLOSE_PROCESS &REPORT_HANDLE#



  • 2.  Re: Script issue upgrading from v10 to v12.1

    Posted May 02, 2018 12:42 PM

    Check the displayed number of the message in the report you use in the filter of the PREP_PROCESS_REPORT command. I remember seeing something about a change in the size of the numeric field, switching to a 10 digit message number in version 12.x



  • 3.  Re: Script issue upgrading from v10 to v12.1

    Posted May 02, 2018 12:42 PM

    I think I see something that caught us going from V9 to V11.  They changed how many leading zeros are applied to U numbers in all of the reports.  For instance U0011125 would now be U00011125. 

     

    Pete



  • 4.  Re: Script issue upgrading from v10 to v12.1
    Best Answer

    Posted May 02, 2018 04:34 PM

    Funny thing, I had a ticket open with UC4 on another issue and both of your replies came into play and that ticket and it resolved that issue, so thanks for that.  It came into play on other scripts I had so I will not be having issues with them.  And on this script it would have come into play also but I must have something else wrong as it still does not work.  It may be something in the setup script.  I will keep looking, thank you so much for your replies.



  • 5.  Re: Script issue upgrading from v10 to v12.1

    Posted May 02, 2018 04:38 PM

    And one other question about that U number, what is it doing?



  • 6.  Re: Script issue upgrading from v10 to v12.1

    Posted May 02, 2018 04:43 PM

    It is a positional parameter into the PREP_PROCESS_REPORT() function.  Its position tells me it is being used as a report scraping filter to return only those rows that start with U0001125*.  The PROCESS and END-PROCESS directives will loop through each row from the report that has a U00011125 literal on it.

     

    You might need to also add a leading wild card (*) to this filter string if it is returning zero rows and you see U0001125 messages on the report.