<?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: Macro variable get substr of other macro variable with condition about delimiter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875945#M346104</link>
    <description>&lt;P&gt;;-D&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2023 09:26:51 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2023-05-16T09:26:51Z</dc:date>
    <item>
      <title>Macro variable get substr of other macro variable with condition about delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875919#M346089</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;User define macro variable in structure&amp;nbsp; as following:&lt;/P&gt;
&lt;P&gt;1 or 2 digits number _4 digits number _&amp;nbsp; 4 digits number&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;P&gt;%let&amp;nbsp; X=59_2001_9901;&lt;/P&gt;
&lt;P&gt;%let&amp;nbsp; X=8_2001_9901;&lt;/P&gt;
&lt;P&gt;I want to create another macro variable called Y that is created automatically from macro variable X and get the digits of macro variable X&amp;nbsp; before the first underscore.&lt;/P&gt;
&lt;P&gt;So in the examples&amp;nbsp; :&lt;/P&gt;
&lt;P&gt;%let Y=59;&lt;/P&gt;
&lt;P&gt;%let Y=8;&lt;/P&gt;
&lt;P&gt;May you show code how to do it please?&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 05:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875919#M346089</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-05-16T05:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable get substr of other macro variable with condition about delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875925#M346092</link>
      <description>&lt;P&gt;Use the SCAN function, wrapped in %SYSFUNC:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let y = %sysfunc(scan(&amp;amp;x.,1,_));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 May 2023 06:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875925#M346092</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-05-16T06:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable get substr of other macro variable with condition about delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875932#M346099</link>
      <description>&lt;P&gt;Or even just:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;%let y = %scan(&amp;amp;x.,1,_);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[EDIT:] Link to the doc.&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1nhhymw6gxixvn1johcfl6kaygw.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1nhhymw6gxixvn1johcfl6kaygw.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 07:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875932#M346099</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-16T07:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable get substr of other macro variable with condition about delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875942#M346102</link>
      <description>&lt;P&gt;SIGNOTENOUGHCOFFEE &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 09:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875942#M346102</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-05-16T09:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable get substr of other macro variable with condition about delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875945#M346104</link>
      <description>&lt;P&gt;;-D&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 09:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875945#M346104</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-16T09:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable get substr of other macro variable with condition about delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875966#M346109</link>
      <description>&lt;P&gt;%let X=59_2001_9901;&lt;BR /&gt;%let Y=%sysfunc(scan(&amp;amp;X, 1, _));&lt;BR /&gt;%put Y=&amp;amp;Y;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let X=8_2001_9901;&lt;BR /&gt;%let Y=%sysfunc(scan(&amp;amp;X, 1, _));&lt;BR /&gt;%put Y=&amp;amp;Y;&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="u48512177_0-1684233698632.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84010i14D44D1C3820DB79/image-size/medium?v=v2&amp;amp;px=400" role="button" title="u48512177_0-1684233698632.png" alt="u48512177_0-1684233698632.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 10:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875966#M346109</guid>
      <dc:creator>u48512177</dc:creator>
      <dc:date>2023-05-16T10:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable get substr of other macro variable with condition about delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875967#M346110</link>
      <description>&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 10:39:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-get-substr-of-other-macro-variable-with-condition/m-p/875967#M346110</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-16T10:39:11Z</dc:date>
    </item>
  </channel>
</rss>

