03-30-2015 03:08 PM
I have a project which will need generate 20 files.
When I use base SAS 9.3, I can do it by the following codes
%let path=C:\Decision Support\Brown;
proc sql noprint;
select count(distinct LMES)
into : N
select distinct LMES
into :LMES1 - :LMES%left(&N)
%DO i=1 %to &N;
%DO i=1 %TO &N;
PROC EXPORT DATA=A&&LMES&i
DBMS=CSV REPLACE; RUN;
Can this be done in EG? or any other advanced alternatives provided by EG that I can work with?
Any input will help and thanks!
03-30-2015 03:38 PM
Well, you have the code, haven't you tested it?
If you got write access to the directory on the server, it should work.
If it works, why do you need any other means, are you not happy with the existing solution?
You can export data by using the export tasks. They act locally however. And if you need that macro logic, I suggest that you stick with what you got.
03-30-2015 04:07 PM
I did try running the codes in EG, but it always gave error msg. I guess it was server issue. The error msg is 'ERROR: Insufficient authorization to access /sas/sas94/config/Lev3/SASApp/C:......'.
If exporting files from EG 'Export', it will need some manual works - export files one by one. But I think it got to be a better way to export FILES in EG since it is a powerful tool.
Thanks you for your input. Hope EG will improve this soon.
03-30-2015 09:21 PM
This is one that comes up frequently with new Enterprise Guide users.
A key concept in EG is that although you are running EG on your windows desktop, the SAS software that is actually executing the SAS code may or may not be running on your desktop. Enterprise Guide is designed to work with SAS instances both on your desktop and on remote servers.
In your case, because you're receiving diagnostics with directory names that look like "/sas/sas94/config/Lev3/SASApp", I can tell you that your SAS code is running on a Unix server.
That means that i) you'll need to provide library and file references using Unix syntax instead of Windows and ii) you'll need to know what directory locations you can write to.
There should be a SAS administrator at your organization (who installed and supports all this stuff), and they should be able to provide advice about how the environment is set up.
03-30-2015 03:53 PM
If your code above works in Base SAS, then it should work fine submitted from EG as well.
By the way, EG provides point-and-click export capability, but it is obviously not as flexible as what you can achieve with code (your code above is a good example).