BookmarkSubscribeRSS Feed
dkoggerson
Calcite | Level 5

export and import data from excel using pc file server to a network mount on the pc. (I am looking for the correct syntax with the sas pc file server listed and the right PROC)

Please see attachment

 

 

2 REPLIES 2
Tom
Super User Tom
Super User

What is it that thought you posted in the PDF?  The forum viewer is not seeing anything in there.

Tom_0-1654699850302.png

Post text in text boxes (like CODE examples).

You can paste in images in your question (or using the camera icon), but I am not sure what images you would need to describe and issue with CODE.

 

ballardw
Super User

It is often much more useful to show the LOG from when you run code. Copy text from the log for the entire data step or procedure that you are attempting, on the forum open a text box using the </> icon that appears above the message box and paste the text. The text box helps by preserving text diagnostics that SAS often provides that get reformatted when pasting into the main message windows.

 

IF pcfile server is configured correctly you would not "import" or "export" data. The spreadsheet file would be a Library and you read sheets (maybe, bad sheet names can be problematic) as data sets, or write to the library with any procedure or data set to create a new sheet.

 

Since you only provided picture and not actual text in that PDF (talk about wasted time doing that: copy and paste from editor should be much quicker)

 

Libname mylib pcfiles "\\server\path\filename.xlsx";

if the path is correct and pcfiles configured correctly would create a library named MYLIB.

If the xlsx file has sheets named Data1, Data2 and similar then those sets would appear in the LIBRARY folder.

 

Note: set options validvarname BEFORE a procedure that may need it. With the typical junk I find in spreadsheet tab names you likely also need Validmemname=extend. Be prepared to deal with Name literals for variables and data sets.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 2 replies
  • 504 views
  • 0 likes
  • 3 in conversation