<?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: Variable XX has been defined as both character and numeric. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-XX-has-been-defined-as-both-character-and-numeric/m-p/240386#M44337</link>
    <description>&lt;P&gt;Once you figure out which dataset contains the character date, you could fix it like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname XYZ "/sasdata/data/data3/Ali";
data XYZ.concatenation;
set 
	XYZ.FBG_Analysis4 
	XYZ.FBG_ANALYSIS9 
		( rename='COT00503.D_SRVY'n=COT00503_D_SRVY_str 
		  in=special )
	XYZ.FBG_ANALYSIS34 
	XYZ.FBG_ANALYSIS42
	XYZ.FBG_ANALYSIS64;
if special then 'COT00503.D_SRVY'n = input(COT00503_D_SRVY_str, anydtdte.);
drop COT00503.D_SRVY_str;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might have to use a different informat.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2015 03:58:02 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2015-12-22T03:58:02Z</dc:date>
    <item>
      <title>Variable XX has been defined as both character and numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-XX-has-been-defined-as-both-character-and-numeric/m-p/240357#M44321</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to simply combine 5 tables (having the same variables),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;libname XYZ "/sasdata/data/data3/Ali";&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;data XYZ.concatenation;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;set XYZ.FBG_Analysis4 XYZ.FBG_ANALYSIS9 XYZ.FBG_ANALYSIS34 XYZ.FBG_ANALYSIS42 &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;ERROR: Variable 'COT00503.D_SRVY'n has been defined as both character and numeric.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;XYZ.FBG_ANALYSIS64;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;proc print data=XYZ.concatenation;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var C_ST C_DSTRB_AREA N_RSK ConstructionClass COT00503.C_CSP_CONST_CLS Current_FBG Updated_FBG Difference_percentage;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;title 'Data Set CONCATENATION';&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, I get this error. This variable &lt;EM&gt;&lt;FONT color="#FF0000"&gt;'COT00503.D_SRVY'&lt;/FONT&gt;&lt;/EM&gt;&amp;nbsp;is a "date" variable and I don't know how to solve the issue. Could you please help?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 22:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-XX-has-been-defined-as-both-character-and-numeric/m-p/240357#M44321</guid>
      <dc:creator>almmotamedi</dc:creator>
      <dc:date>2015-12-21T22:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Variable XX has been defined as both character and numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-XX-has-been-defined-as-both-character-and-numeric/m-p/240358#M44322</link>
      <description>You need to look at that variable across all your tables. You'll find that one is a character and others are date, then you'll need to make them all the same in a separate step. Ideally, you can fix this in how you import your data if possible.&lt;BR /&gt;&lt;BR /&gt;You can also query the SASHELP.VCOLUMN table to see where the issue is.&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table types as&lt;BR /&gt;select libnmae, memname, name, type as&lt;BR /&gt;from sashelp.vcolumn where&lt;BR /&gt;libname='XYZ' and memname in ("FBG_ANALYSIS4", "FBG_ANALYSIS9", "FBG_ANALYSIS34", "FBG_ANALYSIS42", "FBG_ANALYSIS64")&lt;BR /&gt;and name='COT00503.D_SRVY';&lt;BR /&gt;quit; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Dec 2015 22:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-XX-has-been-defined-as-both-character-and-numeric/m-p/240358#M44322</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-21T22:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Variable XX has been defined as both character and numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-XX-has-been-defined-as-both-character-and-numeric/m-p/240384#M44335</link>
      <description>&lt;P&gt;Thank you Reeza. Could you please advise how to "make them all the same in a separate step" as you said?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 03:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-XX-has-been-defined-as-both-character-and-numeric/m-p/240384#M44335</guid>
      <dc:creator>almmotamedi</dc:creator>
      <dc:date>2015-12-22T03:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Variable XX has been defined as both character and numeric.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-XX-has-been-defined-as-both-character-and-numeric/m-p/240386#M44337</link>
      <description>&lt;P&gt;Once you figure out which dataset contains the character date, you could fix it like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname XYZ "/sasdata/data/data3/Ali";
data XYZ.concatenation;
set 
	XYZ.FBG_Analysis4 
	XYZ.FBG_ANALYSIS9 
		( rename='COT00503.D_SRVY'n=COT00503_D_SRVY_str 
		  in=special )
	XYZ.FBG_ANALYSIS34 
	XYZ.FBG_ANALYSIS42
	XYZ.FBG_ANALYSIS64;
if special then 'COT00503.D_SRVY'n = input(COT00503_D_SRVY_str, anydtdte.);
drop COT00503.D_SRVY_str;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might have to use a different informat.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 03:58:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-XX-has-been-defined-as-both-character-and-numeric/m-p/240386#M44337</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-12-22T03:58:02Z</dc:date>
    </item>
  </channel>
</rss>

