<?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: Lenght statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183465#M46695</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would answer it this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They all have 5 bytes allocated to the variable.&amp;nbsp; The Length function r&lt;SPAN class="shortDesc"&gt;eturns the length of a non-blank character string, excluding trailing blanks, and returns 1 for a blank character string&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jun 2014 19:00:05 GMT</pubDate>
    <dc:creator>DBailey</dc:creator>
    <dc:date>2014-06-03T19:00:05Z</dc:date>
    <item>
      <title>Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183464#M46694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have variable VAR like shown and is left justified:&lt;/P&gt;&lt;P&gt;length of VAR is $5&lt;/P&gt;&lt;P&gt;Does that mean 593 and 555 has 2 extra spaces after the number!!!&lt;/P&gt;&lt;P&gt;and like wise 6940 has one space after the number???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VAR&lt;/P&gt;&lt;P&gt;593&lt;/P&gt;&lt;P&gt;6940&lt;/P&gt;&lt;P&gt;555&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 18:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183464#M46694</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2014-06-03T18:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183465#M46695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would answer it this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They all have 5 bytes allocated to the variable.&amp;nbsp; The Length function r&lt;SPAN class="shortDesc"&gt;eturns the length of a non-blank character string, excluding trailing blanks, and returns 1 for a blank character string&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:00:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183465#M46695</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-06-03T19:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183466#M46696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, extra blanks are stored at the end.&amp;nbsp; In a DATA step, that makes no difference and you could use any of these statements to get the same result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var='593' then do;&lt;/P&gt;&lt;P&gt;if var='593&amp;nbsp; ' then do;&lt;/P&gt;&lt;P&gt;if var='593&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' then do;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if you are using pass-through SQL with a WHERE clause, a database might not process trailing blanks in the same way.&amp;nbsp; The WHERE clause might have to add the TRIM function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183466#M46696</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-06-03T19:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183467#M46697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;thanks for the reply.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;I was asking because of the following condition and wondering if length 5 could be used &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Diagnosis codes with fewer than five digits should be padded with spaces (not zeros) on the right.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183467#M46697</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2014-06-03T19:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183468#M46698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;/*CHECKING TO SEE IF THIS ONE SATIFIES THAT CONDITION*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input x $20.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;930.0&lt;/P&gt;&lt;P&gt;934&lt;/P&gt;&lt;P&gt;941.04&lt;/P&gt;&lt;P&gt;V12.09&lt;/P&gt;&lt;P&gt;V10.46&lt;/P&gt;&lt;P&gt;696.1&lt;/P&gt;&lt;P&gt;008.45&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt;length want $5.;&lt;/P&gt;&lt;P&gt; want=prxchange('s/\.//',-1,x);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183468#M46698</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2014-06-03T19:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183469#M46699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS wouldn't add zeroes unless you coded it to do that.&amp;nbsp; Default is spaces.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183469#M46699</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-06-03T19:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183470#M46700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In $w. informats w represents the total number of columns that contain the raw data filed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183470#M46700</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-06-03T19:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183471#M46701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;So what I did is right???&lt;/P&gt;&lt;P&gt;I am not adding zeros ..&lt;/P&gt;&lt;P&gt;then is this below condition satisfied???&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Diagnosis codes with fewer than five digits should be padded with spaces (not zeros) on the right.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183471#M46701</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2014-06-03T19:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183472#M46702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't comment about the PRXCHANGE function, but otherwise the right pieces are in place.&amp;nbsp; WANT will have a length of 5, and any values that are shorter than 5 characters will have blanks added to the end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183472#M46702</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-06-03T19:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183473#M46703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;great.&lt;/P&gt;&lt;P&gt;I got help on this PRXCHANGE function .&lt;/P&gt;&lt;P&gt;this basically removes dots from the codes&lt;/P&gt;&lt;P&gt;V10.46 becomes V1046&lt;/P&gt;&lt;P&gt;930.0 becomes 9300&lt;/P&gt;&lt;P&gt;934 stays 934&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you think there is any better way to do this???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:29:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183473#M46703</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2014-06-03T19:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183474#M46704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure that is all that PRXCHANGE is doing?&amp;nbsp; I'm not familiar enough with it to comment, but it would have been simple to code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;want = compress(x, '.');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would remove the dots and might be easier to understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:45:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183474#M46704</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-06-03T19:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183475#M46705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to remove particular characters from a string then use the COMPRESS() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;want = compress(x,'.');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183475#M46705</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-06-03T19:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lenght statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183476#M46706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; x &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;nondot=compress(x,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'.'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;930.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;934&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;941.04&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;V12.09&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;V10.46&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;696.1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;008.45&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lenght-statement/m-p/183476#M46706</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-06-03T19:51:25Z</dc:date>
    </item>
  </channel>
</rss>

