Hello,
so I seem to get my macro program to work but I get this error of
Error: User does not have appropriate authorization level for library "name" ?
Followed by the error
Error: Error in the libname statement.
However when I look at my filepath it uses the the libname statement; it incudes the sas dataset and when I look at the security properties on the dateset (B:\Folder1\Folder2\dataset, it shows that I'm allowed to do everything to it except "Special Permission".
However, when I look at where the the folder that the dataset is in for example B:\Folder1\Folder2 it shows I dont have all the "allow" checks except on "special permission".
Could that cause an issue or be the source of my problem?
Please post the complete SAS log containing both the SAS statements and errors so we can see exactly what is happening.
MLOGIC(CKINPUT): Beginning execution.
MLOGIC(CKINPUT): %DO %UNTIL("&msg"="") loop beginning.
MLOGIC(CKINPUT): %DISPLAY statement beginning.
MLOGIC(ISBLANK): Beginning execution.
SYMBOLGEN: Macro variable DOC_PATH resolves to Y:\Folder1\Folder2\Folder3\Folder4\death,
MLOGIC(ISBLANK): Parameter PARAM has value Y:\Folder1\Folder2\Folder3\Folder4\death
MLOGIC(ISBLANK): Ending execution.
MLOGIC(ISBLANK): Beginning execution.
SYMBOLGEN: Macro variable OUT_PATH resolves to R:\File1\File2\File3\File4\output
MLOGIC(ISBLANK): Parameter PARAM has value R:\File1\File2\File3\File4\output
MLOGIC(ISBLANK): Ending execution.
MLOGIC(CKINPUT): %IF condition NOT ( %isBlank(%bquote(&doc_path)) | %isBlank(%bquote(&out_path))) is TRUE
MLOGIC(DIREXIST): Beginning execution.
SYMBOLGEN: Macro variable DOC_PATH resolves to Y:\Folder1\Folder2\Folder3\Folder4\death,
MLOGIC(DIREXIST): Parameter DIR has value Y:\Folder1\Folder2\Folder3\Folder4\death
ERROR: More positional parameters found than defined.
MLOGIC(DIREXIST): Ending execution.
MLOGIC(CKINPUT): %IF condition %DirExist(&doc_path)=0 is FALSE
SYMBOLGEN: Macro variable DOC_PATH resolves to Y:\Folder1\Folder2\Folder3\Folder4\death,
MPRINT(CKINPUT): libname d "Y:\Folder1\Folder2\Folder3\Folder4\death,";
ERROR: User does not have appropriate authorization level for library D.
ERROR: Error in the LIBNAME statement.
@rebelde52 wrote:
MLOGIC(CKINPUT): Beginning execution. MLOGIC(CKINPUT): %DO %UNTIL("&msg"="") loop beginning. MLOGIC(CKINPUT): %DISPLAY statement beginning. MLOGIC(ISBLANK): Beginning execution. SYMBOLGEN: Macro variable DOC_PATH resolves to Y:\Folder1\Folder2\Folder3\Folder4\death, MLOGIC(ISBLANK): Parameter PARAM has value Y:\Folder1\Folder2\Folder3\Folder4\death MLOGIC(ISBLANK): Ending execution. MLOGIC(ISBLANK): Beginning execution. SYMBOLGEN: Macro variable OUT_PATH resolves to R:\File1\File2\File3\File4\output MLOGIC(ISBLANK): Parameter PARAM has value R:\File1\File2\File3\File4\output MLOGIC(ISBLANK): Ending execution. MLOGIC(CKINPUT): %IF condition NOT ( %isBlank(%bquote(&doc_path)) | %isBlank(%bquote(&out_path))) is TRUE MLOGIC(DIREXIST): Beginning execution. SYMBOLGEN: Macro variable DOC_PATH resolves to Y:\Folder1\Folder2\Folder3\Folder4\death, MLOGIC(DIREXIST): Parameter DIR has value Y:\Folder1\Folder2\Folder3\Folder4\death ERROR: More positional parameters found than defined. MLOGIC(DIREXIST): Ending execution. MLOGIC(CKINPUT): %IF condition %DirExist(&doc_path)=0 is FALSE SYMBOLGEN: Macro variable DOC_PATH resolves to Y:\Folder1\Folder2\Folder3\Folder4\death, MPRINT(CKINPUT): libname d "Y:\Folder1\Folder2\Folder3\Folder4\death,"; ERROR: User does not have appropriate authorization level for library D. ERROR: Error in the LIBNAME statement.
Do you see the highlighted text in the Libname statement? There should not be any comma in the actual path. That comma is also the likely cause of the "more positional parameters" error. As mentioned in previous threads, commas likely do not belong in macro variables used as parameters for other macros.
Since there is very likely no actual folder "death ," that is also why you don't have permissions.
Thank you for the reply!
I had a feeling it was the comma. But have to enter that file path in a SAS Window User Interface and it looks like that it only works when I enter a comma in the file path. If I don't have a comma then it does not work. Do you know a work around for that?
@rebelde52 wrote:
Thank you for the reply!
I had a feeling it was the comma. But have to enter that file path in a SAS Window User Interface and it looks like that it only works when I enter a comma in the file path. If I don't have a comma then it does not work. Do you know a work around for that?
Then fix whatever is the mistake that that is not letting you enter the actual path.
If there actually is a comma in a directory name, get rid of it the day before yesterday. Blanks are bad enough, but a comma would simply be insane.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.