<?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 Numeric v Character Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Numeric-v-Character-Variables/m-p/486164#M287168</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am reading a .csv file into SASUniversity and I am having an issue. All of the data should be numeric with exception to a handful. For some reason they are reading in as the first have Character and the last half numeric. I have my code below, is there a post-fix or something I need to add to get these to read in as numeric? For reference, the variable names that follow with $8 are those that are supposed to be character, everything else should be numeric.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data IHC.main;&lt;BR /&gt;infile '/folders/myfolders/IHC/EMainTable.csv' firstobs=2 dlm=',' lrecl=32000 truncover DSD;&lt;BR /&gt;length Newid Icupt Dschrg_dspstn_cd Mortly_indctr_cd Primdischdiagcd&lt;BR /&gt;Primdishdiag $8 Admitdiagcd1 Admitdiag1 $8 Male Age Imrs Imrsgroup&lt;BR /&gt;Imrsgroup3 Rvitestresult Cvhx Hearrate Resprate Sbp dbp Bmi&lt;BR /&gt;Minapache Maxapache Hypertensionhx Hyperlipidemiahx Diabhx&lt;BR /&gt;Mihx Cadhx Cvahx Tobaccohx Pttype $8 Afibhx Dysrhythmiahx&lt;BR /&gt;Chfhx Copdhx Respfailhx Renalfailhx Liverfailhx Tiahx&lt;BR /&gt;Alcoholabusehx Drugabusehx Race $8 Pneumonia Adeno H1ni Hmpv&lt;BR /&gt;Flua Flub Para Rhino Rsv Corona Bnppreclosest Bnppremax&lt;BR /&gt;Bnpindexhospmax Bnpost90dymax Esrindexhospax Gfrindexhospmin&lt;BR /&gt;Tropiindexhospmax Tropipost90dymax Sp02indexhospmin&lt;BR /&gt;Staphaureusindexhosp Streppneumoindexhosp Afibindexhosp&lt;BR /&gt;Chestpainindexhosp Chfindexhosp Cvaindexhosp Dysrhythmiaindexhosp&lt;BR /&gt;Fallindexhosp Liverfailindexhosp Malaiseindexhosp Miindexhosp&lt;BR /&gt;Respfailindexhosp Sepsisindexhosp Sobindexhosp Wheezeindexhosp&lt;BR /&gt;Coughindexhosp Sputum Feverindexhosp Temp Fever Wbc Dxleukocytosis&lt;BR /&gt;Leukosytosis Crphsindexhospmax Elevatedcrp Dxhypoxemia Hypoxemia&lt;BR /&gt;Anydrug Antibiotic Anticoagulant Anticoagulantother Antiplatelet&lt;BR /&gt;Antiviral Betablocker Ccb Corticosteriod Statin Warfarin Fvc&lt;BR /&gt;Fivc Tlc Frc_n2 Fef25_75 Pef Fev1 Fev2 Fev3 Fev5 Fev6 Fev75&lt;BR /&gt;Dlco Vc Upperrespinfection Tuberculosis Bronchiolitis&lt;BR /&gt;Bronchitis Bacterialpneumonia Viralpneumonia Infectiouspneumonia&lt;BR /&gt;Influenza Infection Anypneumtest Pntestresult $8 Cpneumo Npneumo&lt;BR /&gt;Streppneumo Anybactest Anybacpositive Anylungbactest&lt;BR /&gt;Lungbacpositive dead Cvdeathhosp Timetodeath Cvprimcauseofdeath&lt;BR /&gt;Cvaprimcod Miprimcod Mifu Timetomi Cvafu Timetocva Chfifu&lt;BR /&gt;timetochf ;&lt;BR /&gt;input Newid Icupt Dschrg_dspstn_cd Mortly_indctr_cd Primdischdiagcd&lt;BR /&gt;Primdishdiag Admitdiagcd1 Admitdiag1 Male Age Imrs Imrsgroup&lt;BR /&gt;Imrsgroup3 Rvitestresult Cvhx Hearrate Resprate Sbp dbp Bmi&lt;BR /&gt;Minapache Maxapache Hypertensionhx Hyperlipidemiahx Diabhx&lt;BR /&gt;Mihx Cadhx Cvahx Tobaccohx Pttype Afibhx Dysrhythmiahx&lt;BR /&gt;Chfhx Copdhx Respfailhx Renalfailhx Liverfailhx Tiahx&lt;BR /&gt;Alcoholabusehx Drugabusehx Race Pneumonia Adeno H1ni Hmpv&lt;BR /&gt;Flua Flub Para Rhino Rsv Corona Bnppreclosest Bnppremax&lt;BR /&gt;Bnpindexhospmax Bnpost90dymax Esrindexhospax Gfrindexhospmin&lt;BR /&gt;Tropiindexhospmax Tropipost90dymax Sp02indexhospmin&lt;BR /&gt;Staphaureusindexhosp Streppneumoindexhosp Afibindexhosp&lt;BR /&gt;Chestpainindexhosp Chfindexhosp Cvaindexhosp Dysrhythmiaindexhosp&lt;BR /&gt;Fallindexhosp Liverfailindexhosp Malaiseindexhosp Miindexhosp&lt;BR /&gt;Respfailindexhosp Sepsisindexhosp Sobindexhosp Wheezeindexhosp&lt;BR /&gt;Coughindexhosp Sputum Feverindexhosp Temp Fever Wbc Dxleukocytosis&lt;BR /&gt;Leukosytosis Crphsindexhospmax Elevatedcrp Dxhypoxemia Hypoxemia&lt;BR /&gt;Anydrug Antibiotic Anticoagulant Anticoagulantother Antiplatelet&lt;BR /&gt;Antiviral Betablocker Ccb Corticosteriod Statin Warfarin Fvc&lt;BR /&gt;Fivc Tlc Frc_n2 Fef25_75 Pef Fev1 Fev2 Fev3 Fev5 Fev6 Fev75&lt;BR /&gt;Dlco Vc Upperrespinfection Tuberculosis Bronchiolitis&lt;BR /&gt;Bronchitis Bacterialpneumonia Viralpneumonia Infectiouspneumonia&lt;BR /&gt;Influenza Infection Anypneumtest Pntestresult Cpneumo Npneumo&lt;BR /&gt;Streppneumo Anybactest Anybacpositive Anylungbactest&lt;BR /&gt;Lungbacpositive dead Cvdeathhosp Timetodeath Cvprimcauseofdeath&lt;BR /&gt;Cvaprimcod Miprimcod Mifu Timetomi Cvafu Timetocva Chfifu&lt;BR /&gt;timetochf;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Aug 2018 15:27:25 GMT</pubDate>
    <dc:creator>ScottSt</dc:creator>
    <dc:date>2018-08-12T15:27:25Z</dc:date>
    <item>
      <title>Numeric v Character Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numeric-v-Character-Variables/m-p/486164#M287168</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am reading a .csv file into SASUniversity and I am having an issue. All of the data should be numeric with exception to a handful. For some reason they are reading in as the first have Character and the last half numeric. I have my code below, is there a post-fix or something I need to add to get these to read in as numeric? For reference, the variable names that follow with $8 are those that are supposed to be character, everything else should be numeric.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data IHC.main;&lt;BR /&gt;infile '/folders/myfolders/IHC/EMainTable.csv' firstobs=2 dlm=',' lrecl=32000 truncover DSD;&lt;BR /&gt;length Newid Icupt Dschrg_dspstn_cd Mortly_indctr_cd Primdischdiagcd&lt;BR /&gt;Primdishdiag $8 Admitdiagcd1 Admitdiag1 $8 Male Age Imrs Imrsgroup&lt;BR /&gt;Imrsgroup3 Rvitestresult Cvhx Hearrate Resprate Sbp dbp Bmi&lt;BR /&gt;Minapache Maxapache Hypertensionhx Hyperlipidemiahx Diabhx&lt;BR /&gt;Mihx Cadhx Cvahx Tobaccohx Pttype $8 Afibhx Dysrhythmiahx&lt;BR /&gt;Chfhx Copdhx Respfailhx Renalfailhx Liverfailhx Tiahx&lt;BR /&gt;Alcoholabusehx Drugabusehx Race $8 Pneumonia Adeno H1ni Hmpv&lt;BR /&gt;Flua Flub Para Rhino Rsv Corona Bnppreclosest Bnppremax&lt;BR /&gt;Bnpindexhospmax Bnpost90dymax Esrindexhospax Gfrindexhospmin&lt;BR /&gt;Tropiindexhospmax Tropipost90dymax Sp02indexhospmin&lt;BR /&gt;Staphaureusindexhosp Streppneumoindexhosp Afibindexhosp&lt;BR /&gt;Chestpainindexhosp Chfindexhosp Cvaindexhosp Dysrhythmiaindexhosp&lt;BR /&gt;Fallindexhosp Liverfailindexhosp Malaiseindexhosp Miindexhosp&lt;BR /&gt;Respfailindexhosp Sepsisindexhosp Sobindexhosp Wheezeindexhosp&lt;BR /&gt;Coughindexhosp Sputum Feverindexhosp Temp Fever Wbc Dxleukocytosis&lt;BR /&gt;Leukosytosis Crphsindexhospmax Elevatedcrp Dxhypoxemia Hypoxemia&lt;BR /&gt;Anydrug Antibiotic Anticoagulant Anticoagulantother Antiplatelet&lt;BR /&gt;Antiviral Betablocker Ccb Corticosteriod Statin Warfarin Fvc&lt;BR /&gt;Fivc Tlc Frc_n2 Fef25_75 Pef Fev1 Fev2 Fev3 Fev5 Fev6 Fev75&lt;BR /&gt;Dlco Vc Upperrespinfection Tuberculosis Bronchiolitis&lt;BR /&gt;Bronchitis Bacterialpneumonia Viralpneumonia Infectiouspneumonia&lt;BR /&gt;Influenza Infection Anypneumtest Pntestresult $8 Cpneumo Npneumo&lt;BR /&gt;Streppneumo Anybactest Anybacpositive Anylungbactest&lt;BR /&gt;Lungbacpositive dead Cvdeathhosp Timetodeath Cvprimcauseofdeath&lt;BR /&gt;Cvaprimcod Miprimcod Mifu Timetomi Cvafu Timetocva Chfifu&lt;BR /&gt;timetochf ;&lt;BR /&gt;input Newid Icupt Dschrg_dspstn_cd Mortly_indctr_cd Primdischdiagcd&lt;BR /&gt;Primdishdiag Admitdiagcd1 Admitdiag1 Male Age Imrs Imrsgroup&lt;BR /&gt;Imrsgroup3 Rvitestresult Cvhx Hearrate Resprate Sbp dbp Bmi&lt;BR /&gt;Minapache Maxapache Hypertensionhx Hyperlipidemiahx Diabhx&lt;BR /&gt;Mihx Cadhx Cvahx Tobaccohx Pttype Afibhx Dysrhythmiahx&lt;BR /&gt;Chfhx Copdhx Respfailhx Renalfailhx Liverfailhx Tiahx&lt;BR /&gt;Alcoholabusehx Drugabusehx Race Pneumonia Adeno H1ni Hmpv&lt;BR /&gt;Flua Flub Para Rhino Rsv Corona Bnppreclosest Bnppremax&lt;BR /&gt;Bnpindexhospmax Bnpost90dymax Esrindexhospax Gfrindexhospmin&lt;BR /&gt;Tropiindexhospmax Tropipost90dymax Sp02indexhospmin&lt;BR /&gt;Staphaureusindexhosp Streppneumoindexhosp Afibindexhosp&lt;BR /&gt;Chestpainindexhosp Chfindexhosp Cvaindexhosp Dysrhythmiaindexhosp&lt;BR /&gt;Fallindexhosp Liverfailindexhosp Malaiseindexhosp Miindexhosp&lt;BR /&gt;Respfailindexhosp Sepsisindexhosp Sobindexhosp Wheezeindexhosp&lt;BR /&gt;Coughindexhosp Sputum Feverindexhosp Temp Fever Wbc Dxleukocytosis&lt;BR /&gt;Leukosytosis Crphsindexhospmax Elevatedcrp Dxhypoxemia Hypoxemia&lt;BR /&gt;Anydrug Antibiotic Anticoagulant Anticoagulantother Antiplatelet&lt;BR /&gt;Antiviral Betablocker Ccb Corticosteriod Statin Warfarin Fvc&lt;BR /&gt;Fivc Tlc Frc_n2 Fef25_75 Pef Fev1 Fev2 Fev3 Fev5 Fev6 Fev75&lt;BR /&gt;Dlco Vc Upperrespinfection Tuberculosis Bronchiolitis&lt;BR /&gt;Bronchitis Bacterialpneumonia Viralpneumonia Infectiouspneumonia&lt;BR /&gt;Influenza Infection Anypneumtest Pntestresult Cpneumo Npneumo&lt;BR /&gt;Streppneumo Anybactest Anybacpositive Anylungbactest&lt;BR /&gt;Lungbacpositive dead Cvdeathhosp Timetodeath Cvprimcauseofdeath&lt;BR /&gt;Cvaprimcod Miprimcod Mifu Timetomi Cvafu Timetocva Chfifu&lt;BR /&gt;timetochf;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Aug 2018 15:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numeric-v-Character-Variables/m-p/486164#M287168</guid>
      <dc:creator>ScottSt</dc:creator>
      <dc:date>2018-08-12T15:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric v Character Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numeric-v-Character-Variables/m-p/486165#M287169</link>
      <description>&lt;P&gt;In a LENGTH statement, any instructions (such as $8) applies to the complete list of variable names that came before.&amp;nbsp; So you will need to change the LENGTH statement.&amp;nbsp; Just looking at the beginning of it, you now have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;length Newid Icupt Dschrg_dspstn_cd Mortly_indctr_cd Primdischdiagcd&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Primdishdiag $8 Admitdiagcd1 Admitdiag1 $8&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You would need to change that to:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;length Newid Icupt Dschrg_dspstn_cd Mortly_indctr_cd Primdischdiagcd &lt;FONT color="#FF0000"&gt;8&lt;/FONT&gt;&lt;BR /&gt;Primdishdiag $8 Admitdiagcd1 &lt;FONT color="#FF0000"&gt;8&lt;/FONT&gt; Admitdiag1 $8&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Using 8 as the length will make the variables that precede it numeric.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Aug 2018 15:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numeric-v-Character-Variables/m-p/486165#M287169</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-12T15:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric v Character Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numeric-v-Character-Variables/m-p/486311#M287170</link>
      <description>&lt;P&gt;That did it! Thank you so much, I searched and searched but I couldn't figure out how to do that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2018 10:24:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numeric-v-Character-Variables/m-p/486311#M287170</guid>
      <dc:creator>ScottSt</dc:creator>
      <dc:date>2018-08-13T10:24:18Z</dc:date>
    </item>
  </channel>
</rss>

