Hello,
I am trying to export the sas table to text file. Running this code;
DATA _NULL_;
SET Final_Out;
FILE "C:\SDB\ADMISStest\TEST.txt"
LRECL=250 ;
PUT @1 E1010 $7. @8 E1012 $10. @18 E1013 $3. @21 E1014 $10.
@31 E101A $1. @32 E1008 $20. ;
run;
I created 'test' table in the area I want. And I have access that area.
But I have this error when I run this code;
ERROR: Insufficient authorization to access /app/config/Lev1/SASApp/C:\SDB\ADMISStest\TEST.txt.
Thank you,
So SAS is running on a (L)unix system. You can't access your local drives, you have to use a directory on the server, asking your local sas.-admins will most likely reveal an appropriate directory.
Hi @user24,
Give some more details on your environment. Seems like your SAS is running on UNIX/LINUX and your trying to send a file to your local drive. This is not possible because SAS doesn't know your area as it is running on a server some where else. Ask your admin if they have mapped a NAS drive in SAS, that can be mapped as network drive in your local machine and can be used to transfer files from NAS to Local.
Another alternate way is send files to your SAS server and then use WinSCP to transfer those files from server to local machine.
Hello,
If you're using SEG, right click in the program editor lets you select whicjh server to run the program on. There must be a "Select server" entry in the contextual menu (my SEG version is in french so the exact label may differ) where you can select "local".
The problem with that apporoach is that the local session won't see the server tables that need to be exported.
Either a shared resource or a utility like WinSCP to copy the resulting text file is needed.
@user24 wrote:
Hello,
I am trying to export the sas table to text file. Running this code;
DATA _NULL_;
SET Final_Out;
FILE "C:\SDB\ADMISStest\TEST.txt"
LRECL=250 ;
PUT @1 E1010 $7. @8 E1012 $10. @18 E1013 $3. @21 E1014 $10.
@31 E101A $1. @32 E1008 $20. ;
run;
I created 'test' table in the area I want. And I have access that area.
But I have this error when I run this code;
ERROR: Insufficient authorization to access /app/config/Lev1/SASApp/C:\SDB\ADMISStest\TEST.txt.
Thank you,
A very minor secondary consideration is that you do not need to create the output text file first. The code with a file statement as you are using it will create a file or replace an existing file without the use of the MOD option to modify an existing file.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: