DATA Step, Macro, Functions and more

using mainframe sas to send smtp email to outlook results in garbage in the body

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

using mainframe sas to send smtp email to outlook results in garbage in the body

Community,  using sas v9.4 on the mainframe just trying to get a simple proof of concept batch job to work with limited results.

I've seen the myriad examples and I'm sure I'm doing something dopey but am at wits end.

This jcl:

//IDS EXEC SAS,OPTIONS='CPUID,NOTES'
//SAS.SASLOG DD SYSOUT=*
//SAS.SASLIST DD SYSOUT=*
//SYSIN DD *
OPTIONS EMAILSYS = SMTP;
OPTIONS EMAILHOST = XXXXXX.YADA.COM;
FILENAME MYEMAIL EMAIL
TO="MYUSERID.XXX.COM"
SUBJECT="CODER'S CORNER"
TYPE="TEXT/PLAIN";
DATA _NULL_;
FILE MYEMAIL;
PUT "PLEASE ATTENDED CODER'S CORNER";
RUN;
FILENAME MYEMAIL CLEAR;

 

Sends the email to my Microsoft Outlook mailbox, Subject looks just fine, but the one line

I have in the body "PLEASE ATTENDED CODERS CORNER"  comes across in the body of the email as

WSEAbE@AccEUDED@CVDEY}b@CVYUEY

 

What is causing the put statement to get garbled??

thanks,


Accepted Solutions
Solution
‎03-01-2017 09:21 AM
Super User
Posts: 6,972

Re: using mainframe sas to send smtp email to outlook results in garbage in the body

Any standard text on a mainframe is created using the EBCDIC code.

Try something like

length charvar $50;
charvar = "Please attend coder's corner";
put charvar $ascii50.;

to convert the text to ASCII.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
‎03-01-2017 09:21 AM
Super User
Posts: 6,972

Re: using mainframe sas to send smtp email to outlook results in garbage in the body

Any standard text on a mainframe is created using the EBCDIC code.

Try something like

length charvar $50;
charvar = "Please attend coder's corner";
put charvar $ascii50.;

to convert the text to ASCII.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 7

Re: using mainframe sas to send smtp email to outlook results in garbage in the body

worked like a charm!!   Thanks a million Kurt!

 

Best,

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 117 views
  • 0 likes
  • 2 in conversation