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
PROC Star

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
PROC Star

@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
Opal | Level 21

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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1731 views
  • 0 likes
  • 5 in conversation