Automic Workload Automation

  • 1.  CREATE_PROCESS returns $PROCESS02 instead of contents of data sequence

    Posted Jul 22, 2016 10:20 AM
    I am trying out the CREATE_PROCESS and PUT_PROCESS_LINE scripting statements for the first time, and have run into a roadblock. The data sequences do not return the correct results when accessed, but return some sort of process reference ID instead. Here is the script. It is in the post-process of an SQL job. It parses the results of the SQL query, and builds a new data sequence based on them.
    : SET &SQL_RC# = GET_UC_OBJECT_STATUS(, , "RETCODE")= 0
    :IF &SQL_RC# = 0
    :  P "Query RC: 0"
    :  SET &Counter# = 0
    :  SET &ProfileList# = PREP_PROCESS_REPORT(, , "REP", "*", "COL=DELIMITER", "DELIMITER=@;

    )
    :  PROCESS &ProfileList#
    :    SET &Counter# = &Counter# + 1
    :    SET &Profile# = GET_PROCESS_LINE(&ProfileList#,1)
    :    SET &Counter_Fmt# = FORMAT(&Counter#)
    :    IF &Profile# <>

    "
    :      PRINT "Profile #&Counter_Fmt#: &Profile#"
    :    ENDIF
    :    IF &Counter# = 1
    :      SET &ProfileListResults# = CREATE_PROCESS(NEW)
    !:      SET &ProfileListResults# = CREATE_PROCESS(DUPLICATE,&ProfileList#)
    :    ENDIF
    :    IF &Profile# <> ""
    :      SET &RC# = PUT_PROCESS_LINE(&ProfileListResults#,&Profile#,";")
    :    ENDIF
    :  ENDPROCESS
    :  CLOSE_PROCESS &ProfileList#
    :  ELSE
    :    P "Query RC: &SQL_RC#"
    :ENDIF
    :PUBLISH &ProfileListResults#

    When I access this data sequence in the calling object (an EXEC VARA), one result with two columns is returned. Each coliumn contains $PROCESS02.

    RESULT EXEC
    $PROCESS02
    $PROCESS02

    If I run the SQL job by itself, the post-process report shows that there were results.
    2016-07-22 16:02:15 - U00020408 Query RC: 0
    2016-07-22 16:02:15 - U00020408 Profile #1: DEV
    2016-07-22 16:02:15 - U00020408 Profile #2: EXP
    2016-07-22 16:02:15 - U00020408 Profile #3: ITE
    2016-07-22 16:02:15 - U00020408 Profile #4: PROD
    I also tried
    • runningCREATE_PROCESSinDUPLICATEmode, duplicating the original data sequence from the report.
    • runningCREATE_PROCESSoutside of any otherPROCESSloop, and passing an array toPUT_PROCESS_LINE.
    The first case had the same results. In the second case, the only difference was that the results contained $PROCESS01 instead of $PROCESS02.

    Has anyone seen this before? Am I overlooking something?

    FWIW, this is AE v11.2.2.


  • 2.  CREATE_PROCESS returns $PROCESS02 instead of contents of data sequence

    Posted Jul 25, 2016 12:32 AM
    Hi Michael,
    you need to use "SAVE_PROCESS", the returncode of SAVE_PROCESS is the reference to your saved PROCESS which can then also be used in a VARA.EXEC.

    Example Script:
    :SET &HND# = CREATE_PROCESS(NEW) :SET &LINE1# = "Header1,Header2,Header3" :SET &RET# = PUT_PROCESS_LINE(&HND#, &LINE1#, ",") :SET &LINE2# = "Val11,Val12,Val13" :SET &RET# = PUT_PROCESS_LINE(&HND#, &LINE2#, ",") :SET &LINE3# = "Val21,Val22,Val23" :SET &RET# = PUT_PROCESS_LINE(&HND#, &LINE3#, ",") :PSET &COMPLEXVALUE# = SAVE_PROCESS(&HND#) :PRINT &COMPLEXVALUE#

    hth, Philipp
    www.PhilippElmer.com


  • 3.  CREATE_PROCESS returns $PROCESS02 instead of contents of data sequence

    Posted Jul 25, 2016 05:55 AM
     
    you need to use "SAVE_PROCESS", the returncode of SAVE_PROCESS is the reference to your saved PROCESS which can then also be used in a VARA.EXEC.
    Thanks, that was what I was missing. I am now able to create a data sequence that can be used in an EXEC VARA, such that this VARA works as the data source for a prompt set combo box.

    The documentation really ought to include a practical example using all four commands:
    1. CREATE_PROCESS
    2. PUT_PROCESS_LINE
    3. SAVE_PROCESS
    4. CLOSE_PROCESS
    Now I’ve run into another hurdle: when I use an EXEC VARA as the data source of a prompt set combo box, the child SQL job of the EXEC VARA does not inherit variables from the prompt set. See this new discussion for details:

    Dynamic prompt sets