<?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>ScottBass Tracker</title>
    <link>https://communities.sas.com/kntur85557/tracker</link>
    <description>ScottBass Tracker</description>
    <pubDate>Wed, 10 Jun 2026 14:15:00 GMT</pubDate>
    <dc:date>2026-06-10T14:15:00Z</dc:date>
    <item>
      <title>Re: How do I unsubscribe from a topic?</title>
      <link>https://communities.sas.com/t5/All-Things-Community/How-do-I-unsubscribe-from-a-topic/m-p/718053#M4457</link>
      <description>&lt;P&gt;Doh!&amp;nbsp; So I read your message, replied, went to my profile to find old notifications, which would quickly let me return to the topic in question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which of course refreshed my browser.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could swear I'd done that before, but in any case it's working now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScottBass_0-1612909643024.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54530i31D0792DBADEAD1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ScottBass_0-1612909643024.png" alt="ScottBass_0-1612909643024.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 22:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/How-do-I-unsubscribe-from-a-topic/m-p/718053#M4457</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2021-02-09T22:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I unsubscribe from a topic?</title>
      <link>https://communities.sas.com/t5/All-Things-Community/How-do-I-unsubscribe-from-a-topic/m-p/718049#M4455</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Always good to hear from you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I posted a reply, so that subscribed me.&amp;nbsp; The topic is actually solved, so I don't need to follow it anymore.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But can't see how to unsubscribe, which I've used in the past.&amp;nbsp; I like the forum UI upgrades but this may be a case of me reverting back to forum newbie (as far as UI) status! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 22:23:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/How-do-I-unsubscribe-from-a-topic/m-p/718049#M4455</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2021-02-09T22:23:42Z</dc:date>
    </item>
    <item>
      <title>How do I unsubscribe from a topic?</title>
      <link>https://communities.sas.com/t5/All-Things-Community/How-do-I-unsubscribe-from-a-topic/m-p/718039#M4453</link>
      <description>&lt;P&gt;Apologies if this has been asked before - I did search.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I unsubscribe from a topic?&amp;nbsp; I'm getting too many emails on this one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ScottBass_0-1612907525411.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54529iC5A3FDBFAC9E3414/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ScottBass_0-1612907525411.png" alt="ScottBass_0-1612907525411.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see Subscribe, but no Unsubscribe.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 21:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/How-do-I-unsubscribe-from-a-topic/m-p/718039#M4453</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2021-02-09T21:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to: Listing all the files in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-List-all-the-files-in-a-folder/m-p/717820#M222053</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/14488"&gt;@LittlesasMaster&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;You can also see an example from SAS Documentation , a dynamic way of doing this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=n0js70lrkxo6uvn1fl4a5aafnlgt.htm&amp;amp;locale=en" target="_self"&gt;A Macro which gets you Sub Dir and File Names&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro list_files(dir,ext);
%local filrf rc did memcnt name i;
%let rc=%sysfunc(filename(filrf,&amp;amp;dir));
%let did=%sysfunc(dopen(&amp;amp;filrf));

%if &amp;amp;did eq 0 %then %do; 
%put Directory &amp;amp;dir cannot be open or does not exist;
%return;
%end;

%do i = 1 %to %sysfunc(dnum(&amp;amp;did));

%let name=%qsysfunc(dread(&amp;amp;did,&amp;amp;i));

%if %qupcase(%qscan(&amp;amp;name,-1,.)) = %upcase(&amp;amp;ext) %then %do;
%put &amp;amp;dir\&amp;amp;name;
%end;
%else %if %qscan(&amp;amp;name,2,.) = %then %do; 
%list_files(&amp;amp;dir\&amp;amp;name,&amp;amp;ext)
%end;

%end;
%let rc=%sysfunc(dclose(&amp;amp;did));
%let rc=%sysfunc(filename(filrf));

