BookmarkSubscribeRSS Feed
dzhu
Calcite | Level 5

Hello everyone,

I am trying to export sas output to external csv file.

I am using the following lines:

proc export data=work.abcd_&today.

outfile="D:\ABCD\abcd_&today..csv"

dbms=csv;

run;

The log says:

NOTE: "D:\ABCD\abcd_20160415.csv" file was successfully created.

But there is no file generated in the predefined path.

What could be the problem and am I missing something?

Thanks in advance!

8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

What software are you running, is it SAS Universtiy Edition, Enterprise Guide etc.  Do you have write access to D:?  Does the drive mapped to 😧 within SAS reflect the 😧 drive you are looking at?  Are you on a mainframe?  Does the datset - which is used in the proc:

work.abcd_&today.

contain any observations?  I don't know what that macro variable resolves as.

dzhu
Calcite | Level 5

Thanks for the fast reply.

It is Enterprise Guide 4.3.I have a write access to D.The macro variable is returning the sysdate in yyyymmdd format.

The table has observations in it. I am using corporate computer.

About the mapping between D:\s I am not sure and I do not know how to check it...

Actually when I am exporting the table with the Export wizard, as a step in the process flow, everything works perfect.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Can you try it without the macro variables:

proc export data=work.abcd_20160415 outfile="D:\ABCD\abcd_20160415.csv" dbms=csv;

run;

 

It shouldn't make any difference, but if its working through menu export options I don;t see why it wouldn't.  Have you tried - I think its the last option on the export wizard - to save the code generated by the export wizard - you have two buttons to the lower right, one is finish the other is next and you can save the code.  Copy that code and run it in your project.

dzhu
Calcite | Level 5
I have replaced the macro vars with their outcome and it did not work.
Also, I can not find anything that looks like sas code in the export wizard...the only thing is "Export job Export successful to: D:\ABCD\abcd_20160415.csv" in the log of the export.
😕
Doc_Duke
Rhodochrosite | Level 12

Dzhu,

 

Is the SAS server a remote server or a local (on your desktop).  If remote, the 😧 drive there may be different from the one that you can see with Windows Explorer.

 

The export wizard operates within EGuide, but the PROCs excute within the server.

dzhu
Calcite | Level 5
It is a remote server.
How can I predefine the drive so I can use the one on my machine?
Doc_Duke
Rhodochrosite | Level 12

You probably can't.  Typically, corporate servers are set up to see shared network drives, but not drives on desktops or laptops.  Your IT support group may be able to configure it for you if you can make a sufficient business case to them.

dzhu
Calcite | Level 5

Thanks for the reply.

I will try to be as convincing as possible 🙂

Hope it will work.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 8 replies
  • 2402 views
  • 0 likes
  • 3 in conversation