☑ This topic is solved.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 11-19-2022 11:55 PM
(1288 views)
Hi I am reading page 349 of the specialist prep guide on ODS PDF.
when I ran the code in the book
ods html close; ods pdf file="SamplePDF"; proc freq data=sashelp.cars; tables origin*type; run; ods pdf close;
, I got
ERROR: Insufficient authorization to access /pbr/biconfig/940/Lev1/SASApp/SamplePDF.
log.
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; NOTE: ODS statements in the SAS Studio environment may disable some output features. 71 72 ods html close; 73 ods pdf file="SamplePDF"; NOTE: Writing ODS PDF output to DISK destination "/pbr/biconfig/940/Lev1/SASApp/SamplePDF", printer "PDF". 74 proc freq data=sashelp.cars; 75 tables origin*type; 76 run; NOTE: There were 428 observations read from the data set SASHELP.CARS. NOTE: PROCEDURE FREQ used (Total process time): real time 0.08 seconds user cpu time 0.08 seconds system cpu time 0.00 seconds memory 4414.00k OS Memory 36272.00k Timestamp 20/11/2022 04:49:30 AM Step Count 60 Switch Count 4 Page Faults 0 Page Reclaims 831 Page Swaps 0 Voluntary Context Switches 21 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 544 77 ods pdf close; ERROR: Insufficient authorization to access /pbr/biconfig/940/Lev1/SASApp/SamplePDF. 78 79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 90
I later figure it out that I need to specify the path pathway to a folder in the ODS PDF statement, and I also need to include .pdf extension, otherwise the output file will be a generic file.
ods pdf file='/home/u62043935/Specialist_Prep_Guide/cert/SamplePDF.pdf';
So how come the code in the book does not need to
1. specify a path and
2. does not have the .pdf extension?
SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
On many operating systems, the default location for saving ODS output is a write access folder or directly location that is available without specifying the entire path. In your example, it appears that you were writing to a SAS OnDemand or BI Lev1 server folder, which is a shared server and that /pbr/config location that is prepended to your file name is a default server folder to which your session does not have write privileges. Using the "full control" method of specifying the path and the filename/file extension is the best way to avoid the insufficient authorization error when you're working on a server.
The example in the book was using a shortcut by not specifying the PDF file extension. Although this can work, it may cause you to get prompted for what application is needed to open the file when you double click on the file name. I prefer to always use the full path and file name/file extension to avoid confusion. What they show in the book will work, but not in all various configurations of using SAS (local, client-server, etc) as you discovered, but the full control method will always work. It's useful to know both methods and know that you can adapt your code or modify legacy code appropriately for how and where the code is being run.
Cynthia
On many operating systems, the default location for saving ODS output is a write access folder or directly location that is available without specifying the entire path. In your example, it appears that you were writing to a SAS OnDemand or BI Lev1 server folder, which is a shared server and that /pbr/config location that is prepended to your file name is a default server folder to which your session does not have write privileges. Using the "full control" method of specifying the path and the filename/file extension is the best way to avoid the insufficient authorization error when you're working on a server.
The example in the book was using a shortcut by not specifying the PDF file extension. Although this can work, it may cause you to get prompted for what application is needed to open the file when you double click on the file name. I prefer to always use the full path and file name/file extension to avoid confusion. What they show in the book will work, but not in all various configurations of using SAS (local, client-server, etc) as you discovered, but the full control method will always work. It's useful to know both methods and know that you can adapt your code or modify legacy code appropriately for how and where the code is being run.
Cynthia
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The code example is generic; path names need to be adapted to your specific environment (UNIX/Windows/whatever, client/server or local).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
On many operating systems, the default location for saving ODS output is a write access folder or directly location that is available without specifying the entire path. In your example, it appears that you were writing to a SAS OnDemand or BI Lev1 server folder, which is a shared server and that /pbr/config location that is prepended to your file name is a default server folder to which your session does not have write privileges. Using the "full control" method of specifying the path and the filename/file extension is the best way to avoid the insufficient authorization error when you're working on a server.
The example in the book was using a shortcut by not specifying the PDF file extension. Although this can work, it may cause you to get prompted for what application is needed to open the file when you double click on the file name. I prefer to always use the full path and file name/file extension to avoid confusion. What they show in the book will work, but not in all various configurations of using SAS (local, client-server, etc) as you discovered, but the full control method will always work. It's useful to know both methods and know that you can adapt your code or modify legacy code appropriately for how and where the code is being run.
Cynthia
On many operating systems, the default location for saving ODS output is a write access folder or directly location that is available without specifying the entire path. In your example, it appears that you were writing to a SAS OnDemand or BI Lev1 server folder, which is a shared server and that /pbr/config location that is prepended to your file name is a default server folder to which your session does not have write privileges. Using the "full control" method of specifying the path and the filename/file extension is the best way to avoid the insufficient authorization error when you're working on a server.
The example in the book was using a shortcut by not specifying the PDF file extension. Although this can work, it may cause you to get prompted for what application is needed to open the file when you double click on the file name. I prefer to always use the full path and file name/file extension to avoid confusion. What they show in the book will work, but not in all various configurations of using SAS (local, client-server, etc) as you discovered, but the full control method will always work. It's useful to know both methods and know that you can adapt your code or modify legacy code appropriately for how and where the code is being run.
Cynthia