Hi community,
I am using this code to
find out today's file and read that file into a dataset:
data _null_;
length dsnname $100;
today=put(today(),yymmdd7.);
dsnname = compress('c:\temp\'||today||'.txt');
file phold filevar=dsnname notitles;
put today;
run;
but getting this error: Insufficient authorization to access /sas/config/Lev1/SASApp/c:\temp\200416.txt
how to solve this I also want to add
'/folders/myfolders/sales.pdf'
but don't know where to add this.
my file format is OnlineUser20200416 but in the error it is showing 200416, please correct the date time format in this code too. I am using windows(EG sas)
Thanks in advance
Edited
Ok, so step by step:
1) Just to clarify, you are working on Linux/UNIX server, right?
2) you have a data set on your windows PC in folder: "c:\temp\" and the filename is "OnlineUser20200416.txt"
3) you want to read the file into a SAS dataset (if yes, what is the file structure)?
Bart
@annypanny wrote:
1. i am working on windows system.
3.yes
If you can show me a path like
/sas/config/Lev1/SASApp/
on any Windows system in production use, I will happily eat that broomstick over there (in German: "dann fress' ich einen Besen").
Your Enterprise Guide (or the browser with which you access SAS Studio) runs on Windows, but your SAS runs on a UNIX system.
PS this path
/sas/config/Lev1/SASApp/
is almost exactly the path to the default SASApp server context on our AIX server.
Hi,
I'm confused by your answers.
I see two options: either you elaborate about your issue in clearer way, or I won't be able to help you.
Bart
Since this is a continuation from https://communities.sas.com/t5/SAS-Programming/How-to-extract-an-external-file-into-a-sas-dataset-in..., I quote my answers from there:
You must always keep in mind that you work in a client/server environment. Code you run on the server (via SAS Studio or Enterprise Guide) has to use path names available on the server, and the syntax of the server's operating system.
Since your SAS server is obviously a UNIX system, you need to use the UNIX File System language. And point your file references to locations where you have the required permissions.
and
I cannot look into your server (if I could, I would either have the police knocking soon, or your IT people would all be fired), so you need to know where to put data in your system environment. Get help from your server administrators, they can tell you where to put data on the server (a good bet is always $HOME), and how to move the data from there to its final intended location.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.