Hi Gurus,
I am banging my head to get the required output
I have the dataset which gives me the max date of the column and I want to send the RESULT through email but not as an attachement but I am not getting any solution to it. Below is the output from the dataset which I want to send to email.
MAX_of_DATE_OF_EFFECT
13/06/2017 21:45
I tried to export the output to excel sheet and then tried using vb script but seems that I do not have admin rights to run the vb script. Is there any way to get the required output.
In your PUT() you use 8.
Use a date format instead, and it will show as you specify. Date9 is one option, though I wonder if that's a datetime field. If so, try datetime20.
Couldn't you just put that value in a macro variable and then use it however you want to?
You didn't say how you got the value. If it was with proc sql, just use into : to put it in a macro variable. If you got it via a datastep, use call symput.
Art, CEO, AnalystFinder.com
Hi art297,
thank you very much for the reply. I will have a look into the function now and see how it goes.
I tried the below solution
DATA date_3;
SET WORK.Maxlendnetdate;
CALL SYMPUT('maxdate',put(MAX_of_DATE_OF_EFFECT, 8.));
run;
FILENAME outbox EMAIL ("hari.kurupati@cba.com.au");
DATA _NULL_;
FILE outbox
TO=("hari.kurupati@cba.com.au")
SUBJECT=("Lendnet &maxdate ");
PUT "On &maxdate ";
RUN;
but I am getting the output as attached in the screenshot
1.813E9
I think there is some thing with format
Regards,
hari
In your PUT() you use 8.
Use a date format instead, and it will show as you specify. Date9 is one option, though I wonder if that's a datetime field. If so, try datetime20.
Why not include the single value as text in your email?
How would you include an excel document without attaching it in an actual email client? I'm not aware of a way....
Hi Reeza,
thank for your reply. I am not sure abou this way as I am new to SAS. I tried searching through internet and also tried taking the inputs from art297 and I was able to find something
DATA date_3;
SET WORK.Maxlendnetdate;
CALL SYMPUT('maxdate',put(MAX_of_DATE_OF_EFFECT, 8.));
run;
FILENAME outbox EMAIL ("xxxxx.com.au");
DATA _NULL_;
FILE outbox
TO=("xxxxx.com.au")
SUBJECT=("Lendnet &maxdate ");
PUT "On &maxdate ";
RUN;
but getting some format issues with the date as shown in the attached.
your date is number, to precisely in float, . please use a date format something loke shown below, so that it displays as date
CALL SYMPUT(‘maxdate’, PUT( yourdate, MMDDYY6.));
Is EG running on a server or your desktop? Either way you need to have the correct privileges to be able to do this. You should be able to send an email directly from SAS rather than use VB but it's also a viable option if you can't get it working for some reason.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.