<?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: Function Inside String in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323946#M71859</link>
    <description>&lt;P&gt;I'm not sure it's very simple.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you give examples of cell values and the desired outcome in SAS?&lt;/P&gt;
&lt;P&gt;Also, please describe why you are doing this.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2017 15:10:10 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2017-01-11T15:10:10Z</dc:date>
    <item>
      <title>Function Inside String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323942#M71856</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to use a function which returns a string as a part of another string, without declaring it before.&lt;/P&gt;&lt;P&gt;That's very easy but I don't know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's during an import from Excel:&lt;/P&gt;&lt;P&gt;sheet = "sheet_substrn(&amp;amp;datee.,max(1,length(&amp;amp;datee.)-3),4)"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't understand it need to replace the function with the value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for answer, and sorry for the basic question.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 15:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323942#M71856</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-01-11T15:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Function Inside String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323946#M71859</link>
      <description>&lt;P&gt;I'm not sure it's very simple.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you give examples of cell values and the desired outcome in SAS?&lt;/P&gt;
&lt;P&gt;Also, please describe why you are doing this.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 15:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323946#M71859</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-01-11T15:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Function Inside String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323952#M71862</link>
      <description>&lt;P&gt;You will need to switch from SAS language functions to macro language.&amp;nbsp; For some functions, such as LENGTH, there is already a macro version of the function available (%LENGTH).&amp;nbsp; But for others (SUBSTR, MAX), where there is no macro version of the function, you will need to apply %SYSFUNC to allow macro language to use the DATA step function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sheet = "sheet_&lt;STRONG&gt;&lt;FONT color="#993366"&gt;%sysfunc(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;substr(&lt;/FONT&gt;&amp;amp;datee.,&lt;STRONG&gt;&lt;FONT color="#339966"&gt;%sysfunc(&lt;/FONT&gt;&lt;/STRONG&gt;max(1,&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;%&lt;/FONT&gt;&lt;/STRONG&gt;length(&amp;amp;datee.)-3)&lt;STRONG&gt;&lt;FONT color="#339966"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;,4)&lt;STRONG&gt;&lt;FONT color="#993366"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#993366"&gt;&lt;FONT color="#000000"&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I got the parentheses in the right places.&amp;nbsp; Also note, macro language treats text as character, so&amp;nbsp;you can use SUBSTR instead of SUBSTRN.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 15:19:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323952#M71862</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-11T15:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: Function Inside String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323967#M71864</link>
      <description>&lt;P&gt;Thanks it works like this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 15:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323967#M71864</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-01-11T15:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Function Inside String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323969#M71865</link>
      <description>&lt;P&gt;Glad it works, but I may have overcomplicated this a bit.&amp;nbsp; Macro language does contain a %SUBSTR function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 15:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323969#M71865</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-11T15:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Function Inside String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323993#M71867</link>
      <description>&lt;P&gt;Yes that's a stange solution.&lt;/P&gt;&lt;P&gt;But it's ok if it works, I don't ask for more &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 16:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Function-Inside-String/m-p/323993#M71867</guid>
      <dc:creator>Planck</dc:creator>
      <dc:date>2017-01-11T16:32:01Z</dc:date>
    </item>
  </channel>
</rss>

