Automic Workload Automation

Expand all | Collapse all

Script Not Working in RAFTP Post Processing

Jump to Best Answer
  • 1.  Script Not Working in RAFTP Post Processing

    Posted 13 days ago
    Using v12.3, I need to find a file on a non agented server and then assign it to a variable.

    Using RAFTP free form command:

    Get these results in Report
    2019-10-31 14:41:34 Executing command: ls -lt | tail -1 on CONN.FTPAGENT.CDHS.DYS.EHR
    2019-10-31 14:41:34 CODYS_20190828124535.xml
    2019-10-31 14:41:34 CODYS_20190820090019.xml

    Oddly, ls -lt | tail -1 and ls -ltr | tail -1 return the same result. 2 files instead of a single newest/oldest file name.

    I copied some post processing code that works in my production environment and did an edit to substr the processing line to test I return the correct portion.#

    :SET &HND# = PREP_PROCESS_REPORT(,,,"CODYS*")
    :SET &CNT# = 0

    :PROCESS &HND#
    : SET &RET# = GET_PROCESS_LINE(&HND#,1)
    : PRINT &RET#
    : SET &FILE# = SUBSTR(&RET#,64,24)
    : PRINT &FILE#
    !: SET &ACTOBJ# = ACTIVATE_UC_OBJECT(JOBS.RAFTP.DPA.CORE.IDS_WARRANTS)
    !: PRINT &CNT#
    !: SET &CNT# = &CNT#+1
    !: PRINT &CNT#
    !: IF &CNT# > 0
    !: TERM_PROCESS
    !: ENDIF
    :ENDPROCESS

    I run the job and it completes normally.  However, there is no Post Processing report, only Report and Directory.

    So I did step by step

    :SET &HND# = PREP_PROCESS_REPORT(,,,"CODYS*")
    :SET &CNT# = 0
    :PRINT &HND#

    This returns $Process1 in the Post Processing report

    Then when I add the PROCESS lines back in and run, again only Report and Directory.

    I loaded the latest RAFTP jar 4.07 for another issue so I know I am current.

    Any ideas why it is giving me heartburn.

    Thanks







    ------------------------------
    Developer
    State of Colorado
    ------------------------------


  • 2.  RE: Script Not Working in RAFTP Post Processing
    Best Answer

    Posted 13 days ago
    Hi Tim

    PREP_PROCESS_REPORT will return a handle (like a pointer in C) to the report data. To access data:

    :SET &HND# = PREP_PROCESS_REPORT(,,,"CODYS*")
    :SET &CNT# = 0

    :PROCESS &HND#
    :SET &LINE# = GET_PROCESS_LINE(&HND#)
    :PRINT &LINE#
    :ENDPROCESS

    ------------------------------
    Swisscom Automation Engineer & PE Membership Creator

    Entfessle mehr Automic Wissen mehr Automic Tools
    https://membership.philippelmer.com/
    ------------------------------