%mend list_files;
%list_files(c:\temp,sas)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This macro looping would be orders of magnitude slower than using corresponding functions in a data step, although it does have the benefit of being recursive.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 09:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-List-all-the-files-in-a-folder/m-p/717820#M222053</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2021-02-09T09:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to: List all the files in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-List-all-the-files-in-a-folder/m-p/717817#M222050</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15174"&gt;@Peter_C&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi Kevin&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;My suggestion was only for readkng contents of the files. I wouldn't use it for file names&lt;/STRONG&gt;&lt;/FONT&gt;. However, with some scenarios (e.g. expecting only small files) your proposal works, but excludes empty files. I don't remember what happens for subfolders.&lt;BR /&gt;&lt;BR /&gt;Peter&amp;nbsp;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) If the red text above is correct, then your solution, while it works, isn't on topic.&amp;nbsp; Well, the code is on topic, just not your red text above. The subject was "List all the files in a folder".&lt;/P&gt;
&lt;P&gt;2) Even if the proposed code works, I just can't see how reading every line in a file just to get the filename is a good approach?&amp;nbsp; Sure, for small text files in a directory, it might even work faster than the SAS functions used in previous solutions - the data step is very fast at reading text files.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But put 100,000 1MB each XML or binary files in a directory and test the performance of the all the various solutions posted in this thread.&amp;nbsp; You don't know a priori the contents of the directory and can't assume its contents.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 09:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-List-all-the-files-in-a-folder/m-p/717817#M222050</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2021-02-09T09:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to improve performance in Data step where clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-improve-performance-in-Data-step-where-clause/m-p/693435#M211435</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/349066"&gt;@Learn_SAS1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;effective_from_dtm has values like DDMONYYYY:00:00:00.000.&lt;/P&gt;
&lt;P&gt;As I have observed most of the values has&amp;nbsp; 00 as time.&lt;/P&gt;
&lt;P&gt;Index, I have mentioned in my original post, effective_from_dtm has index and no other indexes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't create Index on that table as it is owned by other teams.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That data set is not sorted.&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You've got a source dataset with&amp;nbsp;&lt;SPAN&gt;322,596,778 records, and need to filter on start_from_dtm &amp;lt;= some_static_date &amp;lt;= start_to_dtm.&amp;nbsp; Typical SCD2 type filtering.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yet your source dataset doesn't have an index on that column.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Have you have explained the performance issue to your "other teams", requested an index be created on that column, and they refused?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That's going to be your best approach to improving the performance of this query.&amp;nbsp; Google how indexes work if you need further details.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you have the disk space to (as a proof-of-concept) create a copy of that dataset, create your own index on start_from_dtm start_to_dtm, then test the performance results?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you do, you may also want to test performance if the data is stored using the SPDE engine.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 08:47:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-improve-performance-in-Data-step-where-clause/m-p/693435#M211435</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-22T08:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using SAS to find a streak of occurrences within any seven day window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-SAS-to-find-a-streak-of-occurrences-within-any-seven-day/m-p/693429#M211429</link>
      <description>&lt;P&gt;I was thinking the same approach, but you beat me to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We often spend so much effort preventing an unwanted Cartesian product in a multi-table join, that we forget that a Cartesian product, usually with a table self-join, can be our friend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Having every row within a key combined with every other row within that key, then filtering as required, can be very powerful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt;&amp;nbsp; as long as the table isn't, say, 100M rows &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 08:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-SAS-to-find-a-streak-of-occurrences-within-any-seven-day/m-p/693429#M211429</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-22T08:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc transpose error with same name variable and exceeds 32 length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-error-with-same-name-variable-and-exceeds-32/m-p/693427#M211427</link>
      <description>&lt;P&gt;Post what you want your desired output to be, as a self-contained SAS datastep using datalines statement, posted using the "Insert SAS code" icon.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 08:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-transpose-error-with-same-name-variable-and-exceeds-32/m-p/693427#M211427</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-22T08:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: using rsubmit in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-rsubmit-in-a-loop/m-p/693423#M211423</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/68234"&gt;@Ullsokk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, that looks really interesting. I am running code om the current server. I basically want all programs to run at the same time, in different sessions.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My code runs SAS in batch mode, i.e. sas.exe -sysin myprogram.sas.&amp;nbsp; It uses the first SAS session as the "scripting engine" to launch multiple SAS sessions, and abort if upstream dependencies fail.&amp;nbsp; When I used it I had SAS DMS on the laptop, so the scripting engine ran in interactive mode, but the remaining sessions ran in batch.&amp;nbsp; As much as you can get batch on windows - there were a bunch of icons in the taskbar.&amp;nbsp; They don't run in "true" background as you can get with *nix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to run all programs at once, either modify the macro or simply set all programs to the same "level", i.e. all "1".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that more is not necessarily better; when I ran this on (an old) two core CPU laptop, running more than two programs at a time increased the total execution run time for all the programs.&amp;nbsp; YMMV.&amp;nbsp; So you may want to experiment with the max_threads setting.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 08:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-rsubmit-in-a-loop/m-p/693423#M211423</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-22T08:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: using rsubmit in a loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-rsubmit-in-a-loop/m-p/693370#M211394</link>
      <description>&lt;P&gt;I've only skimmed your post, so I may misunderstand what you're trying to do.&amp;nbsp; And I can't tell if you're using rsubmit to submit code on a remote server, or the current one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, have a look at&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/scottbass/SAS/blob/master/Macro/RunAll.sas" target="_blank"&gt;https://github.com/scottbass/SAS/blob/master/Macro/RunAll.sas&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://github.com/scottbass/SAS/blob/master/Macro/RunAll_ControlTable.sas" target="_blank"&gt;https://github.com/scottbass/SAS/blob/master/Macro/RunAll_ControlTable.sas&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps they will help with what you're trying to do?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 02:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-rsubmit-in-a-loop/m-p/693370#M211394</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-22T02:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Delete first word before first space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-first-word-before-first-space/m-p/693095#M211290</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/299342"&gt;@skavli&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi y'all i hope you're doing fine,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm working on a cars database and i'm having a little hard time extract name and surname of cars, my table looks like this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P class="lia-align-center"&gt;&lt;STRONG&gt;Brand&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;CITROEN C3 AIRCROSS&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;DS3 CROSSBACK E-TENSE&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;OPEL GRANDLAND X&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now i wanna create two variables one named Make ( for the brand name ) and the other Model (for the brand model), so far so good for the Make ( because it's the first string before the space ) so with this i've succeeded getting my Make&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Make = scan(brand,1,' ');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now it's a little bit harder to for the model i've had few ideas but none was effective, for my model variable i want everything after the first space, i thought first to ease the process use tranwrd function and replace all my spaces with a underscore but it replaces also the space in the end with underscore, for the substr function i need the position for each observation wich a little bit hard&amp;nbsp; since each observation is different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have any hint for me to make this work and all the strings after the first space please ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Edit your original post, using a SAS datastep with datalines statements to create your sample dataset.&amp;nbsp; Don't paste in a screenshot since if forces *us* to create *your* sample dataset.&amp;nbsp; Post using the "Insert SAS code" icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   length somevariable $200;
   somevariable='foo    bar blah';
