Automic Workload Automation

 View Only
  • 1.  Get Report (REP) data and send specific text from it to email

    Posted Jan 30, 2023 06:44 AM
    I need to access a path on windows and get the file names from there and send by email their names
    Using dir /path it give me this Report (REP)

    25.01.2023 08:03 49ÿ649 filename-200123.PDF
    25.01.2023 08:03 47ÿ678 filename-210123.PDF
    25.01.2023 08:03 47ÿ677 filename-220123.PDF
    26.01.2023 07:57 51ÿ162 filename-250123.PDF
    25.01.2023 08:03 47ÿ678 filename-210123.PDF
    25.01.2023 08:03 47ÿ676 filename-220123.PDF
    26.01.2023 07:57 51ÿ151 filename-250123.PDF

    I managed to send the email but is only one file from the list above.
    How can I send by email all files above and also have date hour?
    Here is an example of how I want to be send via email the files
    25.01.2023 08:03 filename-200123.PDF
    25.01.2023 08:03 filename-210123.PDF

    What re those characters '..ÿ...' eg. 49ÿ649?

    Bellow is my code
    :set &nl# = UC_CRLF()
    : set &hnd2# = prep_process_report(,, "REP","*&filename#")
    : process &hnd2#
    : set &line# = get_process_line(&hnd2#)
    : set &nr# = add(&nr#,1)
    : set &nr# = format(&nr#)
    : print "Found line: &line#"
    : print "&nl#Nr fisiere: &nr#"
    : set &pos# = str_find(&line#,".pdf")
    : set &pos1# = str_find_rev(&line#," ")
    : set &len# = sub(&pos#,&pos1#)
    : set &tname# = str_cut(&line#,&pos1#,&len#)
    : set &name# = str_trim(&tname#).'&nl#'
    : endprocess
    : close_process &hnd2#
    !!!=======================Email Content===========================!!!
    :set &notif# = send_mail('&tot#','','&sub#','&name#.PDF&nl#')​


  • 2.  RE: Get Report (REP) data and send specific text from it to email

    Broadcom Employee
    Posted Jan 31, 2023 02:13 AM
    Hi,
    in your code you are overwriting the name in every loop instead of appending it.
    Alternatively you can use the "file list VARA" object:
    https://docs.automic.com/documentation/webhelp/english/AA/12.3/DOCU/12.3/Automic%20Automation%20Guides/help.htm#AWA/Variables/varaFILELIST.htm
    The ÿ character seems to be incompatible with the code set being used.
    Regards, Markus



  • 3.  RE: Get Report (REP) data and send specific text from it to email

    Posted Feb 01, 2023 05:40 AM
    Can you be more specific, what solution do you propose? Can I save the report in vara? How can I send the content from vara to email?
    Thanks!


  • 4.  RE: Get Report (REP) data and send specific text from it to email

    Broadcom Employee
    Posted Jan 31, 2023 02:31 AM
    Hi, unfortunately the cmd still uses the 850 code page as default. This can not interpret some chars properly. You can try to run "chcp 1252" before the dir or on the beginning of the job. But to use the file list variable is more elegant :-)

    br peter


  • 5.  RE: Get Report (REP) data and send specific text from it to email

    Broadcom Employee
    Posted Jan 31, 2023 05:31 AM
    Hi @Sergiu Guta

    you can also use the option /-C of the dir command​ to not display the thousand separator.

    /C          Display the thousand separator in file sizes.  This is the
                default.  Use /-C to disable display of separator.​



  • 6.  RE: Get Report (REP) data and send specific text from it to email

    Posted Feb 01, 2023 05:46 AM
    This helpes me. But I didn t manage to find a solution to send the content of report by email


  • 7.  RE: Get Report (REP) data and send specific text from it to email

    Broadcom Employee
    Posted Feb 01, 2023 06:03 AM
    After the job that runs the dir /path command put a Notification object into your workflow. Set the type of the Notification object to E-mail and provide the RunID of the job in the "Attach Reports" field. You can use :PUBLISH in the job to publish the RunID in order to hand it over to the Notification. No PREP_PROCESS required with this solution.


  • 8.  RE: Get Report (REP) data and send specific text from it to email

    Posted Feb 07, 2023 08:17 AM
    I created a Job Plan "JOBP.FILES_NOT_PROCESSED" in which I included
    1. first the "JOBS.WIN.FILES_NOT_PROCESSED" that that runs the dir /path command
    2. second the CALL.FILES_NOT_PROCESSED - intended to send notifications
    How Can I get the content of the resport from object "JOBS.WIN.FILES_NOT_PROCESSED" to be sent by email?
    Now how can I mention the email to which to be sent the notification?
     
    I added :add_att recipient, 'my@email.com'  where my@email.com is a substitute for my real email
     
    I didn t get any email.
    How to mention where to send the email, should I use SEND_MAIL function?
    Thank you for your help!



  • 9.  RE: Get Report (REP) data and send specific text from it to email

    Posted Feb 07, 2023 08:58 AM
    I manage to send the report by email but it shows all reports can I send only "REP" one?
    Here is mentioned same issue but no real solution
    Here https://community.broadcom.com/communities/community-home/digestviewer/viewthread?MID=802418

    My report "REP" looks like this

    Program 'UC4 Job Messenger' version '12.3.4+build.1601882686134' terminated normally
     
    c:\>dir \\D /-C 
     Volume in drive \\D has no label.
     Volume Serial Number is 183E-9174
     
     Directory of \\D
     
    07.02.2023  11:39    <DIR>          .
    07.02.2023  11:39    <DIR>          ..
    02.02.2023  15:43    <DIR>          archive
    02.02.2023  14:51             52414 fileabc.pdf
    07.02.2023  07:45             47674 file_name-060223.PDF
    07.02.2023  07:45             47672 file_name1-060223.PDF
    07.02.2023  07:45             47664 file_name2-060223.PDF
    03.02.2023  05:33             47673 file_name3-020223.PD2
    04.02.2023  05:33             47673 file_name4-030223.PDF
    05.02.2023  09:17             47673 file_name5-040223.PDF
    06.02.2023  05:33             47674 file_name6-050223.PDF
    07.02.2023  05:34             47672 file_name7-060223.PDF
    07.02.2023  07:45             49188 file_name8-060223.PDF
                  10 File(s)         482977 bytes
                   3 Dir(s)     56772354048 bytes free
    Can I processsomehow the report to display only files eg.:
    07.02.2023  07:45             47674 file_name-060223.PDF
    07.02.2023  07:45             47672 file_name1-060223.PDF