<?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: datatyp issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/datatyp-issue/m-p/800707#M315034</link>
    <description>&lt;P&gt;I think there is an order of operations issue. The output is within the loop and BEFORE the conversion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some concepts:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Once there is an explicit OUTPUT statement there is no more implicit OUTPUT&lt;/LI&gt;
&lt;LI&gt;No input data set also means no default loop&lt;/LI&gt;
&lt;LI&gt;Conversion needs to occur before the record is written to the dataset.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
do map = 1 to 7;
         char_map= put(map,4.);
         output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418912"&gt;@newbie69&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can someone tell me why that&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data new;&lt;BR /&gt;do map = 1 to 7;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;char_map= put(map,4.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;doesn't do what it should, namely to change from numeric to character/string? (need it to map with another column which is a string... ) Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Mar 2022 17:53:45 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-03-07T17:53:45Z</dc:date>
    <item>
      <title>datatyp issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datatyp-issue/m-p/800701#M315031</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;can someone tell me why that&amp;nbsp;&lt;/P&gt;&lt;P&gt;data new;&lt;BR /&gt;do map = 1 to 7;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;char_map= put(map,4.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;doesn't do what it should, namely to change from numeric to character/string? (need it to map with another column which is a string... ) Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 17:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datatyp-issue/m-p/800701#M315031</guid>
      <dc:creator>newbie69</dc:creator>
      <dc:date>2022-03-07T17:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: datatyp issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datatyp-issue/m-p/800706#M315033</link>
      <description>&lt;P&gt;Since your PUT function comes after the OUTPUT statement, nothing from PUT is ever output to the data set. Perhaps this is what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
    do map = 1 to 7;
        char_map= put(map,4.);
        output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now because PUT comes before output, the results of PUT are written to the data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And so really, your subject line is wrong, this problem has nothing to do with the data type of the variable. Probably best not to jump to conclusions about the cause, and just simply use a subject line like "PUT statement not working" and ask how to fix it to give the desired result.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 18:08:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datatyp-issue/m-p/800706#M315033</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-07T18:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: datatyp issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/datatyp-issue/m-p/800707#M315034</link>
      <description>&lt;P&gt;I think there is an order of operations issue. The output is within the loop and BEFORE the conversion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some concepts:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Once there is an explicit OUTPUT statement there is no more implicit OUTPUT&lt;/LI&gt;
&lt;LI&gt;No input data set also means no default loop&lt;/LI&gt;
&lt;LI&gt;Conversion needs to occur before the record is written to the dataset.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
do map = 1 to 7;
         char_map= put(map,4.);
         output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418912"&gt;@newbie69&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can someone tell me why that&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data new;&lt;BR /&gt;do map = 1 to 7;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;char_map= put(map,4.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;doesn't do what it should, namely to change from numeric to character/string? (need it to map with another column which is a string... ) Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 17:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/datatyp-issue/m-p/800707#M315034</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-03-07T17:53:45Z</dc:date>
    </item>
  </channel>
</rss>