run;

data want1;
   set have;
   length make $100 model $100;
   pos=index(somevariable,' ');
   if pos then do;
      make=substr(somevariable,1,pos);
      model=substr(somevariable,pos+1);
      model=strip(model);
   end;
run;

data want2;
   set have;
   length make $100 model $100;
   rx=prxparse('/(.*?) (.*)/o');
   if prxmatch(rx,somevariable) then do;
      make=prxposn(rx,1,somevariable);
      model=prxposn(rx,2,somevariable);
   end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Oct 2020 09:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-first-word-before-first-space/m-p/693095#M211290</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-21T09:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the variable causing duplication in my data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-variable-causing-duplication-in-my-dataset/m-p/693054#M211262</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  array A[500] A1-A500;
  do ID=1 to 10;
    if ID=5 then do; A55 = 2; output; end;
    output;
  end;
run;

data _null_;
  set HAVE;
  by ID;
  array ARR A1--A500;                        * index variables into an array;
  if first.ID &amp;amp; ^last.ID then do I=1 to 500; * duplicate found, fill lag values;
    ARR[I]=lag(ARR[I]);
  end;
  if ^first.ID;                              * keep repeated observation;
  do I=1 to dim(ARR);                        * seek different value(s)  ;
    if ARR[I] ne lag(ARR[I]) then putlog _N_= ID= ARR[I]=;
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;_N_=6 ID=5 A55=2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;  array ARR A1--A500;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;with&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;  array ARR &lt;EM&gt;2 variable names from your table (the double dash makes that easy, look it up)&lt;/EM&gt; ;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Untested, just a "thought experiment"...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=foo out=bar dupout=dups noduprecs;
   by key1 key2 key3 _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;also work?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 02:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-variable-causing-duplication-in-my-dataset/m-p/693054#M211262</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-21T02:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: call symput with conditional clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-with-conditional-clause/m-p/692450#M210965</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;IF NOT AVAILABLE IT SHOULD BE SHOWS IN NOT AVAILABLE IN LOG WINDOW AS PER THE IF ELSE CONDITION&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you're using SAS EG or DMS, read the doc on the data step debugger.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 08:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-with-conditional-clause/m-p/692450#M210965</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-19T08:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: call symput with conditional clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-with-conditional-clause/m-p/692449#M210964</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds;
