Hi there
I need help on building a SAS job to send an email from mainframe. The email has 2-3 lines of content and an attachment. The attachment is a PDS file to attach as a text file. I was able to send mail without attachment. but the attachment part not working for me.
//xxxxxxx JOB MSGCLASS=J,MSGLEVEL=1,NOTIFY=&SYSUID
//SAS9 EXEC SAS
FILENAME MAILBOX EMAIL;
DATA _NULL_;
FILE MAILBOX TO=('xxxxxxx@xxxxx.com')
SUBJECT='MONTHLY FILE';
PUT "Hello xxxx,";
PUT " ";
PUT "This is to inform you that xxxxxxxxxxxxxxxxxx.";
PUT "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.";
PUT " ";
PUT "Best regards,";
PUT "xxxxxxxxxxxxxxxxxxxx";
RUN;
//*
Thank you so much Lasen
It worked exactly as I expected. you made my day.
I think the normal style is to put the email options in the FILENAME statement, rather than in the FILE statement, e.g.:
//xxxxxxx JOB MSGCLASS=J,MSGLEVEL=1,NOTIFY=&SYSUID
//SAS9 EXEC SAS
FILENAME MAILBOX EMAIL TO=('xxxxxxx@xxxxx.com') SUBJECT='MONTHLY FILE' attach="user.misc.pds(member)";
DATA _NULL_;
FILE MAILBOX;
PUT "Hello xxxx,";
PUT " ";
PUT "This is to inform you that xxxxxxxxxxxxxxxxxx.";
PUT "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.";
PUT " ";
PUT "Best regards,";
PUT "xxxxxxxxxxxxxxxxxxxx";
RUN;
//*
Thank you so much Lasen
It worked exactly as I expected. you made my day.
how do i do that?. I am new to this blog );
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.