BookmarkSubscribeRSS Feed
Lapis Lazuli | Level 10

I have a csv file within a share drive with an &

%LET MTG = \\\mort\SS&A Folder\mortgage

When I run the code it says WARNING: Apparent symbolic reference A not resolved

I renamed this way

%LET MTG = \\\mort\SS(&)A Folder\mortgage

I do not get the error when I add (&) however when I run the following code

proc import 
dbms=EXCELCS replace; /*EXCELCS*/
port=9922 ;
SERVERUSER="&suserid."; SERVERPASS="&mypass.";

I get the error It does not exist or it is already opened exclusively by another user, or you need permission
I am thinking that I am not actually reading in the sharedrive.  I do not know why the user name the sharedrive with an '&' however is there a fix so I can read in the file??

Super User Tom
Super User

Try adding macro quoting.

For your original path you could try just adding it when defining it.

%LET MTG = \\\mort\SS%str(&)A Folder\mortgage;

For the second try adding it in the call to PROC IMPORT.



Lapis Lazuli | Level 10
I used Excel because when I used CSV i received an error. Is that the correct reference in this case
Super User

@Q1983 wrote:
I used Excel because when I used CSV i received an error. Is that the correct reference in this case

Show the code that you use with CSV with the error(s)


You may have to open the file, not with spreadsheet software, with a plain next editor like Notepad to see the actual contents to set the proper delimiter and options.

Super User Tom
Super User

I do not see anything in the documentation that says you can use the SAS PC Files Server to access CSV files.  Just Excel or Access files.  if the file is actually a CSV file then move it to a location that SAS can read directly.  Or use Excel to read the file and save it as an XLSX file and then try using PC Files Server to read the XLSX file.

Super User

One does not use PROC IMPORT for CSV files. Write the data step yourself, according to the file documentation, for consistent and controlled results. Or use PROC IMPORT only once, and copy the data step code from the log and correct/optimize it.

The PC Files server is only for Excel workbooks and MS Access (.mdb) files, and is only needed when you run SAS on a non-Windows platform where the Microsoft-supplied module for reading older MS Office files is not available. With the introduction of .xlsx and the (now internal to SAS) XLSX engine SAS can read such files on all supported platforms.

You have to store the file on the SAS server (upload facility in SAS Studio, or Copy Files task in Enterprise Guide) or on a shared network location which is also accessible (mounted) on the SAS server.


Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


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
  • 7 replies
  • 4 in conversation