Team ,
I have a code to read Excel file from Share Drive to SAS folder as SAS Data set but it's not working for CSV file , any suggestions on it.
Also on the share drive we will have a file name like this xxx_2021-19-05 (name with date every day) , how can we read only latest file using the same program.
libname TESTf '/test/';
run;
proc import datafile="\\abc999.cloud.me.org\abc\test_2021-05-19.CSV"
out=TESTf.xxx_date
DBMS=CSV REPLACE;
server="sasabc.xxx.me.org";
port=1234;
serveruser="12345";
serverpass="1234";
run;
server="sasabc.xxx.me.org";
______
180
32 port=1234;
____
180
33 serveruser="1234";
__________
180
34 serverpass="1234";
__________
180
Error :
ERROR 180-322: Statement is not valid or it is used out of proper order.
Appreciate any details on it.
Thanks
As you can see from the SAS log errors, PROC IMPORT does not support use of server logins and passwords when reading CSV files. If you are required to supply a user account and password then using FTP or SFTP is one alternative. That will copy the file to a local server and folder location where PROC IMPORT will work.
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!
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.