Automic Workload Automation

  • 1.  Using PROCESS and ENDPROCESS loops

    Posted Oct 25, 2018 12:08 PM

    Hello. I want to write a script which does the following.

    1. Gets names of .csv files in a folder

    2. For .csv files 1 to x in above, loop through the list and do the following

       a. Extract email address from first line of the .csv file

       b. Email the .csv file to the extracted email address.

     

    I've came up with the following code, which does the above, but only for 1 and a bit iterations of the loop.

    :

     

    The output from the job log is below

     

    So the first run through, it gets the first file name, extracts the email address and then sends the email. It then starts the second iteration through the loop. It gets the filename, but then seems to stop when its extracting the email address.

     

    Any ideas of why this might be happening ?

     

    Regards

    Craig



  • 2.  Re: Using PROCESS and ENDPROCESS loops

    Posted Oct 25, 2018 05:07 PM

    Hey Craig,

     

    I believe that a close_process is needed for the nested PREP_PROCESS.

     

    For example:

     

    :ENDPROCESS

    :CLOSE_PROCESS &EMVAL#

    :SET &OUT# = MAIL

    :ENDPROCESS

     

     

    EDIT:

    When using the close_process, the send mail command might need to be moved into the nested PREP_PROCESS

    Docu: CLOSE_PROCESS