Automic Workload Automation

 View Only

Expand all | Collapse all

Unable to send the current date file in an attachment

  • 1.  Unable to send the current date file in an attachment

    Posted Aug 20, 2024 09:11 AM

    Hi Community,

    I am trying to copy the current date files from the agent path and send the files in the attachment with the below script. If i give the filename fully i am able to receive the files in attachment in the mail but i need to copy the files of current date.

    It would be helpful if anyone help me with this,

    cd /automic/12.3.7/Automation.Platform/Agents/unix/FILES
    : SET &TODAY# = SYS_DATE("YYYYMMDD")
    : Print "checking date:&TODAY#"
    ls
     
    :  SET &RECIPIENTS# = "********"
    :  SET &ATTACHMENT# = "/automic/12.3.7/Automation.Platform/Agents/unix/FILES/INVREC_COMS_&TODAY#*_*.CSV"
    : SET &RET_MAIL# = SEND_MAIL("&RECIPIENTS#", "***********", "BY STOCK FILES", "Hello All, Kindly refer above attachment OF BY STOCK FILES.","&ATTACHMENT#", "*****", "******")
    Thanks and regards,
    Shravya


  • 2.  RE: Unable to send the current date file in an attachment

    Posted Aug 21, 2024 12:48 PM

    Hi Sharavya,

    I noticed that the wildcard option doesn't work with SEND_MAIL; you need to specify the full path along with the file name, separated by a semi-colon for multiple files.

    To work around this, you can list the files with the current date, concatenate their names into a variable using a Shell script or the Automic Script STR_CAT function, and then pass that variable, which contains the complete paths and file names.

    For more details, you can refer to the following documentation:
    - SEND_MAIL
    - STR_CAT

    BR,
    Danish