<?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 to debug data step code? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504245#M134918</link>
    <description>&lt;P&gt;It is always a VERY BAD IDEA to have identically named variables in both datasets of a merge, if they are not used as "by" variables.&lt;/P&gt;
&lt;P&gt;Even if they are of the same type, which content will end up in the output is tricky to determine.&lt;/P&gt;
&lt;P&gt;A situation like yours is usually the result of bad logic design, and a failure to know your data (Maxim 3).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if those variables are not needed, why are they there at all?&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2018 10:35:52 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-10-15T10:35:52Z</dc:date>
    <item>
      <title>How to debug data step code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504201#M134897</link>
      <description>&lt;P&gt;Appreciate if someone of you guide me to resolve the following error? Variable KNDBEG and KNDEIN has mentioned as character but the error says it is defined as both character and numeric. I'm not certain to debug this error and to resolve the issue. Value of&amp;nbsp;&lt;SPAN&gt;KNDBEG and KNDEIN is '&lt;/SPAN&gt;2018-01-01' and it is character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;6412       data _null_ (drop=knkvpb knkvpb_v);
6413          merge work.W72HMG0G(in=vorige)
6414                db2jr.TBFR10(in=huidige);
ERROR: Variable KNDBEG has been defined as both character and numeric.
ERROR: Variable KNDEIN has been defined as both character and numeric.
6415          by khiref;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 05:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504201#M134897</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-15T05:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug data step code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504203#M134898</link>
      <description>&lt;P&gt;Run the following code and compare the definitions of kndbeg and kndein in each of your datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data = work.w72hmg0g;
run;

proc contents data = db2jr.tbfr10;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Oct 2018 05:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504203#M134898</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-10-15T05:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug data step code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504205#M134899</link>
      <description>&lt;P&gt;Variables KNDBEG and KNDEIN are defined as numeric in&amp;nbsp;db2jr.tbfr10. However I'm neither using these variables in my output nor in the selection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I know how I can resolve this error?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 06:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504205#M134899</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-15T06:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug data step code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504207#M134900</link>
      <description>&lt;P&gt;You've just identified the problem: Variables KNDBEG and KNDEIN are defined as numeric in&amp;nbsp;db2jr.tbfr10 and as character in the other dataset. They need to be the same type in both datasets for your MERGE to work.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 06:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504207#M134900</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-10-15T06:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug data step code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504209#M134902</link>
      <description>&lt;P&gt;to continuue&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;answer -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you don't need those variables in output you can drop then from the inputs.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 06:16:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504209#M134902</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-10-15T06:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug data step code?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504245#M134918</link>
      <description>&lt;P&gt;It is always a VERY BAD IDEA to have identically named variables in both datasets of a merge, if they are not used as "by" variables.&lt;/P&gt;
&lt;P&gt;Even if they are of the same type, which content will end up in the output is tricky to determine.&lt;/P&gt;
&lt;P&gt;A situation like yours is usually the result of bad logic design, and a failure to know your data (Maxim 3).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if those variables are not needed, why are they there at all?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 10:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-debug-data-step-code/m-p/504245#M134918</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-15T10:35:52Z</dc:date>
    </item>
  </channel>
</rss>

