<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SASondemand : ERROR: Insufficient authorization to access PIPE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849292#M335780</link>
    <description>&lt;P&gt;The FILEEXIST function can be used instead of DIR.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Dec 2022 00:53:25 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2022-12-13T00:53:25Z</dc:date>
    <item>
      <title>SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849286#M335775</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I fix the &lt;/P&gt;
&lt;PRE id="pre_sasLog_52853" class="sasLog" style="background-color: transparent; -webkit-user-select: text; -webkit-user-modify: read-only; -webkit-touch-callout: default; border-top-width: 0px; border-bottom-width: 0px;"&gt; ERROR: Insufficient authorization to access PIPE.&lt;BR /&gt;&lt;BR /&gt;In the SASOndemand&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 00:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849286#M335775</guid>
      <dc:creator>ssafmed</dc:creator>
      <dc:date>2022-12-13T00:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849287#M335776</link>
      <description>&lt;P&gt;Best practice on this forum is any time you get an error that you supply the entire text from the log of the code submitted as well as the error messages related.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS On Demand runs on a server and I doubt that you have any permissions to run any program other than SAS on that server. Very likely anything the would use a PIPE would relate to either a program not loaded on the server, using data that may not be on the server or both. If the the file and program exist on your local, or another machine you have access to run programs that generate pipe output, then run the program on that machine with the output piped to a text file. Then upload the text file to SODA and read the text file there.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 00:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849287#M335776</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-12-13T00:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849289#M335778</link>
      <description>&lt;P&gt;SAS On Demand operates in a locked down mode where users are blocked from executing operating system commands. The FILENAME PIPE option requires OS command access so fails as you have found. There is no fix for this. OS command access is not allowed for security reasons.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 00:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849289#M335778</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-13T00:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849290#M335779</link>
      <description>&lt;P&gt;I upload files to SAS on Demand and are in the Directory home/Myname/Test&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code&lt;/P&gt;
&lt;P&gt;filename file1 pipe 'dir "/home/Myname/Test&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 00:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849290#M335779</guid>
      <dc:creator>ssafmed</dc:creator>
      <dc:date>2022-12-13T00:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849292#M335780</link>
      <description>&lt;P&gt;The FILEEXIST function can be used instead of DIR.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 00:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849292#M335780</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-13T00:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849293#M335781</link>
      <description>&lt;P&gt;Can you please give a code example with FILEEXIST function, I'm new in SAS :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code&lt;/P&gt;
&lt;P&gt;filename file1 pipe 'dir "/home/Myname/Test" ';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 01:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849293#M335781</guid>
      <dc:creator>ssafmed</dc:creator>
      <dc:date>2022-12-13T01:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849296#M335783</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  rc = fileexist('/home/Myname/Test.txt');
  if rc then put 'File exists';
  else put 'File does not exist';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Dec 2022 01:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849296#M335783</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-13T01:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849298#M335784</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;In fact what I need is to pipe every file in directory and then make some treatment using "infile"!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 01:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849298#M335784</guid>
      <dc:creator>ssafmed</dc:creator>
      <dc:date>2022-12-13T01:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849300#M335785</link>
      <description>&lt;P&gt;This SAS Note provides a way to do what you want in the Full Code tab:&amp;nbsp;&lt;A href="https://support.sas.com/kb/45/805.html" target="_blank"&gt;https://support.sas.com/kb/45/805.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 01:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849300#M335785</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-13T01:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849302#M335787</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use the note but still have the same problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;68&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;69 Filename filelist pipe "dir /b /s /home/ssafini0/TestRisk";&lt;/DIV&gt;
