ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Nietzsche
Lapis Lazuli | Level 10

Hi I am reading page 349 of the specialist prep guide on ODS PDF. 

Nietzsche_0-1668919746422.png

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
Cynthia_sas
SAS Super FREQ
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

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ
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

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
  • 2 replies
  • 1289 views
  • 1 like
  • 3 in conversation