BookmarkSubscribeRSS Feed
user24
Obsidian | Level 7

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,

 

 

 

 

5 REPLIES 5
andreas_lds
Jade | Level 19

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.

SuryaKiran
Meteorite | Level 14

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.

Thanks,
Suryakiran
gamotte
Rhodochrosite | Level 12

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".

Kurt_Bremser
Super User

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.

ballardw
Super User

@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.

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
  • 5 replies
  • 2374 views
  • 1 like
  • 6 in conversation