10-12-2017 11:20 AM
I am running SAS at Linux, I wonder whether there is a way to output the SAS dataset at Linux to CSV files at Local computer or shared drive. Thank you!
10-12-2017 11:30 AM
Yes, exactly the same methods can be used to output CSV as with any other operating system - e.g. datastep, proc export, proc print etc.
CSV is just a text file with a delimiter of a comma, it is not Excel!!
10-12-2017 11:31 AM
Proc Export with DBMS=CSV should write anywhere you have write permissions from the Linux system. Or are you asking for a specific Data Integration approach?
10-19-2017 09:17 AM
I am trying the file transfer between PC and SAS server, it works for excel file. I am wondering whether there is some ways that work for CSV file.
Syntax work for excel file:
proc import datafile="C:\test.xlsx"
Any suggestion for similar coding works for CSV file? Thank you!
10-19-2017 09:25 AM
Should be exactly the same:
proc import datafile="c:\test.csv" out=work.test_server dbms=csv replace; server='********'; run;
Do note though that using proc import is not ideal as it will try to guess your data. Use a datastep and specify each column, type, length, how to read it etc.
data test_server; infile "c:\test.csv" dlm=","; length vara $10. ....; format vara $10 ...; informat vara $10 ...; input vara $ ...; run;
10-19-2017 09:32 AM
when I try the syntax of "proc import" with csv file, I got an error at the "server" statement said "ERROR 180-322: Statement is not valid or it is used out of proper order."
I wonder usually how people try to transfer csv file from PC to SAS grid server? Thank you!
I will try the data step too.
10-19-2017 09:45 AM
Ah, ok, I suppose that is PCFiles Server then. As the file is plain text you should be able to ftp it directly across - I would generally use ftp for transferring any file. Maybe check with your IT, because if you can access the file, then you should be able to link via network path to it and just access the file directly. PCFiles server is used where one of the systems does not have Office installed, so needs some a sort of Office translator server to process. CSV is plain text and doesn't need this.
10-19-2017 10:14 AM
Yes, you are right, There is PCFiles server installed on my PC, and I am trying to transfer files between PC and SAS grid server. Somehow the ftp is not allowed in our SAS server for security purpose, it's really not convenient when I try to output my SAS data to CSV files.
are there any other options other than the ftp?
10-19-2017 10:16 AM
Speak with your IT group, I can't tell without seeing the setup, should just be a networking mapping. Don't know why ftp isn't allowed, ftp is a secure file transfer protocol. But anyways to you should be able to read/write directly to areas.