You need to use an absolute pathname for your file, starting at root (/). Otherwise, SAS will try to write the file in its current working directory, where you do not have write permission (as it is part of the SAS configuration tree).
proc export data=Mgmt635.salary_summary outfile=salary_summary dbms=csv replace ; run;
The portion in red above is incorrect, it should be the full file path to where you want to save the file and the extension as well.
proc export data=Mgmt635.salary_summary
outfile='/home/reeza/demo/salary_summary.csv'
dbms=csv replace ;
run;
@emartinez204 wrote:
Hi,I am using SAS Studio to transform a SAS file to a CSV file. I am using SAS® OnDemand for Academics . Here is my code:proc export data=Mgmt635.salary_summary
outfile=salary_summary
dbms=csv replace ;
run;%let _DATAOUT_MIME_TYPE=csv/text;
%let _DATAOUT_NAME=salary_summary.csv;however when I run the program this is the error message I get when I run the program: ERROR: Insufficient authorization to access /pbr/biconfig/940/Lev1/SASApp/SALARY_SUMMARY.
I am trying to download the file to my macbook download folders and change the code to this:
proc export data=Mgmt635.salary_summary
outfile='users/elenamartinez/downloads/salary_summary.csv'
dbms=csv replace ;
run;
%let _DATAOUT_MIME_TYPE=csv/text;
%let _DATAOUT_NAME=salary_summary.csv;
Now I get this error: ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/users/elenamartinez/downloads/salary_summary.csv.
@emartinez204 wrote:
I am trying to download the file to my macbook download folders and change the code to this:
proc export data=Mgmt635.salary_summary
outfile='users/elenamartinez/downloads/salary_summary.csv'
dbms=csv replace ;
run;
%let _DATAOUT_MIME_TYPE=csv/text;
%let _DATAOUT_NAME=salary_summary.csv;Now I get this error: ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/users/elenamartinez/downloads/salary_summary.csv.
So you still didn't start with the root directory, / , so your path is still relative. This is how to specify a filename 101.
But I don't think SAS actually runs on a Macbook so how is it going to see the /user folder on your Macbook?
Where is SAS running? You need to write to a directory that the SAS program can see. You can then download to you Macbook, or use your Macbook to access it if your Macbook can also see that location, for example if you wrote it to a shared network location.
How are you running SAS? Are you using SAS/Studio interface? Are you running the SAS university edition? Running SAS on some Unix server? Perhaps one located in "the cloud"?
okay everyone! I got one of my classmates to help. She said to do this:
proc export data=mgmt635.salary_summary
outfile=_dataout
dbms=csv replace;
run;
%let _DATAOUT_MIME_TYPE=text/csv;
%let _DATAOUT_NAME=profit.csv;
Okay so outfile needs to be _dataout in order to be downloaded on computer.
Thank you for all who replied to me.
Reporting I suppose. The class is Data Analysis. I am learning to generate graphs, queries, tables and derive meaning from them. This is my first time using a program like SAS.
START AT ROOT! (/)
Your path needs to start with a forward slash.
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 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.