<?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: a puzzle when using input to convert character variable to numeric: two steps okay, one step not in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332740#M74932</link>
    <description>&lt;P&gt;Here's a possibility.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps TRSEQ is already part of SDTM.SUPPTRIR, and has a format connected with it such as 3.1.&amp;nbsp; In that case, the format isn't wide enough to display the results you are getting.&amp;nbsp; But the extra DATA step drops the existing TRSEQ (and its accompanying interfering format).&lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2017 18:00:06 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-02-14T18:00:06Z</dc:date>
    <item>
      <title>a puzzle when using input to convert character variable to numeric: two steps okay, one step not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332716#M74926</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data supptrir (keep= qval qnam idvarval trseq);
set sdtm.supptrir;
where qnam='REVPER' and qval='Review 1';
trseq=input(idvarval,best.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;above code should work (tested on another dataset), but for the current dataset it does not work. I got:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7229iDD0517B4F28677B6/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Idvarval length is 50. I tried both strip(idvarval) and compress&lt;SPAN&gt;(idvarval) in the input statement, also 8., ??best. etc but never worked. However,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;when I do it in two steps, it works:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data supptrir (keep=usubjid qval qnam idvarval);
set sdtm.supptrir;
where qnam='REVPER' and qval='Review 1';
run;
data supptrir; 
set supptrir ;
trseq=input(idvarval,best.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what could be the reason? very strange.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 17:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332716#M74926</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2017-02-14T17:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: a puzzle when using input to convert character variable to numeric: two steps okay, one step not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332726#M74929</link>
      <description>&lt;P&gt;Enter in your 1st step the line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; put IDVARVAL $hex8. ;&lt;/P&gt;
&lt;P&gt;And check - are the trailing characters after the ID number are realy spaces ('20'x in ascii ) ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; textID = translate(IDVARVAL, '#',' ');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; put textID=&lt;/P&gt;
&lt;P&gt;Do you see in log lines like: &amp;nbsp;&lt;STRONG&gt;10#####&lt;/STRONG&gt; or still &lt;STRONG&gt;10&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the hex value in compress function.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 17:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332726#M74929</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-02-14T17:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: a puzzle when using input to convert character variable to numeric: two steps okay, one step not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332731#M74930</link>
      <description>&lt;P&gt;Since PICTURES do not convey actual data VALUES&amp;nbsp;show us your actual data.&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 17:46:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332731#M74930</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-02-14T17:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: a puzzle when using input to convert character variable to numeric: two steps okay, one step not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332740#M74932</link>
      <description>&lt;P&gt;Here's a possibility.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps TRSEQ is already part of SDTM.SUPPTRIR, and has a format connected with it such as 3.1.&amp;nbsp; In that case, the format isn't wide enough to display the results you are getting.&amp;nbsp; But the extra DATA step drops the existing TRSEQ (and its accompanying interfering format).&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 18:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332740#M74932</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-02-14T18:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: a puzzle when using input to convert character variable to numeric: two steps okay, one step not</title>
      <link>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332842#M74958</link>
      <description>&lt;P&gt;Yes, this is the reason. There was already a TRSEQ variable, although it is all blank values. I should have checked that. Thanks for your hints.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 00:12:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/a-puzzle-when-using-input-to-convert-character-variable-to/m-p/332842#M74958</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2017-02-15T00:12:29Z</dc:date>
    </item>
  </channel>
</rss>

