I am using SAS version 9.4 and am trying to export some data to a specific unnamed range in an xlsx file. The data I have is stored in the UNIX environment and I want to export it to a windows xlsx file. I have checked the proc sentit and observed the necessary license ("SAS/ACCESS Interface to PC Files").
I looked into ods excel however the issue with this it cannot be used to change an existing file. Also, I believe this still does not meet my requirement to export data to a windows destination as it interacts with UNIX destinations.
I have since adopted a proc export and have managed to export to a sheet, but in the default position (A1). My code can be seen below (ignoring the XXXXs which are just illustrative for completion):
%Macro ExportToLAN(Dset,LAN_Name,sheet,range); proc export dbms=excelcs data=&dset. outfile="&LAN_Name." replace; sheet=&sheet.; range=&range.; server='XXXXXX'; port=XXXX; SERVERUSER="%sysfunc(strip(&LAN_username.))"; SERVERPASS="%sysfunc(strip(&LAN_password.))"; run; %Mend;
Running this macro results in a warning:
WARNING: This RANGE statement is not supported and is ignored in Export Procedure.
Does anyone have any idea on how to resolve this or better have any alternative solutions to exporting data to specific unnamed ranges?
Here is one example of how to use SAS Access to output to excel. In document there is also discussion , using DDE but please ignore this portion as this would not work on a server environment.
thanks
024-31: De-Mystifying the SAS® LIBNAME Engine in Microsoft Excel: A Practical Guide
What I have seen suggested for this is to NOT write directly to a range in the target file.
Instead write a whole SHEET in the target file and use Excel features to show the value from the sheet t in the range where you want it.
Probably you can take a look at this new solution, have similar effects like DDE (i.e. inject values to any cell of choice in an Excel/ Word/ PowerPoint template), which works well for cloud/citrix server environment. One-Click Report Automation - An automated and user friendly workflow for efficient, flexible, and e...
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.