<?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: Convert oracle variable into number in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Convert-oracle-variable-into-number/m-p/541090#M7285</link>
    <description>&lt;P&gt;Posting datasets in data step code makes helping yopu much easier. This is the code that was created by the macro mentioned in my footnotes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  infile datalines dsd truncover;
  input a:$4000.;
datalines4;
+00000005609333000
+00000002399300000

+00000002477900000
+00000000026800000

+00000000770400000
+00000002178300000
+00000001558100000
+00000001694400000
;;;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Run this code against this dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
b = input(a,18.5);
format b 18.5;
keep b;
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;          b

56093.33000
23993.00000
     .     
24779.00000
  268.00000
     .     
 7704.00000
21783.00000
15581.00000
16944.00000
&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Mar 2019 14:20:47 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-03-07T14:20:47Z</dc:date>
    <item>
      <title>Convert oracle variable into number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Convert-oracle-variable-into-number/m-p/541085#M7283</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have large data stored in Oracle where multiple variables are set up as varchar2(4000 byte).&lt;/P&gt;
&lt;P&gt;Some of them are in fact numbers&amp;nbsp;but are stored with a +, and a bunch of leading zeros.&amp;nbsp; In the example (in the table attached there is an example of what I have) the number start with the first non zero value and it is to be divided by 100000.&lt;/P&gt;
&lt;P&gt;I need only a relatively small subset of data in sas, obtained through joining another oracle table.&lt;/P&gt;
&lt;P&gt;how do I get the data in SAS already converted into number so that they do not occupy su much space?&lt;/P&gt;
&lt;P&gt;thank you very much in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 14:09:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Convert-oracle-variable-into-number/m-p/541085#M7283</guid>
      <dc:creator>ciro</dc:creator>
      <dc:date>2019-03-07T14:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert oracle variable into number</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Convert-oracle-variable-into-number/m-p/541090#M7285</link>
      <description>&lt;P&gt;Posting datasets in data step code makes helping yopu much easier. This is the code that was created by the macro mentioned in my footnotes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  infile datalines dsd truncover;
  input a:$4000.;
datalines4;
+00000005609333000
+00000002399300000

+00000002477900000
+00000000026800000

+00000000770400000
+00000002178300000
+00000001558100000
+00000001694400000
;;;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Run this code against this dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
b = input(a,18.5);
format b 18.5;
keep b;
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;          b

56093.33000
23993.00000
     .     
24779.00000
  268.00000
     .     
 7704.00000
21783.00000
15581.00000
16944.00000
&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Mar 2019 14:20:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Convert-oracle-variable-into-number/m-p/541090#M7285</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-07T14:20:47Z</dc:date>
    </item>
  </channel>
</rss>

