SATISH_CHANDRA_9144

Email the contents of a file

Discussion created by SATISH_CHANDRA_9144 on Apr 13, 2017
Latest reply on Jun 20, 2017 by Antoine_Sauteron_1266

Hello There,

I have a situation and thought of asking the community after exhausted with trails.

I have a requirement to process a Job when a third party team provides two files, when there are more than two files, we need to inform them by email. This is met by using event object of type file and using SEND_MAIL in conjunction with GET_FILESYSTEM/PATH_FILE_COUNT.

Now I've an additional requirement, to send the list of files along with the email. This is where I'm struggling with.

Its a Windows server and I tried to use Windows JOB and calling this job in event. Following is what I did so far in the Job.

created a text file with contents of directory where files exists
used below code to process the file and send email.

:SET &MSG#=PREP_PROCESS_FILE("USEAGAN1108S",&FILE#)
:PROCESS &MSG#
:    SET &LINE#=GET_PROCESS_LINE(&MSG#)
:    PRINT &LINE#
:ENDPROCESS

:SET &OUT# = SEND_MAIL('xxxx@eco.com',, _
:                      'Seren_Center_Error_Reporting:20', &LINE#)

But the problem is , &LINE# in email send only first line. How to store multiple lines of text file in a script variable and send it to thru mail.

OR Do we have any other options to meet my requirement.

Outcomes