<?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: LAST MODIFIED WITH FILENAME WHICH WE ARE EXPORTING in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/LAST-MODIFIED-WITH-FILENAME-WHICH-WE-ARE-EXPORTING/m-p/861660#M38077</link>
    <description>Thank you for your response &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/102238"&gt;@brzcol&lt;/a&gt; can you Please explain what does the code above is doing as I am unable to understand how can I inculcate the above code with my existing code.</description>
    <pubDate>Wed, 01 Mar 2023 06:51:42 GMT</pubDate>
    <dc:creator>Kirito1</dc:creator>
    <dc:date>2023-03-01T06:51:42Z</dc:date>
    <item>
      <title>LAST MODIFIED WITH FILENAME WHICH WE ARE EXPORTING</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LAST-MODIFIED-WITH-FILENAME-WHICH-WE-ARE-EXPORTING/m-p/861342#M38063</link>
      <description>&lt;P&gt;I was working on SAS and I was able to get todays date with the file name and number of records with it. Unfortunately, the user wants last modified date to be attached with filename.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly, help I have no Idea how to proceed. Although, I was reading and found the below link&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/40/934.html" target="_blank"&gt;https://support.sas.com/kb/40/934.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I think the link might help. If someone could provide a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 11:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LAST-MODIFIED-WITH-FILENAME-WHICH-WE-ARE-EXPORTING/m-p/861342#M38063</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-02-28T11:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: LAST MODIFIED WITH FILENAME WHICH WE ARE EXPORTING</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LAST-MODIFIED-WITH-FILENAME-WHICH-WE-ARE-EXPORTING/m-p/861537#M38073</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you just want the date included or you want both the date and time?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a possible solution to get you started based on the link you provided. There may be better alternatives. What this creates is an excel file called Tester_28Feb2023.&lt;/P&gt;
&lt;P&gt;Is that what you were looking for?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let exportpath=A:\examplefolder\output\Tester.xlsx;

filename fileref "&amp;amp;exportpath";                                                                                                          
data a(drop=fid);                                                                                                                       
   infile fileref truncover obs=1;                                                                                                       
   fid=fopen('fileref');                                                                                                                                                                                                                    
   moddate=scan(finfo(fid,'Last Modified'),1,':'); /*Just give the date portion instead of full date time*/
   call symputx('ModDate',Moddate); /*Create a macro variable called ModDate that holds the value of the variable created above*/
run; 

%put &amp;amp;ModDate; /*Make sure it looks right*/


proc export data=sashelp.class dbms=xlsx outfile="A:\examplefolder\output\Tester_&amp;amp;ModDate..xlsx" replace;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 18:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LAST-MODIFIED-WITH-FILENAME-WHICH-WE-ARE-EXPORTING/m-p/861537#M38073</guid>
      <dc:creator>brzcol</dc:creator>
      <dc:date>2023-02-28T18:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: LAST MODIFIED WITH FILENAME WHICH WE ARE EXPORTING</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LAST-MODIFIED-WITH-FILENAME-WHICH-WE-ARE-EXPORTING/m-p/861567#M38074</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I was working on SAS and I was able to get todays date with the file name and number of records with it. Unfortunately, the user wants last modified date to be attached with filename.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly, help I have no Idea how to proceed. Although, I was reading and found the below link&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/40/934.html" target="_blank" rel="noopener"&gt;https://support.sas.com/kb/40/934.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I think the link might help. If someone could provide a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Last modified for the file created? Or for the SAS data set?&lt;/P&gt;
&lt;P&gt;If the SAS data set you can consult the SAS metadata. This is just one way. The Dictionary.Tables special view contains the names, types and some of the characteristics, such as number of observations, creation date and modification date. The Libname and Memname (date set name) are stored in upper case letters. The SQL INTO allows selecting the values into macro variables as about the shortest code.&lt;/P&gt;
&lt;PRE&gt;data work.newjunk;
   x=3;
run;


proc sql noprint; 
   select strip(put(nobs,best12. -L)), put(datepart(modate),date9.) into: Numobs , : Moddate
   from dictionary.tables
   where libname='WORK' and memname='NEWJUNK'
   ;
quit;

%put number of obs is: &amp;amp;Numobs., Modification Date is: &amp;amp;Moddate. ;

&lt;/PRE&gt;
&lt;P&gt;Use the &amp;amp;numobs and &amp;amp;Moddate in your file name.&lt;/P&gt;
&lt;P&gt;Still think you should use the YYMMDDN8. format instead of Date9. though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 19:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LAST-MODIFIED-WITH-FILENAME-WHICH-WE-ARE-EXPORTING/m-p/861567#M38074</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-02-28T19:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: LAST MODIFIED WITH FILENAME WHICH WE ARE EXPORTING</title>
      <link>https://communities.sas.com/t5/New-SAS-User/LAST-MODIFIED-WITH-FILENAME-WHICH-WE-ARE-EXPORTING/m-p/861660#M38077</link>
      <description>Thank you for your response &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/102238"&gt;@brzcol&lt;/a&gt; can you Please explain what does the code above is doing as I am unable to understand how can I inculcate the above code with my existing code.</description>
      <pubDate>Wed, 01 Mar 2023 06:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/LAST-MODIFIED-WITH-FILENAME-WHICH-WE-ARE-EXPORTING/m-p/861660#M38077</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2023-03-01T06:51:42Z</dc:date>
    </item>
  </channel>
</rss>

