Automic Workload Automation

Expand all | Collapse all

PREP_PROCESS_REPORT , select few lines of output

Srikanth_Veeraraghavan_991212-08-2017 06:29 AM

Walter Xavier Bermudez Tamayo03-24-2019 09:21 PM

Srikanth_Veeraraghavan_991212-12-2017 05:39 AM

Anon Anon12-14-2017 03:42 AM

  • 1.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-07-2017 06:11 AM
    I have used PREP_PROCESS_REPORT to extract and view my entire length of output from REP or ACT tab. What if I have extract and print only few lines of the entire output. 
    For ex:
    Lines printed in ACT
    employee 1 to employee 10

    What if I have to extract only data employee 5 to employee 8 ?




  • 2.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-07-2017 07:13 AM
    Basically thats possible you can define the delimeters of which lines should be selected, and use GET_PROCESS_LINE with these parameters to select what lines should be selected and printed out to the ACT Report.

    Please find further info and a example within documentation:

    https://docs.automic.com/documentation/webhelp/english/AWA/12.1/DOCU/12.1/AWA%20Guides/help.htm#AE_AWA_Source/Script/ucaavf.htm?Highlight=PREP_PROCESS_REPORT

    (its from Version 12.1 docu, but it has not changed much from earlier versions)


  • 3.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-07-2017 11:57 PM
    Thanks @Harald Heidinger . I am using the same commands what you have mentioned above. However I need to know if we have 100 lines in the output, how can we extract only lines from 55 to 79 ( for example ) ??


  • 4.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-08-2017 06:29 AM
    @Michael Lowry. Reques you to help on the above pls. 


  • 5.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-08-2017 03:11 PM
    here is a very basic & simple example using PREP_PROCESS_REPORT:

    win job with som REM lines....

    For the PREP_PROCESSS_REPORT script function i defined the filter *Employee* so every line conaining this string will be returned.

    nzuwhr00708e.jpghttps://us.v-cdn.net/5019921/uploads/editor/oc/nzuwhr00708e.jpg" width="1206">

    ei466eeiiyko.jpg


  • 6.  Re: PREP_PROCESS_REPORT , select few lines of output

    Posted 03-24-2019 09:21 PM

    Hi! Can the PREP_PROCESS_REPORT accept multiple filters?



  • 7.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-09-2017 12:53 AM
    Thank you @Wolfgang Brueckler . I have already achieved it. What if I have to extract few lines from middle out of it. Say from Employee 05 to Employee 22


  • 8.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-09-2017 03:25 AM
    Then you could use script function FIND or STR_MATCH or a construct with GET_VAR (Varaobject containing your search matches) to get the values you want.

    The way to your solution depends on your requirements in automic there are always several possibiltties to archieve your requrements...

    cheers, Wolfgang


  • 9.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-11-2017 12:34 AM
    @Wolfgang Brueckler, It would be of greater help if you could share me the piece of code to achieve the same


  • 10.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-11-2017 11:05 AM
    Srikanth Veeraraghavan, once you create the desired data sequence via prep_process_report with the appropriate filters you'd have to extract the specific lines through the process loop.

    If your data sequence has 100 lines and you need lines 5-35  you can increment a number variable with each process loop and extract the specific lines when the value is met.

    I.E:

    :set &num#=1
    :set &hnd#=prep_process_report(.....)
    :process &hnd#
    :set &line#=get_process_line(&hnd#)
    :switch &num#
    :case &num# between 5 and 35
    :print &line#
    :case &num#>35
    :term_process
    :endswitch
    :set &num#=&num#+1
    :end_process

    Alternatively you could have a WHILE loop which increments your &num# value and uses that in the GET_PROCESS_LINE command outside of the process loop to identify the ROW you want to pull from the datasequence

    :set &num#=0
    :set &hnd#=prep_process_report(.....)
    :while &num#<=35
    :set &num#=&num#+1
    :set &line#=get_process_line(&hnd#,,,&num#)
    :switch &num#
    :case &num# between 5 and 35
    :print &line#
    :endswitch
    :endwhil:smile:

    These are simplified examples that could work. 


  • 11.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-12-2017 05:39 AM
    Thank you Daniel Darling, let me try and get back


  • 12.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-12-2017 11:35 PM
    Hi Daniel Darling, It seem to be not working. I placed this piece of code in an object's post process tab. My pre-process tab has simple code of reading a notepad and printing all lines. I am trying to extract few lines out of it and display in post process. 


  • 13.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-13-2017 02:57 AM
    Without the info WHAT you are scripting and WHICH result you get, nobody will be able to help you...


  • 14.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-13-2017 03:40 AM
    Alright . Here are some information. I am doing a simple code of reading a notepad file with content and printing them in pre-process of windows object. Then in the post process tab , my intention is to extract few lines of output from ACT/REP and print it. 

    Pre-process code:
    :set &file1# = 'c:\test101.txt'
    :set &hnd#=prep_process_file("DEMO5_WINDOWS_PS","&file1#")

    :process &hnd#
    :   set &line#=get_process_line(&hnd#)
    :   print "&line#"
    :endprocess
    : CLOSE_PROCESS &hnd#

    Post-process code:
    :set &num#=0
    :set &hnd#=prep_process_report('JOBS',,'ACT')
    :while &num#<=10
    :set &num#=&num#+1
    :set &report#=get_process_line(&hnd#,,&num#)
    :switch &num#
    :case &num# between 5 and 35
    :print &report#
    :endswitch
    :ENDWHILE

    I am not getting any result out of it in the ACT report.




  • 15.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-13-2017 11:15 AM
    The second parameter of get_process_line() tells you what column to retrieve from "the next report line", not what line number to retrieve.   To get to the 20th line, you execute get_process_line() 20 times.

    https://docs.automic.com/documentation/WEBHELP/English/AWA/11.2/AE/11.2/All%20Guides/help.htm#ucaafc.htm?Highlight=get_process_line



  • 16.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-13-2017 01:27 PM
    As Pete mentioned: To get to the 20th line, you execute get_process_line() 20 times.

    You really should read the docu for the script commands ... :-)
    that helps avoiding script errors such as GET_PROCESS_LINE and SWITCH &num# ... :-P

    here is a working example:

    content of my textfile:
    TEXT 1 TEXT
    TEXT 2 TEXT
    TEXT 3 TEXT
    TEXT 4 TEXT
    TEXT 5 TEXT
    TEXT 6 TEXT
    TEXT 7 TEXT
    TEXT 8 TEXT
    TEXT 9 TEXT
    TEXT 10 TEXT
    !PRE_PROCESS
    :set &FILE1# = 'c:\Temp\test101.txt'
    :set &HND#=PREP_PROCESS_FILE("V112_WIN01","&FILE1#")
    :process &HND#
    :   set &LINE#=get_process_line(&HND#)
    :   print "&line#"
    :endprocess
    : CLOSE_PROCESS &HND#

    !POST_PROCESS
    :SET &COUNTER# = 0
    :SET &HND_PP# = PREP_PROCESS_REPORT(,,'ACT')
    :PROCESS &HND_PP#
    :  SET &LINE#=GET_PROCESS_LINE(&HND_PP#)
    :  SET &COUNTER# = ADD(&COUNTER#,1)
    :  SWITCH "Y"
    :    CASE &COUNTER# between 5 and 7
    :    PRINT "&LINE#"
    :  ENDSWITCH
    :ENDPROCESS
    :CLOSE_PROCESS &HND_PP#


    !POST_PROCESS_REPORT:
    2017-12-13 19:21:19 - U00020408 ### 20171213/182119.000 - U00020408 TEXT 5 TEXT
    2017-12-13 19:21:19 - U00020408 ### 20171213/182119.000 - U00020408 TEXT 6 TEXT
    2017-12-13 19:21:19 - U00020408 ### 20171213/182119.000 - U00020408 TEXT 7 TEXT

    Hint: You should avoid processing the file AND the report again for the same data, that can cause performance issues if heavily used...

    cheers, Wolfgang


  • 17.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-13-2017 11:11 PM
    Thank you Wolfgang Brueckler , I am reading documents else I wouldn't have come this far :smiley:.. I was close  but mislead with SWITCH case. Thanks for helping me, it is working fine  :). 


  • 18.  PREP_PROCESS_REPORT , select few lines of output

    Posted 12-14-2017 03:42 AM
    You 're welcome :-)