BookmarkSubscribeRSS Feed
tommy81
Obsidian | Level 7

Hi

While trying to exceute the following command I`m getting the error below

FILENAME SALES PIPE "ls -tr /data/sharedall/cofeeds/comit/weekfeeds|tail -1";

ERROR: Insufficient authorization to access PIPE.

ERROR: Error in the FILENAME statement.

Bascially i`m trying to retrieve the file name of the last updated file in a folder from EG itself.

The code runs fine when I run SAS in command propmt(UNIX). Also it has failed in the scheduler LSF

Would be great if some experts  advice , if this error can be rectified or any other alternatives exist.

6 REPLIES 6
art297
Opal | Level 21

I'm not an expert on stored processes, but the two individuals responding to a similar question in the following thread are.  The thread may contain the info you are looking for:

http://communities.sas.com/thread/14572

RSB
Calcite | Level 5 RSB
Calcite | Level 5

Hi,

Though I recommend contacting Tech. Support for this . You may try this in SMC, since it has worked for me. Expand Server Manager -> SASAPP - > SASAPP - Logical Workspace Server . Right click on SASAPP - Workspace Server. Go to Options Tab -> Advanced Options -> Launch Properties - > Check Allow XCMD.

TriciaA
Calcite | Level 5

I have had more luck using this code

      systask command "<command>" wait status=my_name;

      %put &sysrc. &my_name; 

It does two things:

1 - It returns the output from UNIX.

2 - If &SYSRC does not equal 0 then I know my systask command is wrong.  If &my_name does not return a 0 then I know my Unix command was the issue.

I don't know if this will help you - but I have had various issues with using FILENAME with the PIPE.  So I started using systask command.  Here's a good SAS GloFo paper about the topic:

http://www.lexjansen.com/wuss/2009/cod/cod-walsh.pdf

This approach may help you isolate where the issue is.

Tricia

SAS BI Blog: http://www.bi-notes.com

Matt
Quartz | Level 8

By default SAS sets the NOXCMD option which restricts users to submit any OS level commands from their SAS sessions/codes. To resolve the issue, you need to ask your SAS admin to click the check box "Allow XCMD" within SAS Management Console -> Server Manager -> SAS App - Workspace Server -> properties -> Options ->Advanced Options -> Launch Properties tab.

 

Be aware that allowing XCMD would allow SAS users to submit and exceute pretty much ALL OS commands from their SAS sessions/codes and there is a high security risks.

 

Regards,

Matt

nhvdwalt
Barite | Level 11
I agree and not.

If your security model is tight, there should be no risks in letting users run OS commands. Also, by disallowing users to run OS commands, takes away the concept of self-service. Now IT lands up with requests like...zip this....rename this...delete that... blah... blah...

Empower your users....safely.
TomKari
Onyx | Level 15

And another bystander weighs in...

 

I think this is one of those issues that doesn't have a black or white solution.

 

I've been both an advanced developer and a SAS administrator, and have therefore had the chance to see the issue from both sides.

 

I will agree that in theory making "x" commands available doesn't open a security hole. On the other hand, it does expose what is supposed to be a purpose-acquired SAS server to running whatever programs users might want to spin up on it (and yes, I have seen this happen.) This can have implications for performance and reliability.

 

On the other hand, I have seen very valid requirements AS PART OF SAS PROCESSING to occasionally invoke O/S commands, using a facility such as the "x" command.

 

The key word here is "occasional". 85 percent of the requests relate to file processing. Another 10 percent relate to "zip" type functionality, which is more and more met from within SAS.

 

My considered response is that people who need file processing capabilities can do it with the SAS functions that process O/S files. They are very rich, and easy to use. I have yet to see a request come up that they can't satisfy. Yes, they require learning something new, but this is a SAS server; you ARE expected to use SAS on it.

 

Your particular example shouldn't take more than half an hour to an hour to implement using SAS tools (and believe me, I've done this kind of thing and more). Therefore, my response as a SAS administrator would be that you can meet your needs without enablement of the "x" command, so request denied.

 

Tom

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 6 replies
  • 14752 views
  • 3 likes
  • 7 in conversation