BookmarkSubscribeRSS Feed
JustSomeGuy
Calcite | Level 5

I have some SAS code that writes out to a sheet in an Excel workbook. Currently I'm just using proc export dbms=excelcs but can also use libname with pcfiles if neccesary. Is it possible for SAS to save the workbook with a different name after it's finished writing out to the sheet it updates?sas

4 REPLIES 4
Reeza
Super User

Are you using SAS Office Add In? or Base SAS?

And what kind of name would you like? If you specify a new workbook in your proc export it will go to that workbook, but how will you specify it.

JustSomeGuy
Calcite | Level 5

Reeza,

I'm opening an existing workbook, writing out a new sheet, and then I want to save the workbook with a different name. Basically the workbook is a template, so I want to open the template, write out the new data and then save it so it reflects the data in there. This way I can run my code multiple times and end up with multiple workbooks populated instead of having to put a new template workbook in the folder each time. With proc export is it possible to specify a workbook to open and then specify a different one to save as?

Reeza
Super User

No, but you can use some other options, such as x command to copy and save the work book with a different name and then export to that new file.

Can you provide more info, specifically, operating system, excel version, if you have X command Smiley Happy

JustSomeGuy
Calcite | Level 5

SAS is running on 64-bit linux and I have Excel 2010. I'm not sure if we X command but I do know we have SAS/ACCESS Interface to PC Files and have the PCFILES Server set up.

Thanks a lot for your help!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Discussion stats
  • 4 replies
  • 1330 views
  • 0 likes
  • 2 in conversation