SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
CathyVI
Pyrite | Level 9

Hello,

Who can explain why an getting this error message and how to rectify it. Thanks

My code:

FILENAME REFFILE '/BUBD/BUBD_2021/MXM.xlsx';

PROC IMPORT DATAFILE=REFFILE
DBMS=XLSX
OUT=WORK.IMPORT REPLACE;
GETNAMES=YES;
RUN;

libname outdata "/_PTSU/FS_SAAH/PUD/Data/SASDS/MPOS_2021" Access = readonly;
run;

data outdata.MPOS_2021_alldata;
set work.import;
run;

CathyVI_0-1658763205857.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

FYI this would be code that is more optimally structured/named:

 

libname outdata "/_PTSU/FS_SAAH/PUD/Data/SASDS/MPOS_2021";

FILENAME MPOS '/BUBD/BUBD_2021/MXM.xlsx';

PROC IMPORT DATAFILE=MPOS
DBMS=XLSX
OUT=outdata.MPOS_2021_alldata REPLACE;
GETNAMES=YES;
RUN;

View solution in original post

4 REPLIES 4
Reeza
Super User
libname outdata "/_PTSU/FS_SAAH/PUD/Data/SASDS/MPOS_2021" Access = readonly;

Read only access is exactly that, read only. You cannot write to the library with this setting, remove it if you want to write to the library.

 


@CathyVI wrote:

Hello,

Who can explain why an getting this error message and how to rectify it. Thanks

My code:

FILENAME REFFILE '/BUBD/BUBD_2021/MXM.xlsx';

PROC IMPORT DATAFILE=REFFILE
DBMS=XLSX
OUT=WORK.IMPORT REPLACE;
GETNAMES=YES;
RUN;

libname outdata "/_PTSU/FS_SAAH/PUD/Data/SASDS/MPOS_2021" Access = readonly;
run;

data outdata.MPOS_2021_alldata;
set work.import;
run;

CathyVI_0-1658763205857.png

 


 

CathyVI
Pyrite | Level 9

@Reeza I removed the "Access=readonly" but I still have the issue.

CathyVI_0-1658764579109.png

 

ballardw
Super User

@CathyVI wrote:

@Reeza I removed the "Access=readonly" but I still have the issue.

CathyVI_0-1658764579109.png

 


Means that another permission system, such as your user ID, does not allow that which might be a SAS session setting, a setting for the particular file in that folder or that entire folder.

Reeza
Super User

FYI this would be code that is more optimally structured/named:

 

libname outdata "/_PTSU/FS_SAAH/PUD/Data/SASDS/MPOS_2021";

FILENAME MPOS '/BUBD/BUBD_2021/MXM.xlsx';

PROC IMPORT DATAFILE=MPOS
DBMS=XLSX
OUT=outdata.MPOS_2021_alldata REPLACE;
GETNAMES=YES;
RUN;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1020 views
  • 2 likes
  • 3 in conversation