PREP_PROCESS_REPORTLIST

Use the PREP_PROCESS_REPORTLIST script function to retrieve a list of the registered output files of a Job that has already run. The retrieved list includes the internal report and external job output files. The script function lets you filter by name of the job output files. The script function returns a reference to a data sequence that you can use for further processing by assigning the return code to the :PROCESS script statement. Use the GET_PROCESS_LINE script function to access a particular line in the list.

Important! Only use PREP_PROCESS_REPORTLIST on the Post Process page when you want to read the job output data of the task that contains the script. Complete Job output data cannot be retrieved when the script function is called on other Process pages.

Note: You cannot assign a new value to the script variable that contains the reference to the data sequence. Use :CLOSE_PROCESS to discard the existing data sequence, and then assign a new value.

More Information:

Syntax

PREP_PROCESS_REPORTLIST ([RunID] [, Filter])

Parameters

Columns

The data sequence contains columns with details of the job output files, in the following order.

  1. Report type
    Format:

    • Internal report: short name of the report type
      More information: Reports
    • External job output file: thee-digit sequential number

  2. Start time of creating the job output
    Format: YYYY-MM-DD HH:MM:SS

  3. End time of creating the job output
    Format: YYYY-MM-DD HH:MM:SS

  4. Title of the SAP job, or the path name of the log file on the Agent for Informatica jobs

  5. (SAP jobs only) Indicates whether it is an XML report

    • 0
      Not an XML report
    • 1
      XML report

  6. Full path and name of the external job output file or the job report (REP report type)
    Note: This column is empty for default reports such as ACT.

  7. Indicates whether the job output is on the Agent

    • 0
      Not on the Agent
    • 1
      On the Agent

  8. Indicates whether the job output is stored in the AE database

    • 0
      Job output is not stored in the database
    • 1
      Job output is stored in the database

Examples

The following example reads the output file names and paths of the last execution of the job JOBS.WIN.OUTPUT. The script writes the names of the files in the activation report.

:SET &RUNID# = GET_STATISTIC_DETAIL(,RUNID,JOBS.WIN.OUTPUT)
:SET &HND# = PREP_PROCESS_REPORTLIST(&RUNID#)
:PROCESS &HND#

:SET &FILENAME# = GET_PROCESS_LINE(&HND#, 6)
: IF  &FILENAME# = ""
: ELSE
: PRINT  "File name  = &FILENAME#"
: ENDIF
:ENDPROCESS

In the following example, a Windows Job generates two files and registers them as job output. The following lines are included in the Process page of the Job:

dir C:\temp >> C:\temp\test.txt
:REGISTER_OUTPUTFILE "C:\temp\test.txt","N"
dir C:\windows >> C:\temp\test2.txt
:REGISTER_OUTPUTFILE "C:\temp\test2.txt","N"

The Post Process page of the Job includes the following script. PREP_PROCESS_REPORTLIST queries the complete job output list. :PROCESS defines a process loop which prints the individual columns of each line in the activation print. A file transfer starts for each external output file, and transfers this file to a different computer. The agent, job login and the complete path of the file are passed on to the File Transfer object.

:PSET &AGENT_JOB# = GET_ATT(HOST)

:PSET &LOGIN_JOB# = GET_ATT(LOGIN)



:SET &HND# = PREP_PROCESS_REPORTLIST()



:PROCESS &HND#

: SET &RH_TYPE# = GET_PROCESS_LINE(&HND#, 1)

: SET &START_TIME# = GET_PROCESS_LINE(&HND#, 2)

: SET &END_TIME# = GET_PROCESS_LINE(&HND#, 3)

: SET &TITLE# = GET_PROCESS_LINE(&HND#, 4)

: SET &IS_XML# = GET_PROCESS_LINE(&HND#, 5)

: SET &FILENAME# = GET_PROCESS_LINE(&HND#, 6)

: SET &ON_AGENT# = GET_PROCESS_LINE(&HND#, 7)

: SET &IN_DB# = GET_PROCESS_LINE(&HND#, 8)

: PRINT "Report type = &RH_TYPE#"

: PRINT "Start = &START_TIME#"

: PRINT "End = &END_TIME#"

: PRINT "Title = &TITLE#"

: PRINT "XML report? = &IS_XML#"

: PRINT "File name  = &FILENAME#"

: PRINT "On the Agent? = &ON_AGENT#"

: PRINT "In the database? = &IN_DB#"



: IF &FILENAME# = ""

: PRINT "No external output file"

: ELSE

: IF &ON_AGENT# = 1

: PSET &FT_FILE# = &FILENAME#

SET &AKT# = ACTIVATE_UC_OBJECT(JOBF.OUTPUTHANDLING,,,,,PASS_VALUES,)

: ENDIF

:ENDIF



: PRINT



:ENDPROCESS

In the File Transfer object, the following script specifies the activating Job as the source agent and login. The path and name of the external job output file are set as the source file. The script sets the name of the source file as the destination, and changes the path C:\output\.

:PUT_ATT FT_SRC_HOST = &AGENT_JOB#
:PUT_ATT FT_SRC_LOGIN = &LOGIN_JOB#
:PUT_ATT FT_SRC_FILE = &FT_FILE#

:SET &POS# = STR_FIND_REVERSE(&FT_FILE#, "\") + 1
:SET &FNAME# = STR_CUT(&FT_FILE#, &POS#)
:SET &DST_FILENAME# = STR_CAT("C:\output\",&FNAME#)

:PUT_ATT FT_DST_FILE = &DST_FILENAME#

See also:

seealso

Script Elements for Data Sequences