data _null_;
filename mail email
to=(&mv_email_destinataire_list)
from="SAS"
subject="Export file";
file mail;
put "hello, please find enclosed the file";
PUT "link= \\\ukipu004.dummy-website.fr\cdg\Export_files\result.xls";
run;
Hello,
by launching this code, it works. I mean, in the reveived email, by clicking on the link, the file is found and opened.
however I 've got a unix variable $GRPFPU that contains ukipu004.dummy-website.fr\cdg
so I try to launch with this line ==>PUT "link= \\\$GRPFPU\Export_files\result.xls";
but the email contains \\\$GRPFPU\Export_files\result.xls instead of \\\ukipu004.dummy-website.fr\cdg\Export_files\result.xls then this link doesn't work.
thanks a lot in adavance for your help
Nasser
UNIX environment variables are not automatically imported into SAS. Exceptions: environment variables that contain a path to a directory or to a file are automatically used as librefs or filerefs, respectively.
To create a macro variable from a UNIX environment variable, use the %sysget() function:
data _null_;
filename mail email
to=(&mv_email_destinataire_list)
from="SAS"
subject="Export file";
file mail;
put "hello, please find enclosed the file";
PUT "link= \\\%sysget(GRPFPU)\Export_files\result.xls";
run;
To be more specific, I'd incorporate the protocol and proper UNIX-style syntax:
put "link= https://%sysget(GRPFPU)/Export_files/result.xls";
Replace https with whatever you're using to access the file.
UNIX environment variables are not automatically imported into SAS. Exceptions: environment variables that contain a path to a directory or to a file are automatically used as librefs or filerefs, respectively.
To create a macro variable from a UNIX environment variable, use the %sysget() function:
data _null_;
filename mail email
to=(&mv_email_destinataire_list)
from="SAS"
subject="Export file";
file mail;
put "hello, please find enclosed the file";
PUT "link= \\\%sysget(GRPFPU)\Export_files\result.xls";
run;
To be more specific, I'd incorporate the protocol and proper UNIX-style syntax:
put "link= https://%sysget(GRPFPU)/Export_files/result.xls";
Replace https with whatever you're using to access the file.
thnaks a mot Kurt. It works as attended. evenf if the link is a littl weird with "\" and "/" like this :
lien= \\\/ukipu004.dummy-website.fr\folst\Export_files\result.xls
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.