<?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: usage of SUBSTR function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302314#M64128</link>
    <description>&lt;P&gt;Thank you and all others who responded to my query. Since, I don't have SAS compiler facility readily, I posted these queires. Please excuse me if it is an offence.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Oct 2016 11:55:05 GMT</pubDate>
    <dc:creator>SudheerAnkem</dc:creator>
    <dc:date>2016-10-04T11:55:05Z</dc:date>
    <item>
      <title>usage of SUBSTR function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302292#M64111</link>
      <description>&lt;P&gt;what is the result of the below statement, if CUR_VAL_DTE = "200160930"&amp;nbsp; and fixmmyy = 0129&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;beg_date = SUBSTR(&amp;amp;CUR_VAL_DTE,2,4)&amp;amp;fixmmyy;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 10:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302292#M64111</guid>
      <dc:creator>SudheerAnkem</dc:creator>
      <dc:date>2016-10-04T10:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: usage of SUBSTR function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302296#M64115</link>
      <description>&lt;P&gt;An error, it's invalid SAS code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 10:23:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302296#M64115</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-04T10:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: usage of SUBSTR function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302299#M64118</link>
      <description>&lt;P&gt;As per your other post some minutes back, the macro variable gets replaced with the text you specify, then that gets passed into the SAS compiler, which throws an error as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;&amp;nbsp;has mentioned.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;beg_date = SUBSTR("200160930",2,4)0129;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest looking through the manual at each function you need explanation on. &amp;nbsp;Then with the code you have replace the&lt;/P&gt;
&lt;P&gt;&amp;amp;&amp;lt;variable&amp;gt;&lt;/P&gt;
&lt;P&gt;With the text you give. &amp;nbsp;Then check that it looks like valid SAS code. &amp;nbsp;Macro only generates text, Base SAS is the language.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 10:31:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302299#M64118</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-04T10:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: usage of SUBSTR function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302303#M64121</link>
      <description>&lt;P&gt;Why it is an invalid SAS code? text should not be attached with quates. I mean, "200160930" is a string and 2,4 takes the string starting for the 2nd character (i.e. 2) and a length of 4 bytes. so it could be 20016. Please correct me&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 10:46:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302303#M64121</guid>
      <dc:creator>SudheerAnkem</dc:creator>
      <dc:date>2016-10-04T10:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: usage of SUBSTR function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302306#M64123</link>
      <description>&lt;P&gt;&lt;SPAN&gt;beg_date = substr("200160930",2,4)0129;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;^&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here. &amp;nbsp;What I assume you want is to concatenate the substr() result with the 0129, so maybe:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;beg_date = substr("200160930",2,4) || "0129";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;beg_date = cats(substr("200160930",2,4),"0129");&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note however that your resulting string will look like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;01600129&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As the 2 means, start at character 2, and then read 4 characters from there, per the manual:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212264.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212264.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 10:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302306#M64123</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-04T10:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: usage of SUBSTR function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302314#M64128</link>
      <description>&lt;P&gt;Thank you and all others who responded to my query. Since, I don't have SAS compiler facility readily, I posted these queires. Please excuse me if it is an offence.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 11:55:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302314#M64128</guid>
      <dc:creator>SudheerAnkem</dc:creator>
      <dc:date>2016-10-04T11:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: usage of SUBSTR function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302316#M64129</link>
      <description>&lt;P&gt;Take a look at SAS University Edition, which is specifically made for learning purposes.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 12:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/usage-of-SUBSTR-function/m-p/302316#M64129</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-04T12:19:16Z</dc:date>
    </item>
  </channel>
</rss>