&lt;DIV id="sasLogError1_1670895429586" class="sasError"&gt;ERROR: Insufficient authorization to access PIPE.&lt;/DIV&gt;
&lt;DIV id="sasLogError2_1670895429586" class="sasError"&gt;ERROR: Error in the FILENAME statement.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;70&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;71 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;81&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Dec 2022 01:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849302#M335787</guid>
      <dc:creator>ssafmed</dc:creator>
      <dc:date>2022-12-13T01:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849303#M335788</link>
      <description>&lt;P&gt;Use the version in the Full Code tab like I mentioned:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro drive(dir,ext);                                                                                                                  
  %local filrf rc did memcnt name i;                                                                                                    
                                                                                                                                        
  /* Assigns a fileref to the directory and opens the directory */                                                           
  %let rc=%sysfunc(filename(filrf,&amp;amp;dir));                                                                                               
  %let did=%sysfunc(dopen(&amp;amp;filrf));                                                                                                     
                                                                                                                                        
  /* Make sure directory can be open */                                                                                                 
  %if &amp;amp;did eq 0 %then %do;                                                                                                              
   %put Directory &amp;amp;dir cannot be open or does not exist;                                                                                
   %return;                                                                                                                             
  %end;                                                                                                                                 
                                                                                                                                        
   /* Loops through entire directory */                                                                                                 
   %do i = 1 %to %sysfunc(dnum(&amp;amp;did));                                                                                                  
                                                                                                                                        
     /* Retrieve name of each file */                                                                                                   
     %let name=%qsysfunc(dread(&amp;amp;did,&amp;amp;i));                                                                                               
                                                                                                                                        
     /* Checks to see if the extension matches the parameter value */                                                                   
     /* If condition is true print the full name to the log        */                                                                   
      %if %qupcase(%qscan(&amp;amp;name,-1,.)) = %upcase(&amp;amp;ext) %then %do;                                                                       
        %put &amp;amp;dir\&amp;amp;name;                                                                                                                
      %end;                                                                                                                             
     /* If directory name call macro again */                                                                                           
      %else %if %qscan(&amp;amp;name,2,.) = %then %do;                                                                                          
        %drive(&amp;amp;dir\%unquote(&amp;amp;name),&amp;amp;ext)                                                                                               
      %end;                                                                                                                             
                                                                                                                                        
   %end;                                                                                                                                
                                                                                                                                        
  /* Closes the directory and clear the fileref */                                                                                      
  %let rc=%sysfunc(dclose(&amp;amp;did));                                                                                                       
  %let rc=%sysfunc(filename(filrf));                                                                                                    
                                                                                                                                        
%mend drive;                                                                                                                            
                                                                                                                                        
/* First parameter is the directory of where your files are stored. */                                                                  
/* Second parameter is the extension you are looking for.           */                                                                  
%drive(c:\temp,sas)     &lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 01:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849303#M335788</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-13T01:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849304#M335789</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/196305"&gt;@ssafmed&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Luckily there are also SAS only options available to get a directory listing that don't require OS commands.&lt;/P&gt;
&lt;P&gt;Below code doesn't cover traversing into sub-directories but this would also be possible to do - just more coding required.&lt;BR /&gt;Code below based on&amp;nbsp;&lt;A href="https://support.sas.com/kb/45/805.html" target="_blank"&gt;https://support.sas.com/kb/45/805.html&lt;/A&gt;&amp;nbsp;(full code tab).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path=c:\temp;
%let ext=txt;

data work.dir_list(drop=_:);
  retain path "&amp;amp;path";
  length fname $60;

  _rc=filename('_flist','c:\temp');
  _did=dopen('_flist');
  if _did = 0 then 
    do;
      put "Directory &amp;amp;path cannot be open or does not exist";
      stop;
    end;

  do _i=1 to dnum(_did);
    fname=dread(_did,_i);
    if not missing("&amp;amp;ext") then
      do;
        if upcase(scan(fname,-1,'.')) ne "%upcase(&amp;amp;ext)" then continue;
      end;
    output;
  end;

  _rc=dclose(_did);
  _rc=filename('_flist');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 02:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849304#M335789</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-12-13T02:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: SASondemand : ERROR: Insufficient authorization to access PIPE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849313#M335793</link>
      <description>&lt;P&gt;You have to use DOPEN() and DREAD() functions.&lt;/P&gt;
&lt;P&gt;There are examples of how to use them on the manual pages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or just download and use this &lt;A href="https://github.com/sasutils/macros/blob/master/dirtree.sas" target="_self"&gt;%dirtree()&lt;/A&gt; macro:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename dirtree url 'https://raw.githubusercontent.com/sasutils/macros/master/dirtree.sas';
%include dirtree;

%dirtree(/home/Myname/Test)
proc print data=dirtree;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Dec 2022 04:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SASondemand-ERROR-Insufficient-authorization-to-access-PIPE/m-p/849313#M335793</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-13T04:38:22Z</dc:date>
    </item>
  </channel>
</rss>

