Adding contents of a file to the Body of DO MAIL

All questions about Control-M jobs definitions
Post Reply
User avatar
jstarkw
Nouveau
Nouveau
Posts: 58
Joined: 14 Jan 2010 12:00

Adding contents of a file to the Body of DO MAIL

Post by jstarkw » 30 Jan 2010 6:49

Is it possible to put he contents of a short log file into the body of a DOMAIL? The recipient does not want an attachment. Log file is generated on a linux server. I am using versiob 6.4 for windows with msql2005.

User avatar
Dilbert
Nouveau
Nouveau
Posts: 185
Joined: 10 Jan 2007 12:00
Location: Zagreb, Croatia

Post by Dilbert » 01 Feb 2010 8:45

I don't know how you can do that dorectly from CONTROL-M (it is not possible, I think), but you can do that using reporting tools utilities together with CONTROL-M. For example, look for ChristianSteven Software and their tools for automate reports distributing. Their tools can do exactly what you want. Also, you can use CSS from command line prompt, so, no problem with integrating CSS reporting scheduling into CONTROL-M workflow. That way you can do exactly what you want.

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 02 Feb 2010 10:58

jstarkw,

What kind of log are you talking about?

Since 6.4.0, you can attach the sysout of the job to a mail.

You can as well process the controlm job log (CMR_IOALOG) by an SQL request runnable as part of a %%POSTCMD, in which case the result of the request will be part of the job's sysout.

I can provide additional guidelines if this could address your need
Cheers
Nicolas Mulot

baralem

Post by baralem » 02 Feb 2010 12:41

As Nicolas said, you can only attach job's SYSOUT using DO MAIL.
If you need to send a different log file (not sysout) generated inside the job, the easiest way is using Linux OS tools:
cat $LOGFILE | mailx -s "Job XX log" email@xxxxx.com

regards
martin

User avatar
jstarkw
Nouveau
Nouveau
Posts: 58
Joined: 14 Jan 2010 12:00

Post by jstarkw » 02 Feb 2010 8:30

Thanks all for the replies. I am currently running into the problem that mail originating from this server is getting rejected as spam because the return address defaults to the user@server domain. I know this can be changed in sendmail configuration file but I am not a linux expert nor do I have the required permissions on the server to make the change. The process to get this changed has been dreadfully slow and I was looking for an alternative way of sending the log contents. The log is a very small test file less than 3kb. My customer did not like receiving it as an attachment.

Another question: Can a text string be saved as an auto edit variable? I tried but was getting errors.

ctmvar -ACTION SET -VAR "%%\group\new_var" -VAREXPR "`cat log`"

ctmvar: symbol lookup error: ctmvar: undefined symbol: AG_UTIL_main_dynamic

Post Reply