<?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: Length of BLANKSTR() function in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Length-of-BLANKSTR-function/m-p/379037#M3639</link>
    <description>&lt;P&gt;I don't know what "expected result" you are seeing (not seeing?), but you can use the NLENG function to see the length of a&amp;nbsp;character matrix. &amp;nbsp;That is the length of the variable that&amp;nbsp;is written to the SAS data set. Run the following, which should show that the SAS/IML vector contains 11 characters per element and that 11 is the length of the data set variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IML;
vector = J(5,1,BlankStr(11));
L = nleng(vector);
print L;

DO i=1 TO 5;
	vector[i] = char(i) + 'M';
END;

CREATE vector var "vector"; APPEND; CLOSE;
QUIT;

ods select Variables;
proc contents data=vector; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Jul 2017 14:43:44 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2017-07-25T14:43:44Z</dc:date>
    <item>
      <title>Length of BLANKSTR() function</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Length-of-BLANKSTR-function/m-p/379006#M3638</link>
      <description>&lt;P&gt;I was wondering how the length of the BLANKSTR function is set. When I create a vector out of a loop like in the following code:&lt;/P&gt;&lt;PRE&gt;PROC IML;
vector = J(5,1,BlankStr(11));

DO i=1 TO 5;
	vector[i,1] = char(i) + 'M';
END;

CREATE vector FROM vector;
APPEND FROM vector;
QUIT;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulting table "vector" is empty. If I change the argument in BLANKSTR to 13, however, I get the expected result. Do I use BLANKSTR incorrectly or what is behind this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 13:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Length-of-BLANKSTR-function/m-p/379006#M3638</guid>
      <dc:creator>philip_</dc:creator>
      <dc:date>2017-07-25T13:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Length of BLANKSTR() function</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Length-of-BLANKSTR-function/m-p/379037#M3639</link>
      <description>&lt;P&gt;I don't know what "expected result" you are seeing (not seeing?), but you can use the NLENG function to see the length of a&amp;nbsp;character matrix. &amp;nbsp;That is the length of the variable that&amp;nbsp;is written to the SAS data set. Run the following, which should show that the SAS/IML vector contains 11 characters per element and that 11 is the length of the data set variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IML;
vector = J(5,1,BlankStr(11));
L = nleng(vector);
print L;

DO i=1 TO 5;
	vector[i] = char(i) + 'M';
END;

CREATE vector var "vector"; APPEND; CLOSE;
QUIT;

ods select Variables;
proc contents data=vector; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jul 2017 14:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Length-of-BLANKSTR-function/m-p/379037#M3639</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-07-25T14:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Length of BLANKSTR() function</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Length-of-BLANKSTR-function/m-p/379044#M3640</link>
      <description>&lt;P&gt;Is the issue here the default length of the string returned by the CHAR function?&amp;nbsp;&amp;nbsp; If the default is 12, then each string will have 11 leading blanks before&amp;nbsp;the number.&amp;nbsp;&amp;nbsp;Try using strip(&lt;SPAN class="token function"&gt;char&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;))&amp;nbsp;instead of char(i) to remove the blanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 14:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Length-of-BLANKSTR-function/m-p/379044#M3640</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2017-07-25T14:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Length of BLANKSTR() function</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Length-of-BLANKSTR-function/m-p/379074#M3642</link>
      <description>&lt;P&gt;You cannot put more than 11 characters into a character variable that is defined as length $11.&lt;/P&gt;
&lt;P&gt;If you let SAS autoconvert a number into a character string for you it will default to using the BEST12. format.&lt;/P&gt;
&lt;P&gt;So the value of 1 will become a string of 11 blanks followed by the digit '1'. &amp;nbsp;If you then put that into a variable that is only 11 characters long all you have left are the blanks.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 15:15:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Length-of-BLANKSTR-function/m-p/379074#M3642</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-25T15:15:01Z</dc:date>
    </item>
  </channel>
</rss>