set sashelp.cars;
if Make='volkswagan'  then call symput("Status",'Available');
else call symput("Status",'Not Avaialable');
run;
%put &amp;amp;Status.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;it shows wrong&amp;nbsp; output&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;WHAT OUTPUT ARE YOU EXPECTING?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 08:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-with-conditional-clause/m-p/692449#M210964</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-19T08:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create dummy variable for every single date during a period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-dummy-variable-for-every-single-date-during-a/m-p/692448#M210963</link>
      <description>&lt;P&gt;Post your code using the Insert SAS Code icon, as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12887"&gt;@ErikLund_Jensen&lt;/a&gt;&amp;nbsp;has done.&amp;nbsp; Unformatted SAS code, esp. when using datalines, sometimes fails when pasted into SAS.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 08:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-dummy-variable-for-every-single-date-during-a/m-p/692448#M210963</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-19T08:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the variable causing duplication in my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-variable-causing-duplication-in-my-dataset/m-p/692284#M210863</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13255"&gt;@jimbobob&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a dataset that is supposed to be unique by my variable called arrangement_key, however on occasion its not unique, that's easy to identify the records causing duplication, but scanning all the variables in those duplicate records trying to find the culprit variable(s) is a pain, my dataset has 500 columns, is there an easy way to spit out a dataset that contains the culprit variable(s) that are causing the duplication? thank you in advance for your help.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You don't say what process is causing the duplicate rows.&amp;nbsp; Is it a single table you're concerned about or the result of an SQL join (undesired Cartesian Product) across two or more tables?&amp;nbsp; If you KNOW that your table has non-unique keys, and is participating in a join, you should address this first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is SQL code that will identify duplicate keys, although it is functionally equivalent to SAS code previously posted:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table want as
   select key1, key2, key3, count(0) as count
   from have
   group by key1, key2, key3
   having count(0) &amp;gt; 1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can filter on the count column, looking for rows with &amp;gt; 2, &amp;gt; 3, &amp;gt; 4, etc. duplicates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this point I usually just "eyeball" the data, scrolling right and skimming for satellite (non-key) columns where the data changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, again, your first step is to ensure your source table keys are, in fact, keys.&amp;nbsp;&amp;nbsp;&lt;A href="https://www.google.com/search?q=what+is+a+key+column" target="_blank"&gt;https://www.google.com/search?q=what+is+a+key+column&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Oct 2020 07:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-variable-causing-duplication-in-my-dataset/m-p/692284#M210863</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-17T07:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691698#M210565</link>
      <description>&lt;P&gt;Thanks Mike.&amp;nbsp; I also realized after posting that my code doesn't account for a null &amp;amp;asics parameter, and would generate a syntactically incorrect where clause (my coding style changes).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you have a solution, I don't consider it worthwhile to modify my post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad you got it working.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 22:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691698#M210565</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-14T22:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress macro resolution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691686#M210558</link>
      <description>&lt;P&gt;So it looks like you've got a macro variable/parameter containing a list of where clause predicate suffixes, i.e. TZ T1 etc.&lt;/P&gt;
