<?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: Union error question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Union-error-question/m-p/665867#M199152</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;ERROR: Column 15 from the first contributor of UNION is not the same type as its counterpart from the second.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Does this mean every field before the union must be the exact datatype as after the union???&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, the types need to be the same in the queries. You cannot have a variable that's character and numeric in the same column for example.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jun 2020 17:39:37 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-06-29T17:39:37Z</dc:date>
    <item>
      <title>Union error question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-error-question/m-p/665859#M199146</link>
      <description>&lt;P&gt;This code produces the following error&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table DSHARE_DATA as&lt;BR /&gt;SELECT &lt;BR /&gt;LN_NO &lt;BR /&gt;,LEGACY_COMPANY&lt;BR /&gt;,INITIAL_REQ_DT&lt;BR /&gt;,ACCOMODATION_TYPE&lt;BR /&gt;,CURR_REQ_CHNL&lt;BR /&gt;,INVESTOR_GROUP&lt;BR /&gt;,LN_1ST_PRIN_BA &lt;BR /&gt;,DEL_BUCKET&lt;BR /&gt;,FC_STATUS&lt;BR /&gt;,BK_STATUS&lt;BR /&gt;,LM_STATUS_CD&lt;BR /&gt;,LM_STATUS_CHG_DT&lt;BR /&gt;,FB_PLAN_STATUS&lt;BR /&gt;,FP_CREAT_DT &lt;BR /&gt;,FP_PROMISE_QT&lt;BR /&gt;,FP_FST_PR_DU_DT&lt;BR /&gt;,FP_LST_PR_DU_DT &lt;BR /&gt;,ACCRUAL_STATUS &lt;BR /&gt;,PR_ALPHA_STATE_CD &lt;BR /&gt;,LN_NXT_PMT_DUE_DT &lt;BR /&gt;,ASSISTANCE_STAGE &lt;BR /&gt;,CASE &lt;BR /&gt;WHEN ASSISTANCE_STAGE IN ('FB PLAN NOT SETUP', 'CLIENT CANCELLED ASSISTANCE') THEN 'No' &lt;BR /&gt;ELSE 'Yes'&lt;BR /&gt;END AS accom_granted&lt;/P&gt;
&lt;P&gt;FROM /*D_DataShare.dbo.*/ DATASHAR.Forbearance_HST_Curr&lt;/P&gt;
&lt;P&gt;UNION&lt;/P&gt;
&lt;P&gt;SELECT &lt;BR /&gt;LN_NO &lt;BR /&gt;,LEGACY_COMPANY &lt;BR /&gt;,INITIAL_REQUEST_DT &lt;BR /&gt;,ACCOMMODATION_TYPE &lt;BR /&gt;,REQ_CHANNEL &lt;BR /&gt;,INVESTOR_INSURER &lt;BR /&gt;,LN_1ST_PRIN_BA &lt;BR /&gt;,DEL_BUCKET &lt;BR /&gt;,FC_STATUS &lt;BR /&gt;,BKR_STATUS &lt;BR /&gt;,LM_STATUS_CD &lt;BR /&gt;,LM_STATUS_CHG_DT &lt;BR /&gt;,FP_STAT_CD &lt;BR /&gt;,FP_CREAT_DT &lt;BR /&gt;,FP_PROMISE_QT &lt;BR /&gt;,FP_FST_PR_DU_DT &lt;BR /&gt;,FP_LST_PR_DU_DT &lt;BR /&gt;,CASE &lt;BR /&gt;WHEN CA_ACR_STAT_CD = 'ACCRUING' THEN 'ACCRUAL'&lt;BR /&gt;WHEN CA_ACR_STAT_CD = 'NON ACCRUAL' THEN 'NON-ACCRUAL' &lt;BR /&gt;ELSE '' &lt;BR /&gt;END AS ACCRUAL_STATUS /*dif*/&lt;BR /&gt;,PR_ALPHA_STATE_CD &lt;BR /&gt;,LN_NXT_PMT_DUE_DT &lt;BR /&gt;,ASSISTANCE_STAGE &lt;BR /&gt;,CASE &lt;BR /&gt;WHEN ASSISTANCE_STAGE IN ('FB PLAN NOT SETUP', 'CLIENT CANCELLED ASSISTANCE') THEN 'No' &lt;BR /&gt;ELSE 'Yes'&lt;BR /&gt;END AS accom_granted&lt;/P&gt;
&lt;P&gt;FROM /*D_DataShare.dbo.*/ DATASHAR.Forbearance_HBBT_Curr&lt;/P&gt;
&lt;P&gt;/*);&lt;/P&gt;
&lt;P&gt;DISCONNECT FROM DATASHAR;*/ ;&lt;/P&gt;
&lt;P&gt;QUIT;&lt;/P&gt;
&lt;P&gt;ERROR: Column 15 from the first contributor of UNION is not the same type as its counterpart from the second.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this mean every field before the union must be the exact datatype as after the union???&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 17:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-error-question/m-p/665859#M199146</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2020-06-29T17:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Union error question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-error-question/m-p/665861#M199148</link>
      <description>&lt;P&gt;Yes. See&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;'s expanded answer to this question:&amp;nbsp; &lt;A href="https://communities.sas.com/t5/SAS-Programming/Error-Message-When-performing-Union-All/m-p/588053/highlight/true#M168009" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Error-Message-When-performing-Union-All/m-p/588053/highlight/true#M168009&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 17:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-error-question/m-p/665861#M199148</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-06-29T17:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Union error question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-error-question/m-p/665867#M199152</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;ERROR: Column 15 from the first contributor of UNION is not the same type as its counterpart from the second.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Does this mean every field before the union must be the exact datatype as after the union???&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, the types need to be the same in the queries. You cannot have a variable that's character and numeric in the same column for example.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 17:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-error-question/m-p/665867#M199152</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-29T17:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Union error question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-error-question/m-p/665868#M199153</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this mean every field before the union must be the exact datatype as after the union???&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Exactly. Columns in database tables and/or SAS datasets have the same attributes throughout the table, so you must provide the same when creating a new table.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 17:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-error-question/m-p/665868#M199153</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-29T17:42:43Z</dc:date>
    </item>
  </channel>
</rss>

