Sorry, that code, using sashelp.class (and chaning the path) worked fine for me. So either a) you have some things stuck in your session - solution to this would be to exit your session, start fresh and then try, or b) that path you have there - which looks odd to me, it look slike some sort of web address?? - is incorrect or not accessible. Try the fresh session, and try running the code with a local path, e.g. c:\temp\something\...
Once that works then add in any extra bit.
@ybz12003 wrote:
option mlogic mprint symbolgen;
data _null_;
dt=put( today( ),date9. );
call symput('dt',dt);
run;
%let folder = \\abc.org\data_structure\Test;
%let X1=child;
%let X2=mom;
DATA &X1;
SET TN (keep=record mrn dob);
run;
DATA &X2;
SET TN (keep=record BB DCG);
run;
PROC EXPORT DATA= &X1
outfile= "&folder.TN1&dt..xls"
dbms=xls replace;
sheet=&X1;
run;
PROC EXPORT DATA=&X2
outfile="&folder.TN1&dt..xls"
dbms=xls replace;
sheet=&X2;
run;
Assuming that you copied all of that code at one time and pasted it in one step then note that your text highlight colors in the second proc export step are VERY different. The "run" in the first is not highlighted and the "outfile" in the second is the same color as the quoted string in the first. These color differences look suspiciously like there may be some hidden character that SAS is interpretting poorly. If any of the above code involves something copied from a web location and pasted then you may want to delete everything starting after sheet=&X1; and retype from scratch.
Thanks for your help. After I put the whole path including the quotation make, it works fine. However, I could not use call symput for the today macro.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.