If your version of SAS is running on a Windows-based system, take a look at the exportxl macro. It can export to a specific range and can even capitalize on using another workbook as a template.
The code that is available at:
https://github.com/art297/Papers/blob/master/Excelling_to_Another_Level_with_SAS/src/exportxl.sas
and the paper, powerpoint and tip sheet can be found at:
https://github.com/art297/Papers/tree/master/Excelling_to_Another_Level_with_SAS/doc
Art
What operating system is the server running?
Try running the macro but including the following parameter and value:
usenotepad=Y
Often, if running on a server, the server doesn't have direct access to your system's clipbrd. As such, the above mentioned parameter will use the server's copy of Notepad to mimic a copy/paste operation.
Let me/us know if that worked.
Out of curiosity, have you downloaded and compiled the macro before trying to use it?
Does your log provide any feedback?
In order to know what is happening, I'd need to know what is written to your log. Do you know why you're not getting anything written to your log?
Out of curiosity, what version of SAS are you running?
In your call to the macro you are setting the outfile to be:
c:\temp\class.xlsx
Does your server know what c:\temp is? I don't think so because it is trying to write to:
"',"\\laxxxx.com\LMPAPROD\USINE_PRIIPS\5. RETRAITEMENTS MANUELS\Chaine
Profils\4. Analyse\Marie_TEST\class1.xlsx",'"
As an outfile the macro needs to be supplied with a file that it can create.
I suggest you check with your IT department. They can configure your environment so that the server will recognize c: (or some other drive) that exists on your computer and which you can write to.
Once that is done, you should be able to use the macro.
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.