&lt;P&gt;And you're trying to build a where clause, looping over those tokens:&lt;/P&gt;
&lt;P&gt;cics like 'P%TZ' or cics like 'P%T1'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My macro library is located at&amp;nbsp;&lt;A href="https://github.com/scottbass/SAS/tree/master/Macro" target="_blank" rel="noopener"&gt;https://github.com/scottbass/SAS/tree/master/Macro&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want %loop, %squote, and %parmv.&amp;nbsp; If you don't want to use them, then use the code as a guide for your own macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would pull the AND operator out of the macro, so the macro contains just the loop construct, with the calling code containing the rest of the where clause syntax.&amp;nbsp; But that is just coding style.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, the simplest approach is just to temporarily set &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;option nomerror&lt;/STRONG&gt;&lt;/FONT&gt; to suppress warnings of unresolved macro references.&amp;nbsp; Of course, don't create %TZ or %T1 macros &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code then becomes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint nomerror;

%macro code;
%if (&amp;amp;__iter__ gt 1) %then or;
cics like %squote(P%&amp;amp;word)
%mend;

%let asics=TZ T1;

data foo;
   set sashelp.class (rename=(name=cics));
   where 1=1 and (%loop(&amp;amp;asics));
run;

* Alternative approach ;
%let where=1=1 and (%loop(&amp;amp;asics));

data foo;
   set sashelp.class (rename=(name=cics));
   where &amp;amp;where;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;29         %macro code;
30         %if (&amp;amp;__iter__ gt 1) %then or;
31         cics like %squote(P%&amp;amp;word)
32         %mend;
33         
34         %let asics=TZ T1;
35         
36         data foo;
37            set sashelp.class (rename=(name=cics));
38            where 1=1 and (%loop(&amp;amp;asics));
MPRINT(CODE):   cics like
MPRINT(SQUOTE):   'P%TZ'
MPRINT(CODE):   or cics like
MPRINT(SQUOTE):   'P%T1'
39         run;

NOTE: There were 0 observations read from the data set SASHELP.CLASS.
      WHERE (1=1) and (cics like 'P%TZ' or cics like 'P%T1');
2 The SAS System                                                                        08:18 Thursday, October 15, 2020

NOTE: The data set WORK.FOO has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              269.75k
      OS Memory           13092.00k
      Timestamp           15/10/2020 08:42:10 AM
      

40         
41         * Alternative approach ;
42         %let where=1=1 and (%loop(&amp;amp;asics));
43         
44         data foo;
45            set sashelp.class (rename=(name=cics));
46            where &amp;amp;where;
47         run;

NOTE: There were 0 observations read from the data set SASHELP.CLASS.
      WHERE (1=1) and (cics like 'P%TZ' or cics like 'P%T1');
NOTE: The data set WORK.FOO has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              269.62k
      OS Memory           13092.00k
      Timestamp           15/10/2020 08:42:10 AM&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course, this returns nothing using sashelp.class, but should be syntactically correct for your scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not meet your needs, please give details why so we can help further.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 21:48:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-suppress-macro-resolution/m-p/691686#M210558</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-14T21:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need alternative of "Filename" statement with Pipe operator for SAS University Edition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-List-all-the-files-in-a-folder/m-p/691455#M210461</link>
      <description>&lt;P&gt;Yet another approach...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/scottbass/SAS/blob/master/Macro/dirlist.sas" target="_blank"&gt;https://github.com/scottbass/SAS/blob/master/Macro/dirlist.sas&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 05:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-List-all-the-files-in-a-folder/m-p/691455#M210461</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-14T05:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Splitning one variable to multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Splitning-one-variable-to-multiple-variables/m-p/690880#M210203</link>
      <description>&lt;P&gt;1.&amp;nbsp; Format your SAS code using the "SAS Code" icon.&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; When I paste your code into SAS, the first data step doesn't give the correct results.&amp;nbsp; The second data step fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BZZZZZZZZZZZZZZZZZZZZZZZ!&amp;nbsp; Try again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.: Use the SCAN function and PROC TRANSPOSE (or an array - TRANSPOSE would be more flexible).&amp;nbsp; Read the doc for more details.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 04:23:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Splitning-one-variable-to-multiple-variables/m-p/690880#M210203</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2020-10-12T04:23:07Z</dc:date>
    </item>
  </channel>
</rss>

