So i'm in linux enviroment
i have this filename: text.01.xlsx
when I try to import
proc import
datafile="/opt/test.01.xlsx"
dbms=xlsx out=simon replace;
sheet="sheet1";
getnames=yes;
run;
but is not working because of the dot in the middle of the filename test.01.xlsx
Can you show us the log from attempting that code.
Copy the log from the Proc import through any messages related. Paste into a code box opened with the </> icon to preserve formatting of any error message diagnostics.
Probably the error message is just truncating.
Most likely there is some difference in the file name.
Check that the file actually exists. For example try just reading the first 10 bytes using a data step.
data _null_;
infile '/opt/test.01.xlsx' recfm=f lrecl=10;
input;
list;
stop;
run;
Are you using SAS/Studio? Look for the file in the Files and Folders browsing panel and copy the full filename from the properties window of the file into your program.
Some things. One notice that the RED text has two / before Test.01
I don't know why but if the system thinks those are there then a folder with no name is expected
Second, is /opt your mount point for data? Paths should always include a complete path from the os point of view.
Third: is this path one you are sure that your SAS system can see? If SAS executes on a server and your data is local then perhaps the server has a similar path that does not contain your data.
Of course you already checked that the case of the folder names is correct...
I have used Linux for a long time and never seen any place where // is required in filenames.
If you accidentally try to use Windows style \ in filenames then you can get it trouble on Linux because it will "eat" the first one since \ is the escape character in most unix shells. So to get a real \ you need two \\.
Per se, Linux (as any other UNIX) does not need the double slash. Multiple dots in filenames are a UNIX staple since the beginning (1970s), and can be used as this code, run on SAS UE (which uses Linux), proves:
proc import
out=test
datafile="/folders/myfolders/test.01.xlsx"
dbms=xlsx
replace
;
run;
Log:
73 proc import 74 out=test 75 datafile="/folders/myfolders/test.01.xlsx" 76 dbms=xlsx 77 replace 78 ; 79 run; NOTE: Variable Name Change. Beob. -> Beob_ NOTE: One or more variables were converted because the data type is not supported by the V9 engine. For more details, run with options MSGLEVEL=I. NOTE: The import data set has 19 observations and 6 variables. NOTE: WORK.TEST data set was successfully created. NOTE: Verwendet wurde: PROZEDUR IMPORT - (Gesamtverarbeitungszeit): real time 0.04 seconds cpu time 0.02 seconds
So you had something else that caused your problem.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.