BookmarkSubscribeRSS Feed
gflowers
Calcite | Level 5

Hello,

 

I'm trying to export data as .txt (comma delimited) to a local machine using SAS EG.

 

A couple questions:

1) Is this even possible? While looking through the documentation, it seems that you can only specify the DBMS as Accesscs or Excelcs (link)  in order to export to a local machine. However, when I perform an export as .txt through the "Export file as step in project" it works fine.

2) Would you have to specify a Server_Name and Port_Number similar to an Excelcs export?

 

PROC EXPORT 
DATA=WORK.DISTRIBUTIONS
OUTFILE="<file path>"
DBMS=<?> REPLACE;
SERVER_NAME = "&serv_name";
PORT_NUMBER = 9621;
RUN;

Any help is appreciated. Thanks.

8 REPLIES 8
andreas_lds
Jade | Level 19

Exporting to your local machine is hardly possible when working in a client-server-environment, because the server has no write-access to your local drives.

 

To create a csv-file use dbms=csv.

 

Also note, that csv-files should never be opened with excel, as that application tends to "optimize" what it reads.

gflowers
Calcite | Level 5

Exporting is possible using PC Files Server and I can export Access and Excel files. Was just wondering if you could do that with .txt (or .csv). If no, then I can mark your reply as the solution.

andreas_lds
Jade | Level 19

@gflowers wrote:

Exporting is possible using PC Files Server and I can export Access and Excel files. Was just wondering if you could do that with .txt (or .csv). If no, then I can mark your reply as the solution.


Please share some information about the environment you are working in.

gflowers
Calcite | Level 5

SAS 9.4 for Windows 32-bit (build 9404.0.22712.15245)

Tom
Super User Tom
Super User

@gflowers wrote:

Exporting is possible using PC Files Server and I can export Access and Excel files. Was just wondering if you could do that with .txt (or .csv). If no, then I can mark your reply as the solution.


So you don't want to write to your local machine but to the machine that is running the PC Files Server?  I don't know the answer to that.

 

If you want to look at moving a file to your PC using Enterprise Guide you can look into the COPY FILES task.  I know you can use it to upload files to the SAS server, not sure if you can use it move files in the other direction.

gflowers
Calcite | Level 5

My local machine that runs SAS EG also runs PC Files Server. It allows me to export files to the local machine, rather than restricting me to just the eDAP server. Based on the confusion it sounds like there is some solution outside of the typical SAS capabilities that my company's IT team has implemented...

SASKiwi
PROC Star

What OS does your SAS servers run on? If its Windows Server then setting up network folder shares  for this type of scenario is very easy. It is a bit harder for Unix but is something your IT support people should be able to implement. 

Kurt_Bremser
Super User

The PC Files Server should be named "MS File Server", as it is designed specifically for Excel and Access, not for anything else.

To automatically export to a local text file with EG, use PROC EXPORT (or a DATA step) and the Copy Files task in EG.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 8 replies
  • 2736 views
  • 0 likes
  • 5 in conversation