<?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: Change length of variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/339827#M77561</link>
    <description>&lt;P&gt;One way is use the Index function which returns the first position in the variable with a specified character.&lt;/P&gt;
&lt;PRE&gt;data example;
   x='ThisHasNoBlanks';
   y='ThisHas A Blank'; /*blank being the SPACE character*/
   z='ThisHas&amp;nbsp;Null'; /* Null character entered by typing 255 
                       on the NUMERIC key pad while holding the ALT key*/
   XhasBlank = index(x,' ');
   YhasBlank = index(y,' ');
   ZhasBlank = index(z,' '); /* space*/
   ZhasNull  = index(z,'&amp;nbsp;'); /*ALT+255*/
run;&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 Mar 2017 23:28:30 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-03-09T23:28:30Z</dc:date>
    <item>
      <title>Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338498#M77085</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am reading the varaible and then using that in like statment, while doing this during comparision gwtting wrong output because of space(variable length), coul you please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data filesystemtable ;&lt;BR /&gt;infile "/home/cfile/filesystem.txt" ;&lt;BR /&gt;input filesystem :$30. ;&lt;BR /&gt;call symput('filesystem',filesystem);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data Library_of_filesystem;&lt;BR /&gt;set mine;&lt;BR /&gt;where path like "&amp;amp;&lt;SPAN&gt;filesystem&lt;/SPAN&gt;%";&lt;BR /&gt;keep path Library_name libref;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;log:&lt;BR /&gt;NOTE: There were 0 observations read from the data set WORK.MINE.&lt;BR /&gt;WHERE path like '/sas/bau/pricing/ &amp;nbsp; %';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can see as variable length is less than 30 hence space getting addedd while comparing and not getting expected result, could you please help to remove the leading space?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338498#M77085</guid>
      <dc:creator>Sharukhmk</dc:creator>
      <dc:date>2017-03-06T17:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338505#M77090</link>
      <description>&lt;P&gt;Sharukhmk,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;have you tried a simple solution? Try stripping the variable before assigning it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;variable = strip(variable);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chirs&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338505#M77090</guid>
      <dc:creator>ChrisPillsbury</dc:creator>
      <dc:date>2017-03-06T17:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338508#M77092</link>
      <description>&lt;P&gt;Not really clear what the problem is as we really don't know any of your data.&lt;/P&gt;
&lt;P&gt;I would guess that you may want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call symput('filesystem', STRIP(filesystem));&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338508#M77092</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-06T17:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338511#M77094</link>
      <description>&lt;P&gt;strip, trim and compress tried but still same thing.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338511#M77094</guid>
      <dc:creator>Sharukhmk</dc:creator>
      <dc:date>2017-03-06T17:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338512#M77095</link>
      <description>&lt;P&gt;What exactly are you trying to achieve with that code?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:56:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338512#M77095</guid>
      <dc:creator>ChrisPillsbury</dc:creator>
      <dc:date>2017-03-06T17:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338514#M77097</link>
      <description>data is : /sas/bau/pricing and issue is when i am reading it as $30. when comparing(using like) there is space coming ("/sas/bau/pricing ")which is not giving excpected result</description>
      <pubDate>Mon, 06 Mar 2017 17:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338514#M77097</guid>
      <dc:creator>Sharukhmk</dc:creator>
      <dc:date>2017-03-06T17:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338519#M77101</link>
      <description>reading data and using that in where statement so i can filter out a table&lt;BR /&gt;.</description>
      <pubDate>Mon, 06 Mar 2017 18:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338519#M77101</guid>
      <dc:creator>Sharukhmk</dc:creator>
      <dc:date>2017-03-06T18:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338524#M77105</link>
      <description>&lt;P&gt;&amp;nbsp;Seems like dataset "mine" is the issue, SAS is looking for a specific table. Maybe using _null_ will help? try this....&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Library_of_filesystem;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; path like &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;filesystem%"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;keep&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; path Library_name libref;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 18:30:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338524#M77105</guid>
      <dc:creator>ChrisPillsbury</dc:creator>
      <dc:date>2017-03-06T18:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338526#M77107</link>
      <description>Mine table contains data and one of variable is path with which I am&lt;BR /&gt;comparing /sas/bau/pricing.&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Mon, 06 Mar 2017 18:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338526#M77107</guid>
      <dc:creator>Sharukhmk</dc:creator>
      <dc:date>2017-03-06T18:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338529#M77108</link>
      <description>&lt;P&gt;1) Try Call SymputX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) what is the value of filesystem in the LAST record in the data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) you may need to examine that filesytem variable to see if it actually has&amp;nbsp;NULL character(s) at the end&amp;nbsp;and not a BLANK at the end. STRIP does not remove null characters.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 18:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338529#M77108</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-06T18:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338747#M77203</link>
      <description>the value of filesystem is /sas/bau/pricing&lt;BR /&gt;how can i test for blanks</description>
      <pubDate>Tue, 07 Mar 2017 10:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/338747#M77203</guid>
      <dc:creator>Sharukhmk</dc:creator>
      <dc:date>2017-03-07T10:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Change length of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/339827#M77561</link>
      <description>&lt;P&gt;One way is use the Index function which returns the first position in the variable with a specified character.&lt;/P&gt;
&lt;PRE&gt;data example;
   x='ThisHasNoBlanks';
   y='ThisHas A Blank'; /*blank being the SPACE character*/
   z='ThisHas&amp;nbsp;Null'; /* Null character entered by typing 255 
                       on the NUMERIC key pad while holding the ALT key*/
   XhasBlank = index(x,' ');
   YhasBlank = index(y,' ');
   ZhasBlank = index(z,' '); /* space*/
   ZhasNull  = index(z,'&amp;nbsp;'); /*ALT+255*/
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Mar 2017 23:28:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-length-of-variable/m-p/339827#M77561</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-09T23:28:30Z</dc:date>
    </item>
  </channel>
</rss>

