Architecting, installing and maintaining your SAS environment

Download ODS PDF FILE from UNIX

Accepted Solution Solved
Reply
Contributor
Posts: 40
Accepted Solution

Download ODS PDF FILE from UNIX

[ Edited ]

Hello,

 

I have a user who is attempting to write out a pdf file to a shared network drive however he encountered this error:

 

ods pdf file="\\usflfsc0\osr$\Office Records\Users Shared\Will VanHove\Reports & SOPs\Resort Cluster RF Analysis\R...";

 

SAS CODE HERE

 

ODS PDF CLOSE;

 

But I get the following error:

ERROR: Insufficient authorization to access /mnt/SAS9.4/9.4/config/node1/Lev1/SASApp/\\usflfsc0\osr$\Office Records\Users

       Shared\Will VanHove\Reports & SOPs\Resort Cluster RF Analysis\Resort PDF Reports\test.pdf.

 

 

I am unable to grant him permission to /mnt/SAS9.4/9.4/config/node1/Lev1/SASApp/ because this area houses all the config files and accessed only by the SAS/Linux admins.

 

Thanks,

Sharda


Accepted Solutions
Solution
‎08-24-2016 03:43 PM
Community Manager
Posts: 2,955

Re: ODS PDF FILE

If there is not a shared network location that the user can write to on UNIX and then access from Windows, you might be able to adapt this approach: create the PDF on UNIX in a temp space, then use the Copy Files task to download to the PC. Here's a blog post that shows an example with a CSV file.

View solution in original post


All Replies
SAS Employee
Posts: 102

Re: ODS PDF FILE

It looks like your SAS Application Server is running on a UNIX machine.  The path you're specifying is a PC filesystem path, and SAS is prepending the path with the SAS Application Server directory location in the configuration directory because it's interpreting the PC filesystem path as a relative, rather than an absolute path.

 

I'd suggest specifying the output location as an absolute UNIX filesystem path to which the user has write access in the ods pdf file statement.

Contributor
Posts: 40

Re: ODS PDF FILE

Thank you however what is an example of how that path can be coded?

 

Sharda

Contributor
Posts: 40

Re: ODS PDF FILE

Btw, the PC file server has permission to write out to the shared network drive mentioned above however, the user needs the file to be a pdf and PC file server does not support this extension which is why he was using the ods pdf file.

 

To clarify, how can the user write out to the shared network drive?

 

Thanks,

Sharda

Solution
‎08-24-2016 03:43 PM
Community Manager
Posts: 2,955

Re: ODS PDF FILE

If there is not a shared network location that the user can write to on UNIX and then access from Windows, you might be able to adapt this approach: create the PDF on UNIX in a temp space, then use the Copy Files task to download to the PC. Here's a blog post that shows an example with a CSV file.

SAS Employee
Posts: 102

Re: ODS PDF FILE

Something simple would be:

 

ods pdf file="~/test.pdf";

 

This will place the test.pdf in the user's home directory on UNIX, to which they should have write access.  They'll need to transfer the file to the PC location.

 

Ideally, you'll have the PC file server location mounted up on UNIX so it can be accessed in both environments.  In that case, they'd need to point the ODS PDF FILE statement to the UNIX mountpoint corresponding to the PC file server.

 

 

Contributor
Posts: 40

Re: ODS PDF FILE

Ok, so the user did place the pdf file in a path similar to what you recommended and that worked. It seems as though there is no automated way (via code) to place the file from his directory in UNIX to the shared drive, is that correct?

Also, can you suggest how I can test the following:

* Check to see if the PC file server location is mounted up on UNIX so it can be accessed in both environments.

* point the ODS PDF FILE statement to the UNIX mountpoint corresponding to the PC file server. Maybe you have an example or link that references how to do this?

Thanks,
Sharda

SAS Employee
Posts: 102

Re: ODS PDF FILE

You'll need to talk with your system administrator for the UNIX machine running the workspace server to which the user is submitting their jobs.  They would be able to answer whether there are any shared filesystems between your PC and UNIX machines, inclusive of the one your user originally tried.  If so, they could provide the UNIX directory paths.

 

If you don't have access to a shared network location, you can try the alternate approach Chris provided in his post a few minutes ago.

Contributor
Posts: 40

Re: ODS PDF FILE

Thank you both....
Super User
Posts: 19,855

Re: ODS PDF FILE

If the server is set up to see the shared drive why can't the user point directly to the shared drive?

They would need to be using the appropriate file path for the server and a unix space.

 

ie 

 

//drive2/path to my shared direve/file.pdf

 

PC Files Server shouldn't come into play here at all, only where the server and user has access to from within the server.

Contributor
Posts: 40

Re: ODS PDF FILE

Hi Reeza,
Maybe I am missing something here but the user was referencing the appropriate file path:
\\usflfsc0\osr$\Office Records\Users Shared\Will VanHove\Reports & SOPs\Resort Cluster RF Analysis\Resort PDF Reports\test.pdf

What do you see is missing based on your example://drive2/path to my shared direve/file.pdf?
Thanks,
Sharda



Super User
Posts: 19,855

Re: ODS PDF FILE

Isn't that a Windows path? Though I don't think it matters to SAS what directions the slashes are, but the path needs to be relative to the Unix server.

 

I would confirm that from within EG the user had access to the path, if they can't navigate there to set up a library for instance they don't have access. 

 

Contributor
Posts: 40

Re: ODS PDF FILE

\\usflfsc0 is a unix server.
Super User
Posts: 19,855

Re: ODS PDF FILE

Tools>Assign Project Library

Try and assign a library to that path. If you can you should be able to write a PDF to the path.

 

Otherwise look into how to set up access to the path.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 13 replies
  • 895 views
  • 1 like
  • 4 in conversation