<?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: Keep only part of a symput address path stationary in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keep-only-part-of-a-symput-address-path-stationary/m-p/876477#M346267</link>
    <description>&lt;P&gt;You can scan your operating system for the folder/path name. The exact instructions depend on what operating system you are using.&lt;/P&gt;</description>
    <pubDate>Thu, 18 May 2023 14:56:47 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-05-18T14:56:47Z</dc:date>
    <item>
      <title>Keep only part of a symput address path stationary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-only-part-of-a-symput-address-path-stationary/m-p/876471#M346265</link>
      <description>&lt;P&gt;I have a daily symput address path that I get from another team, the only changes to this path is the current day.&amp;nbsp; For example the name of this path is ABC_202305150700 and the next day it's ABC_202305160700, and so on every day - so I can hardcode the input path as ABC_&lt;STRONG&gt;TODAYSDATE&lt;/STRONG&gt;0&lt;FONT color="#FF0000"&gt;700&lt;/FONT&gt;.&amp;nbsp; However, the team that sends this file sometimes randomly changes the name to ABC_&lt;STRONG&gt;TODAYSDATE&lt;/STRONG&gt;0&lt;FONT color="#FF0000"&gt;701&lt;/FONT&gt;, and they don't know why this is happening.&amp;nbsp; Is there a way I can read this file and omit the last 4 digits of the path.. so if the name randomly changes it doesn't affect my input path address name?&amp;nbsp; Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 14:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-only-part-of-a-symput-address-path-stationary/m-p/876471#M346265</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2023-05-18T14:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Keep only part of a symput address path stationary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-only-part-of-a-symput-address-path-stationary/m-p/876477#M346267</link>
      <description>&lt;P&gt;You can scan your operating system for the folder/path name. The exact instructions depend on what operating system you are using.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 14:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-only-part-of-a-symput-address-path-stationary/m-p/876477#M346267</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-18T14:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Keep only part of a symput address path stationary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-only-part-of-a-symput-address-path-stationary/m-p/876487#M346272</link>
      <description>&lt;P&gt;Looks like the last 4 digits represent the hour and minute.&amp;nbsp; So one some days there is a delay and the job doesn't run until 7:01 am instead at 7 am.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is probably best if you get the list of filenames and then decide which one you want to read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have XCMD option enabled you can just use a PIPE to run the operating system command to list the file names and read the output.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data files ;
  infile 'ls -d /path_where_files_live/ABC_*'  pipe truncover;
  input filename $256. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Otherwise use some tool like&amp;nbsp;&lt;A href="https://github.com/sasutils/macros/blob/master/dirtree.sas" target="_blank" rel="noopener"&gt;https://github.com/sasutils/macros/blob/master/dirtree.sas&lt;/A&gt;&amp;nbsp;that use SAS functions to read the filenames.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could then find the filename with a DATE part of its name that matches today.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data todays_file;
  set files;
  date = input(substr(scan(filename,-1,'/'),5,??yymmdd8.);
  time = input(substr(scan(filename,-1,'/'),13,??hhmmss4.);
  format date yymmdd10. time tod5. ;
  if date=today();
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now use that filename in your code. Either directly or by using CALL SYMPUTX() to create a macro variable you could reference in the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 15:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-only-part-of-a-symput-address-path-stationary/m-p/876487#M346272</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-18T15:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Keep only part of a symput address path stationary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-only-part-of-a-symput-address-path-stationary/m-p/876491#M346275</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1797"&gt;@podarum&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a daily symput address path that I get from another team, the only changes to this path is the current day.&amp;nbsp; For example the name of this path is ABC_20230550700 and the next day it's ABC_202305160700, and so on every day - so I can hardcode the input path as ABC_&lt;STRONG&gt;TODAYSDATE&lt;/STRONG&gt;0&lt;FONT color="#FF0000"&gt;700&lt;/FONT&gt;.&amp;nbsp; However, the team that sends this file sometimes randomly changes the name to ABC_&lt;STRONG&gt;TODAYSDATE&lt;/STRONG&gt;0&lt;FONT color="#FF0000"&gt;701&lt;/FONT&gt;,&lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt; and they don't know why this is happenin&lt;/STRONG&gt;&lt;STRONG&gt;g&lt;/STRONG&gt;&lt;/FONT&gt;.&amp;nbsp; Is there a way I can read this file and omit the last 4 digits of the path.. so if the name randomly changes it doesn't affect my input path address name?&amp;nbsp; Thank you&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Really, they can't read the code that assigns the value? Any bet they are pulling something from a clock and rounding? Sometimes the process takes just a tiny bit longer and rounds up to one more minute? I think the first time I saw values behave like this involved tape reading/writing in 1987 or so...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe someone needs and introduction to a truncation function instead of a rounding function? If you don't have multiple files generated in a day then why do they bother appending something that looks very likely to be a TIME value? The system should be keeping track of such when needed.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 15:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-only-part-of-a-symput-address-path-stationary/m-p/876491#M346275</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-18T15:26:06Z</dc:date>
    </item>
  </channel>
</rss>

