<?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: finfo function to check owner in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940062#M369041</link>
    <description>&lt;P&gt;It looks like you can not get table owner information by FINFO.&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; said try PROC CONTENTS ,about other info you also could get them by PROC CONTENTS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname x 'c:\temp\a\';
ods select none;
ods output    Attributes=want1 EngineHost=want2;
proc contents data=x.have varnum;run;
ods select all;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1724138563038.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99453i1CD50A25FFCC1B48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1724138563038.png" alt="Ksharp_0-1724138563038.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2024 07:23:00 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-08-20T07:23:00Z</dc:date>
    <item>
      <title>finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940048#M369037</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to use&amp;nbsp;finfo function to gather some information about the data set ,for example: who created it (user name), date it was last modifies and so on&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I saw the following code but I need to adjust it.&lt;/P&gt;
&lt;P&gt;I have library name R_R&lt;/P&gt;
&lt;P&gt;and I have data set name&amp;nbsp;MACHZOR_TBL_SOFI&lt;/P&gt;
&lt;P&gt;In the code it is written differently as file path and library path&lt;/P&gt;
&lt;P&gt;filename fileref "J:\Tests.csv"; &lt;BR /&gt;filename filerefa "J:\Facilities.csv";&lt;/P&gt;
&lt;P&gt;What is the way to use the code by usine library name and data set name?&lt;/P&gt;
&lt;P&gt;Please note that library R_R path is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/usr/local/SAS/SASUsers/LabRet/Credit_Scoring_Users/R_R&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
filename fileref "J:\Tests.csv";  
filename filerefa "J:\Facilities.csv"; 
data a(drop=fidlab fidreg);                                                                                                                       
   infile fileref truncover obs=1;      
   infile filerefa truncover obs=1;    
   fidlab=fopen("fileref");
   fidreg=fopen("filerefa");
   moddatelab=input(finfo(fidlab,"Last Modified"),datetime.);
   moddatereg=input(finfo(fidreg,"Last Modified"),datetime.);
   crdatelab=input(finfo(fidlab,"Create Time"),datetime.);
   crdatereg=input(finfo(fidreg,"Create Time"),datetime.);
   labdate=datepart(max(moddatelab,crdatelab));
   regdate=datepart(max(moddatereg,crdatereg));
   format moddatelab moddatereg crdatelab crdatereg datetime. labdate regdate date9.;
   CALL SYMPUTX("labtime",put(labdate,date9.)) ;
   CALL SYMPUTX("regtime",put(regdate,date9.)) ; 
run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 04:03:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940048#M369037</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-08-20T04:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940056#M369038</link>
      <description>&lt;P&gt;Use the FOPTNUM and FOPTNAME functions to get tge names of the available FINFO items.&lt;/P&gt;
&lt;P&gt;UNIX does not have the concept of a "create time", BTW. Only the last modification is kept.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 06:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940056#M369038</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-08-20T06:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940057#M369039</link>
      <description>&lt;P&gt;The filename of your dataset file would be&lt;/P&gt;
&lt;PRE&gt;/usr/local/SAS/SASUsers/LabRet/Credit_Scoring_Users/R_R/machzor_tbl_sofi.sas7bdat&lt;/PRE&gt;
&lt;P&gt;The names of available FINFO items for the different platforms are documented here:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0cpuq4ew0dxipn1vtravlludjm7.htm" target="_blank" rel="noopener"&gt;FINFO Function&lt;/A&gt;&amp;nbsp;(Maxim 1)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 06:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940057#M369039</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-08-20T06:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940062#M369041</link>
      <description>&lt;P&gt;It looks like you can not get table owner information by FINFO.&lt;/P&gt;
&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; said try PROC CONTENTS ,about other info you also could get them by PROC CONTENTS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname x 'c:\temp\a\';
ods select none;
ods output    Attributes=want1 EngineHost=want2;
proc contents data=x.have varnum;run;
ods select all;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1724138563038.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99453i1CD50A25FFCC1B48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1724138563038.png" alt="Ksharp_0-1724138563038.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 07:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940062#M369041</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-08-20T07:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940199#M369068</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;What is the difference between&amp;nbsp;fileref and&amp;nbsp;&amp;nbsp;filerefa?&lt;/P&gt;
&lt;P&gt;As I understand the purpose of the function is to check information about specific file (for example: when created and so on).&lt;/P&gt;
&lt;P&gt;Why are there 2 files defined in the code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename fileref "J:\Tests.csv"; &lt;BR /&gt;filename filerefa "J:\Facilities.csv";&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 05:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940199#M369068</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-08-21T05:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940231#M369074</link>
      <description>&lt;P&gt;Read the code.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Where are the file references used?&lt;/LI&gt;
&lt;LI&gt;What do the functions do in which they are used as arguments? Maxim 1: Read the Documentation!&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 21 Aug 2024 09:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940231#M369074</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-08-21T09:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940442#M369134</link>
      <description>&lt;P&gt;FINFO does return the owner:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib "/home/kurt.bremser/mylib";

data mylib.class;
set sashelp.class;
run;

data properties;
length name value $30;
rc = filename("ds","/home/kurt.bremser/mylib/class.sas7bdat");
fid = fopen("ds");
if fid /* fopen was successfull, otherwise fid would be 0 */
then do;
  do i = 1 to foptnum(fid);
    name = foptname(fid,i);
    value = finfo(fid,name);
    output;
  end;
  rc = fclose(fid);
end;
rc = filename("ds");
keep name value;
run;

proc print data=properties noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(executed on SAS On Demand)&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;name	value
Dateiname	/home/kurt.bremser/mylib/class
Besitzername	kurt.bremser
Gruppenname	oda
Zugriffsberechtigung	-rw-r--r--
Zuletzt geändert	22. August 2024 12.09 Uhr
Dateigröße (Byte)	262144
&lt;/PRE&gt;
&lt;P&gt;Note that the names and the last modification time are locale-dependent, so it would be better to get a certain item by its number:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;value = finfo(fid,foptname(fid,i));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;i should be 2 for the owner.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 10:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940442#M369134</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-08-22T10:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940452#M369138</link>
      <description>&lt;P&gt;Operating system dependent. On a windows system running code pointing to a different file (obviously)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;name                 value

Filename             X:\Data\IPP\Data\hd6_2024.sas7
RECFM                V
LRECL                32767
File Size (bytes)    131072
Last Modified        07Jun2024:09:55:26
Create Time          13Feb2024:14:27:56
&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Aug 2024 13:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940452#M369138</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-08-22T13:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940554#M369163</link>
      <description>Kurt,&lt;BR /&gt;As  ballardw said, Windows OS is unable to  show it , unfortunately mine is Windows OS.</description>
      <pubDate>Fri, 23 Aug 2024 00:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940554#M369163</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-08-23T00:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: finfo function to check owner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940569#M369169</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Operating system dependent. On a windows system running code pointing to a different file (obviously)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;name                 value

Filename             X:\Data\IPP\Data\hd6_2024.sas7
RECFM                V
LRECL                32767
File Size (bytes)    131072
Last Modified        07Jun2024:09:55:26
Create Time          13Feb2024:14:27:56
&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well, CP/M never had the concept of an owner &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 06:25:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finfo-function-to-check-owner/m-p/940569#M369169</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-08-23T06:25:39Z</dc:date>
    </item>
  </channel>
</rss>

