BookmarkSubscribeRSS Feed
zhuxiaoyan1
Quartz | Level 8

I use this code to export my three sas data files into an excell file with three sheets:

 

proc export data=EPI_PCT dbms=xlsx

outfile='\\nasnpmmds\EBI1\mmds\AHCPII\Pricing\Threshold_Updating\Threshold Update-Danielle\8-CABG / RB8' replace;

sheet="EPI_PCT";

run;

proc export data=PAP_PCT dbms=xlsx

outfile='\\nasnpmmds\EBI1\mmds\AHCPII\Pricing\Threshold_Updating\Threshold Update-Danielle\8-CABG / RB8' replace;

sheet="PAP5_PCT";

run;

proc export data=Gain_Risk dbms=xlsx

outfile='\\nasnpmmds\EBI1\mmds\AHCPII\Pricing\Threshold_Updating\Threshold Update-Danielle\8-CABG / RB8' replace;

sheet="Gain_Risk";

run;

but it give me error message:

The SAS/ACCESS Interface to PC Files is not installed. Please install this module in order to IMPORT/EXPORT to these file types.

even I installed sas pc file server. My SAS version is 9.3 TS1M2, Ms 32 bits, Windows 64 bits. I've installed pcfilesrv_931401_win_EN_web_1. Have I installed a wrong pcfile server?

4 REPLIES 4
ballardw
Super User

With PC File server you use a libname statement to link to the desired XLSX file, or create a new one, and use data step or other procedures to write to the library. Then clear the libname so SAS no longer locks the file.

 

Some thing like

 

libname myexc PCFILES path="\\nasnpmmds\EBI1\mmds\AHCPII\Pricing\Threshold_Updating\Threshold Update-Danielle\8-CABG\RB8.xlsx";

data myexc.EPI_PCT ;
   set EPI_PCT ;
run;

data myexc.PAP_PCT ;
   set PAP_PCT ;
run;
data myexc.Gain_Risk  ;
   set Gain_Risk  ;
run;

libname myexc clear;

I am not exactly sure of the path and file name as your use of mixed / and \ in the path looks odd. I also recommend no spaces.

 

Reeza
Super User

XLSX will have a limit of one sheet to a file in SAS 9.3 TS1M3 so you can't do multiple sheets. 

 

Upgrades are free, but since you're on a server that's not a straightforward process and you likely have to go through IT and can't control that. 

 

Another option would be 

1) Rich Poor Proc Export Macro - user written, a lot functionality as desired. 

http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export

 

2) Tagsets.Excelxp - Well documented, lots of options but not a native XLSX file, it creates an XML file instead.

zhuxiaoyan1
Quartz | Level 8
I tried tagsets.ExcelXp and created a file, but my computer could not open the file. I also tried Export Macro, it gave me error massage: Undetermined I/O failure.
Reeza
Super User

@zhuxiaoyan1 wrote:
I tried tagsets.ExcelXp and created a file, but my computer could not open the file. I also tried Export Macro, it gave me error massage: Undetermined I/O failure.

 

I can't do anything with this information. If you need further assistance you're going to have to provide more details.

 

Other things you should try:

1. Can you 'manually' export the file. If in BASE right click dataset and Export. 

2. Check your licenses, use PROC SETINIT and/or PROC PRODUCT_STATUS to verify what you have installed.

3. Export as CSV and convert to XLSX manually. 

 

FYI - SAS 9.3 is getting close to a decade old at this point. Expecting it to work with Excel 2013 isn't reasonable. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 793 views
  • 0 likes
  • 3 in conversation