BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,
I'm trying to export a file to excel and then sent am e-mail with a link to the xls file,
the name of the file contains macros for the date and time, but when I add the time macro, the file created is not recognized as an xls file.
the here is the code :

***************************************************
data _null_;
a=time();
dc=put (a,time5.);
dc=substr (dc,1,2)||':'||substr (dc,4,2);
call symput ('data_time',dc);
run;

%put &data_time;


ods tagsets.test options(embedded_titles='Yes')
file="&path\sasoutputs\tayar_untypical&sysdate&data_time..xls"
style=XLSasweb;
title;

ods tagsets.test alias="cards";


proc print data=mydblib.tayar_auth_final noobs label;
var card_number
country_name

run;

ods _all_ close;



filename emailmsg email
to=("sivana@gmail.com")
FROM='The SAS System '
subject=cards';

DATA _NULL_;
FILE emailmsg;
PUT ;
PUT ;
PUT HREF="\\netapp01\users \SasOutputs\tayar_untypical&sysdate&data_time..xls";
run;

filename emailmsg;
**********************************************************

What can I do to solve the problem?
Thanks,
Sivan
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Choose a different character than the colon in your time-portion of your file name -- it must be compatible with file-naming strings.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Thank you!
deleted_user
Not applicable
Hi,
I did what you said, but now there is a problem with the link that appears in the mail, it looks like this :

HREF=. \\netapp01\users\SasOutputs\tayar_untypial_auth_from_today\tayar_untypical15JUN09' 8_40.xls

Seems like the second macro is not recognized as a part of the link, what can I do?
Thanks,
Sivan Message was edited by: sivana
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Clearly you have an imbedded blank character somewhere in your SAS code. Suggest you perform some self-diagnosis by adding the stmt below to generate more SAS log output while SAS is compiling the code:

OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN;


Scott Barry
SBBWorks, Inc.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 870 views
  • 0 likes
  • 2 in conversation