<?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: How to convert a numeric vector into a character one in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66520#M19009</link>
    <description>I wanted to have an idea if I can translate the array as a whole to optimize time runing. It appears that I can't do this !! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ! &lt;BR /&gt;
&lt;BR /&gt;
It's clear that if I convert element by element this will take lot of time in my macro !&lt;BR /&gt;
&lt;BR /&gt;
Data-null ,  I've tested your program but it shows many errors !</description>
    <pubDate>Mon, 24 Aug 2009 12:19:17 GMT</pubDate>
    <dc:creator>nadra</dc:creator>
    <dc:date>2009-08-24T12:19:17Z</dc:date>
    <item>
      <title>function mattrib IML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66515#M19004</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I have a vector of numerics and I need to translate this one into a character vector. For instance a = {1,2,3}  I want to have a result b={'1','2','3'}&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: nadra

Message was edited by: nadra</description>
      <pubDate>Mon, 24 Aug 2009 09:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66515#M19004</guid>
      <dc:creator>nadra</dc:creator>
      <dc:date>2009-08-24T09:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a numeric vector into a character one</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66516#M19005</link>
      <description>Define a new vector with char elements, then assign them values from the original vector using the put function.&lt;BR /&gt;
/Linus</description>
      <pubDate>Mon, 24 Aug 2009 09:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66516#M19005</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-08-24T09:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a numeric vector into a character one</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66517#M19006</link>
      <description>Hello&lt;BR /&gt;
&lt;BR /&gt;
I defined b as a character vector and I did this : b=put(a,best12.);&lt;BR /&gt;
&lt;BR /&gt;
but it does not operate ?!

Message was edited by: nadra</description>
      <pubDate>Mon, 24 Aug 2009 10:04:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66517#M19006</guid>
      <dc:creator>nadra</dc:creator>
      <dc:date>2009-08-24T10:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a numeric vector into a character one</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66518#M19007</link>
      <description>You might need to take a glimpse on the array processing documentation:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a002299816.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a002299816.htm&lt;/A&gt;&lt;BR /&gt;
You need to assign values to the individual elements of the vector/array, not the array as a whole.&lt;BR /&gt;
/Linus</description>
      <pubDate>Mon, 24 Aug 2009 10:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66518#M19007</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-08-24T10:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a numeric vector into a character one</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66519#M19008</link>
      <description>The syntax you show implies that you are using IML.  &lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc iml;&lt;BR /&gt;
   reset print;&lt;BR /&gt;
   a={1,2,3};&lt;BR /&gt;
   b = char(a,1);&lt;BR /&gt;
   quit;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 24 Aug 2009 11:50:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66519#M19008</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-08-24T11:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a numeric vector into a character one</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66520#M19009</link>
      <description>I wanted to have an idea if I can translate the array as a whole to optimize time runing. It appears that I can't do this !! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ! &lt;BR /&gt;
&lt;BR /&gt;
It's clear that if I convert element by element this will take lot of time in my macro !&lt;BR /&gt;
&lt;BR /&gt;
Data-null ,  I've tested your program but it shows many errors !</description>
      <pubDate>Mon, 24 Aug 2009 12:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66520#M19009</guid>
      <dc:creator>nadra</dc:creator>
      <dc:date>2009-08-24T12:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a numeric vector into a character one</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66521#M19010</link>
      <description>&amp;gt; I wanted to have an idea if I can translate the array&lt;BR /&gt;
&amp;gt; as a whole to optimize time runing. It appears that I&lt;BR /&gt;
&amp;gt; can't do this !! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; ! &lt;BR /&gt;
Are you sure you need to convert the values to character.  What is the purpose?&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; It's clear that if I convert element by element this&lt;BR /&gt;
&amp;gt; will take lot of time in my macro !&lt;BR /&gt;
&lt;BR /&gt;
It should not be that slow.  Assuming you need to do it at all.&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Data-null ,  I've tested your program but it shows&lt;BR /&gt;
&amp;gt; many errors !&lt;BR /&gt;
Worked very well for me.  It is a PROC IML program, so I suspect you don't have IML.</description>
      <pubDate>Mon, 24 Aug 2009 15:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66521#M19010</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-08-24T15:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a numeric vector into a character one</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66522#M19011</link>
      <description>Hello , &lt;BR /&gt;
&lt;BR /&gt;
my purpose was to assign rowname and colname for a matrix using the function mattrib like this :&lt;BR /&gt;
proc iml;&lt;BR /&gt;
use panel;&lt;BR /&gt;
read all var{var1} into sub; sub=unique(sub);n=ncol(sub);&lt;BR /&gt;
rv=shape(0,n,n);&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
mattrib rv r=(sub') c=sub;&lt;BR /&gt;
CREATE rvtab FROM rv[r=(sub') c=sub];&lt;BR /&gt;
APPEND FROM rv[r=(sub') c=sub];&lt;BR /&gt;
CLOSE rvtab ;&lt;BR /&gt;
run;quit;&lt;BR /&gt;
&lt;BR /&gt;
sub contains numerics like : 8923, 6322,....&lt;BR /&gt;
&lt;BR /&gt;
after runing it shows : rowname and  colname must be character !!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
that why i wanted to convert sub into a character vector! I did this without success!!!

Message was edited by: nadra</description>
      <pubDate>Fri, 28 Aug 2009 07:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/function-mattrib-IML/m-p/66522#M19011</guid>
      <dc:creator>nadra</dc:creator>
      <dc:date>2009-08-28T07:57:49Z</dc:date>
    </item>
  </channel>
</rss>

