BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Doug____
Pyrite | Level 9

When I attempt to use the code below, I receive an insufficient authorization to access error the first time. But when ran a second time it processes with no errors. I applied ods listing close as other posts indicated, but  this does not help. Suggestions?

 

/* Show the current setting */
proc registry startat="CORE\PRINTING\PDF\DBCS" list;
run;

filename source 'temp.sasxreg';<<<<-this is where the error occurs

data _null_;
file source;
put '[CORE\PRINTING\PDF\DBCS]';
put ' "Searchable" = "Yes"';
run;

/* Change the SAS registry */
proc registry import=source; *usesashelp;
run;

/* Show the current setting */
proc registry startat="CORE\PRINTING\PDF\DBCS" list;
run;

1 ACCEPTED SOLUTION
4 REPLIES 4
Doug____
Pyrite | Level 9

Attempt #1

0 /******************************pdf formatting options*************************/
31 ods listing close;
32 /* Show the current setting */
33 proc registry startat="CORE\PRINTING\PDF\DBCS" list;
34 run;

NOTE: Contents of SASHELP REGISTRY starting at subkey [CORE\PRINTING\PDF\DBCS]
[ CORE\PRINTING\PDF\DBCS]
Searchable="No"
NOTE: Contents of SASUSER REGISTRY starting at subkey [CORE\PRINTING\PDF\DBCS]
[ CORE\PRINTING\PDF\DBCS]
Searchable="Yes"
NOTE: PROCEDURE REGISTRY used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds

35
36 filename source 'temp.sasxreg';
37
38 data _null_;
39 file source;
40 put '[CORE\PRINTING\PDF\DBCS]';
41 put ' "Searchable" = "Yes"';
42 run;

ERROR: Insufficient authorization to access I:\BIConfig\Lev1\SASApp\temp.sasxreg.
2 The SAS System Wednesday, April 1, 2020 09:42:00 AM

NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds

43
44 /* Change the SAS registry */
45 proc registry import=source; *usesashelp;
46 run;

NOTE: Parsing REG file and loading the registry please wait....
NOTE: Registry IMPORT is now complete.
NOTE: PROCEDURE REGISTRY used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds

47
48 /* Show the current setting */
49 proc registry startat="CORE\PRINTING\PDF\DBCS" list;
50 run;

NOTE: Contents of SASHELP REGISTRY starting at subkey [CORE\PRINTING\PDF\DBCS]
[ CORE\PRINTING\PDF\DBCS]
Searchable="No"
NOTE: Contents of SASUSER REGISTRY starting at subkey [CORE\PRINTING\PDF\DBCS]
[ CORE\PRINTING\PDF\DBCS]
Searchable="Yes"
NOTE: PROCEDURE REGISTRY used (Total process time):
real time 0.01 seconds
cpu time 0.03 seconds

 

Now I cannot replicate the issue with running it a second time. Your suggestion for using "temp" instead produced  no errors. As long as it does not cause issues in the SAS registry I'm good with that (see below):

Attempt #2 using work area instead:

29 /******************************pdf formatting options*************************/
30 ods listing close;
31 /* Show the current setting */
32 proc registry startat="CORE\PRINTING\PDF\DBCS" list;
33 run;

NOTE: Contents of SASHELP REGISTRY starting at subkey [CORE\PRINTING\PDF\DBCS]
[ CORE\PRINTING\PDF\DBCS]
Searchable="No"
NOTE: Contents of SASUSER REGISTRY starting at subkey [CORE\PRINTING\PDF\DBCS]
[ CORE\PRINTING\PDF\DBCS]
Searchable="Yes"
NOTE: PROCEDURE REGISTRY used (Total process time):
real time 0.01 seconds
cpu time 0.03 seconds

34
35 filename source 'temp';
36
37 data _null_;
38 file source;
39 put '[CORE\PRINTING\PDF\DBCS]';
40 put ' "Searchable" = "Yes"';
41 run;

NOTE: The file SOURCE is:
Filename=I:\BIConfig\Lev1\SASApp\temp,
2 The SAS System Wednesday, April 1, 2020 09:42:00 AM

RECFM=V,LRECL=32767,File Size (bytes)=0,
Last Modified=01Apr2020:09:47:37,
Create Time=01Apr2020:09:42:29

NOTE: 2 records were written to the file SOURCE.
The minimum record length was 21.
The maximum record length was 24.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.04 seconds

42
43 /* Change the SAS registry */
44 proc registry import=source; *usesashelp;
45 run;

NOTE: Parsing REG file and loading the registry please wait....
NOTE: Registry IMPORT is now complete.
NOTE: PROCEDURE REGISTRY used (Total process time):
real time 0.02 seconds
cpu time 0.03 seconds

46
47 /* Show the current setting */
48 proc registry startat="CORE\PRINTING\PDF\DBCS" list;
49 run;

NOTE: Contents of SASHELP REGISTRY starting at subkey [CORE\PRINTING\PDF\DBCS]
[ CORE\PRINTING\PDF\DBCS]
Searchable="No"
NOTE: Contents of SASUSER REGISTRY starting at subkey [CORE\PRINTING\PDF\DBCS]
[ CORE\PRINTING\PDF\DBCS]
Searchable="Yes"
NOTE: PROCEDURE REGISTRY used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds

 

 

Kurt_Bremser
Super User

As I expected, the ERROR does not occur at the filename statement, but when you try to write to the file reference.

The clue to the cause is this:

I:\BIConfig\Lev1\SASApp\temp.sasxreg

Since you did not give an absolute file path, starting at a drive letter, SAS tried to write the file in its Current Working Directory, which lies in the configuration tree and where you do not have write permissions.

Always supply an absolute path pointing to a location where you are allowed to write, or use a temporary file reference.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 4 replies
  • 898 views
  • 0 likes
  • 2 in conversation