<?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: How can I solve this error? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/280010#M7939</link>
    <description>&lt;P&gt;nevermind I got it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc contents data=foot_paper_merged varnum;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2016 15:03:18 GMT</pubDate>
    <dc:creator>christinagting0</dc:creator>
    <dc:date>2016-06-24T15:03:18Z</dc:date>
    <item>
      <title>How can I solve this error?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279979#M7933</link>
      <description>&lt;P&gt;I am trying to merge a bunch of files, uisng proc sql, here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table foot_all as&lt;BR /&gt;select*&lt;BR /&gt;from foot_paper_merged&lt;BR /&gt;outer union corr&lt;BR /&gt;select*&lt;BR /&gt;from foot_dados_paper_merge&lt;BR /&gt;outer union corr&lt;BR /&gt;select*&lt;BR /&gt;from foot_dados_ca_dc;&amp;nbsp;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when I run this code I'm getting a number of errors of this nature:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Numeric expression requires a numeric format.&lt;BR /&gt;ERROR: Column 83 from the first contributor of OUTER UNION is not the same type as its&lt;BR /&gt;counterpart from the second.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve this? There is a lot of them!!!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 13:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279979#M7933</guid>
      <dc:creator>christinagting0</dc:creator>
      <dc:date>2016-06-24T13:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I solve this error?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279985#M7934</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As the error says you have column with the same name but of different type within the databases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 13:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279985#M7934</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2016-06-24T13:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I solve this error?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279988#M7935</link>
      <description>&lt;P&gt;Hi as the errorsays, you have different types for columns with the same name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the code below that illustrates this, it also shows you how you can list type and length for a column. you need to do a type conversion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
  set sashelp.class;
run;

data have2;
  set sashelp.class(rename=(sex=sex_c age=age_n));
  sex = ifn(sex_c = "M", 1, 2);
  age = put(age_n, 8. -L);
  drop sex_c age_n;
run;

options nolabel;
proc sql;
  select
    libname
    , memname
    , lowcase(name) as name
    , type
    , length
    , varnum
  from
    dictionary.columns
  where
    libname = "WORK"
    and memname like "HAVE%"
  order by
    name
    , memname
  ;
quit;
options label;

proc sql;
  create table want as
  select
    *
  from
    have1
  outer union corr
  select
    *
  from
    have2
  ;
quit;

data want2;
  set have1 have2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 13:53:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279988#M7935</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-06-24T13:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I solve this error?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279989#M7936</link>
      <description>&lt;P&gt;Sorry I'm very new to sas so this is all over my head a bit...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are a lot of columns that are giving me this error! Does that mean I have to do a type conversion for each one of these columns????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initially I was usin the below code to convert some of my variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data foot_paper_dc_only;&lt;BR /&gt;set foot_paper_dc_only(rename=(DISCHARGE_RTW_STATUS=DISCHARGERTWSTATUSNUM));&lt;BR /&gt;DISCHARGE_RTW_STATUS = put(DISCHARGERTWSTATUSNUM, 3.);&lt;BR /&gt;drop DISCHARGERTWSTATUSNUM;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does that mean I have to do this for ALL the columns???&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a way to just change everything? Is there an easier solution?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 13:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279989#M7936</guid>
      <dc:creator>christinagting0</dc:creator>
      <dc:date>2016-06-24T13:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I solve this error?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279997#M7937</link>
      <description>&lt;P&gt;Yes you have to do the type conversion for all the columns. Maybe there is a way to change the program which creates the data before you combine it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no automatic way to do the type conversion. The dictioinary table DICTIONARY.COLUMNS together with the SAS macro language can help you to achieve what you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look here &lt;A href="http://www.lexjansen.com/nesug/nesug10/ff/ff01.pdf" target="_blank"&gt;http://www.lexjansen.com/nesug/nesug10/ff/ff01.pdf&lt;/A&gt; or here &lt;A href="http://www.sascommunity.org/wiki/Changing_Variable_Type" target="_blank"&gt;http://www.sascommunity.org/wiki/Changing_Variable_Type&lt;/A&gt; for examples on how to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&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, 24 Jun 2016 14:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/279997#M7937</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-06-24T14:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I solve this error?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/280007#M7938</link>
      <description>&lt;P&gt;Hi bruno, sorry to be a pain but I can't figure out how to deermine what column corresponds to what varibale name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done a proc contens, but when I do this it spits out the variables in alphabetical order instead of column order #.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I spit out the variables sorted by column number so I can figure out which variables are giving me the error messagE?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks so much for your help really appreciate it!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 15:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/280007#M7938</guid>
      <dc:creator>christinagting0</dc:creator>
      <dc:date>2016-06-24T15:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I solve this error?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/280010#M7939</link>
      <description>&lt;P&gt;nevermind I got it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc contents data=foot_paper_merged varnum;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 15:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-solve-this-error/m-p/280010#M7939</guid>
      <dc:creator>christinagting0</dc:creator>
      <dc:date>2016-06-24T15:03:18Z</dc:date>
    </item>
  </channel>
</rss>

