<?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: Left and right characters of a value with leading zeros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258813#M49934</link>
    <description>&lt;P&gt;data want;&lt;BR /&gt;xy='000499 19';&lt;BR /&gt;var1=substr(xy,1,6);&lt;BR /&gt;var2=substr(xy,8,2);&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2016 14:15:51 GMT</pubDate>
    <dc:creator>Loko</dc:creator>
    <dc:date>2016-03-24T14:15:51Z</dc:date>
    <item>
      <title>Left and right characters of a value with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258806#M49929</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;I have a variable called xy =&amp;nbsp; 000499 19&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and i want to create var1 = 000499 and var2 = 19&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can anyone pls let me know how to achieve&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258806#M49929</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2016-03-24T14:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Left and right characters of a value with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258807#M49930</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;xy='000499 19';&lt;BR /&gt;var1=scan(xy,1);&lt;BR /&gt;var2=scan(xy,2);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258807#M49930</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2016-03-24T14:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Left and right characters of a value with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258809#M49932</link>
      <description>&lt;P&gt;hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;we have to extract first 6 characters for var1 and next 2 characters for var2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have used&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;LEFT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(xx,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Var1,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;RIGHT&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;LEFT&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;(xx,&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;9&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; Var2,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;but it didnt work i dont know y ? &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258809#M49932</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2016-03-24T14:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Left and right characters of a value with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258813#M49934</link>
      <description>&lt;P&gt;data want;&lt;BR /&gt;xy='000499 19';&lt;BR /&gt;var1=substr(xy,1,6);&lt;BR /&gt;var2=substr(xy,8,2);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:15:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258813#M49934</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2016-03-24T14:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Left and right characters of a value with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258815#M49935</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;I got it but how is that similar to the left and right function which i&amp;nbsp;have sent you can u pls explain because i have many similar cases where i&amp;nbsp;have to use it&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258815#M49935</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2016-03-24T14:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Left and right characters of a value with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258816#M49936</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Left and Right are used in SAS just to align a character string. Probably you took them from excel where indeed they are used to extract from a string.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258816#M49936</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2016-03-24T14:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Left and right characters of a value with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258818#M49937</link>
      <description>&lt;P&gt;The issue you are having is that you never read the SAS documentation for the LEFT and RIGHT functions.&amp;nbsp; In some other languages, you may be permitted two arguments to these functions.&amp;nbsp; But in SAS, only one argument is permitted.&amp;nbsp; You'll need to read the SAS documentation.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258818#M49937</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-03-24T14:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Left and right characters of a value with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258824#M49940</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;Thank you . But can i make left and right function work in SAS to achieve what i need because i have 10 codes to change and also its not same case with everything for example when we have a condition like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;xx= NA630011 what is a similar function achieved by below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;LEFT(xx&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) as Var1,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; RIGHT(LEFT(xx&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;) as Var2,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; RIGHT(LEFT(xx&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;) as Var3,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; RIGHT(LEFT(xx&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;) as Var4,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 14:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258824#M49940</guid>
      <dc:creator>chennupriya</dc:creator>
      <dc:date>2016-03-24T14:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Left and right characters of a value with leading zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258893#M49967</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11383"&gt;@chennupriya&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;xx= NA630011 what is a similar function achieved by below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;LEFT(xx&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) as Var1,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; RIGHT(LEFT(xx&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;) as Var2,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; RIGHT(LEFT(xx&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;) as Var3,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; RIGHT(LEFT(xx&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;) as Var4,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What would you expect the values of Var1,&amp;nbsp;Var2, Var3 and Var4 to be? I'm not going to guess where you got the example syntax from.&lt;/P&gt;
&lt;P&gt;Note: if any of these are single values of 0 or 1 you better point out which 0 and which 1 from the original string contributed it as there would be different ways to get those.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 17:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-and-right-characters-of-a-value-with-leading-zeros/m-p/258893#M49967</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-24T17:47:05Z</dc:date>
    </item>
  </channel>
</rss>

