<?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: proc cas file exists function? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-cas-file-exists-function/m-p/836442#M330714</link>
    <description>&lt;P&gt;I think fileInfo can be used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;caslib myCaslib datasource=(srctype="path") path="&amp;amp;path";&lt;BR /&gt;
proc cas;
   table.fileInfo result=r / caslib="myCaslib";
   filelist = r.FileInfo[,"Name"];
   if (filelist == "my_file.txt") then print "my_file.txt exists";
quit;&lt;/PRE&gt;</description>
    <pubDate>Sun, 02 Oct 2022 21:59:46 GMT</pubDate>
    <dc:creator>DerylHollick</dc:creator>
    <dc:date>2022-10-02T21:59:46Z</dc:date>
    <item>
      <title>proc cas file exists function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-cas-file-exists-function/m-p/833607#M329550</link>
      <description>&lt;P&gt;I am looking for the sibling of the tableExists function...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If file exists, but it's not as straightforward as I thought.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let casy=FSVBALA_&amp;amp;fc._OUTLIER;
%let liby=risknoba;

cas mysession sessopts=(caslib="&amp;amp;liby");
proc cas;        
    table.tableExists result=e status=rc / 
        caslib = "&amp;amp;liby"
        name   = "&amp;amp;casy"
    ;
    /* If the data exists, set dataExists = 1 and grab the current report data */
    if(e.exists = 0) then do;
     table.loadtable / path="&amp;amp;casy..sashdat" casOut="&amp;amp;casy" caslib="&amp;amp;liby"; 
     table.promote /name="&amp;amp;casy" ;
print "hello";
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Sep 2022 14:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-cas-file-exists-function/m-p/833607#M329550</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2022-09-15T14:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: proc cas file exists function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-cas-file-exists-function/m-p/836442#M330714</link>
      <description>&lt;P&gt;I think fileInfo can be used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;caslib myCaslib datasource=(srctype="path") path="&amp;amp;path";&lt;BR /&gt;
proc cas;
   table.fileInfo result=r / caslib="myCaslib";
   filelist = r.FileInfo[,"Name"];
   if (filelist == "my_file.txt") then print "my_file.txt exists";
quit;&lt;/PRE&gt;</description>
      <pubDate>Sun, 02 Oct 2022 21:59:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-cas-file-exists-function/m-p/836442#M330714</guid>
      <dc:creator>DerylHollick</dc:creator>
      <dc:date>2022-10-02T21:59:46Z</dc:date>
    </item>
  </channel>
</rss>

