<?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 Can't import the numbers with decimals in the right format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/701999#M214995</link>
    <description>&lt;P&gt;I have this file attached that I want to import in SAS but the female smokers and the male smokers columns only show me the first number for each row. Could you help.&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;PROC IMPORT&lt;BR /&gt;DATAFILE="C:\Users\admin\Desktop\Logiciels statistiques\Devoir individuel 3\OWID_COVID_DATA_2020.csv"&lt;BR /&gt;OUT=mylib_d3.owid_covid_data_2020&lt;BR /&gt;DBMS=csv&lt;BR /&gt;REPLACE;&lt;BR /&gt;FORMAT&lt;BR /&gt;iso_code $CHAR8.&lt;BR /&gt;date YYMMDD10.&lt;BR /&gt;new_cases BEST2.&lt;BR /&gt;new_deaths BEST3.&lt;BR /&gt;new_tests BEST12.&lt;BR /&gt;total_tests BEST12.&lt;BR /&gt;population BEST10.&lt;BR /&gt;median_age BEST6.&lt;BR /&gt;aged_65_older BEST6.&lt;BR /&gt;aged_70_older BEST6.&lt;BR /&gt;cardiovasc_death_rate BEST6.&lt;BR /&gt;diabetes_prevalence BEST6.&lt;BR /&gt;female_smokers COMMA32.&lt;BR /&gt;male_smokers COMMA32.;&lt;/P&gt;&lt;P&gt;GETNAMES=yes;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Nov 2020 12:02:28 GMT</pubDate>
    <dc:creator>Feksan</dc:creator>
    <dc:date>2020-11-27T12:02:28Z</dc:date>
    <item>
      <title>Can't import the numbers with decimals in the right format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/701999#M214995</link>
      <description>&lt;P&gt;I have this file attached that I want to import in SAS but the female smokers and the male smokers columns only show me the first number for each row. Could you help.&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;PROC IMPORT&lt;BR /&gt;DATAFILE="C:\Users\admin\Desktop\Logiciels statistiques\Devoir individuel 3\OWID_COVID_DATA_2020.csv"&lt;BR /&gt;OUT=mylib_d3.owid_covid_data_2020&lt;BR /&gt;DBMS=csv&lt;BR /&gt;REPLACE;&lt;BR /&gt;FORMAT&lt;BR /&gt;iso_code $CHAR8.&lt;BR /&gt;date YYMMDD10.&lt;BR /&gt;new_cases BEST2.&lt;BR /&gt;new_deaths BEST3.&lt;BR /&gt;new_tests BEST12.&lt;BR /&gt;total_tests BEST12.&lt;BR /&gt;population BEST10.&lt;BR /&gt;median_age BEST6.&lt;BR /&gt;aged_65_older BEST6.&lt;BR /&gt;aged_70_older BEST6.&lt;BR /&gt;cardiovasc_death_rate BEST6.&lt;BR /&gt;diabetes_prevalence BEST6.&lt;BR /&gt;female_smokers COMMA32.&lt;BR /&gt;male_smokers COMMA32.;&lt;/P&gt;&lt;P&gt;GETNAMES=yes;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 12:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/701999#M214995</guid>
      <dc:creator>Feksan</dc:creator>
      <dc:date>2020-11-27T12:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can't import the numbers with decimals in the right format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/702004#M214997</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350608"&gt;@Feksan&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add the statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;guessingrows=max;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;before the RUN statement to improve the &lt;EM&gt;chance&lt;/EM&gt;&amp;nbsp;that everything is imported correctly. Note in PROC CONTENTS output of dataset &lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;mylib_d3.owid_covid_data_2020&lt;/FONT&gt;&amp;nbsp;&lt;/SPAN&gt;how this changes the type, length, format and informat of several variables.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 12:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/702004#M214997</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-11-27T12:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can't import the numbers with decimals in the right format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/702008#M214998</link>
      <description>&lt;P&gt;"Use the data step Luke"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile "C:\Users\bart\Desktop\OWID_COVID_DATA_2020.csv" lrecl=1024 dsd dlm="," firstobs=2 missover;
input
iso_code : $ 8.
date : YYMMDD10.
(new_cases 
new_deaths 
new_tests 
total_tests 
population 
median_age 
aged_65_older 
aged_70_older 
cardiovasc_death_rate 
diabetes_prevalence
female_smokers 
male_smokers) (: BEST32.)
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 13:10:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/702008#M214998</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-11-27T13:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can't import the numbers with decimals in the right format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/702032#M215006</link>
      <description>&lt;P&gt;PROC IMPORT is going to GUESS how to define the variables and what informat to use to read them and what format to attach for displaying them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is generally easier, faster and more accurate to write your own data step to read a delimited text file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile "C:\downloads\&amp;amp;fname" dsd truncover firstobs=2;
  input 
    iso_code                 :$3.
    date                     :yymmdd.
    new_cases                 
    new_deaths                
    new_tests                 
    total_tests               
    population                
    median_age                
    aged_65_older             
    aged_70_older             
    cardiovasc_death_rate     
    diabetes_prevalence       
    female_smokers            
    male_smokers             
  ;
  format date yymmdd10.;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 14:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/702032#M215006</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-27T14:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can't import the numbers with decimals in the right format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/702041#M215010</link>
      <description>&lt;P&gt;What happened is that Proc Import by default only examines about 20 rows of data to set variable properties.&lt;/P&gt;
&lt;P&gt;You variables in question, female smokers and male smokers are not populated for the first rows so SAS assigned them a $1, one character, to read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may also find that report style data sets, such as result from reading this data, are a bit hard to work with.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 15:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-t-import-the-numbers-with-decimals-in-the-right-format/m-p/702041#M215010</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-27T15:00:22Z</dc:date>
    </item>
  </channel>
</rss>

