BookmarkSubscribeRSS Feed
SASJAG
Calcite | Level 5

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

 

1 REPLY 1
SASKiwi
PROC Star

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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 741 views
  • 0 likes
  • 2 in conversation