<?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 Problem with showing results after creating a column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-showing-results-after-creating-a-column/m-p/793435#M254322</link>
    <description>&lt;P&gt;I have a ringing situation, because I created a column with case when, but after run it shows that all fields are empty, but if I create a query with one of the conditions, it shows the results. The same in Excel, when it will generate a SAS file, it shows that there are empty fields, but when I created a pivot table, it shows me the results.&lt;BR /&gt;What could it be caused by ? &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gieorgie_0-1643617848036.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67983i3C9B8833A63BF80E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gieorgie_0-1643617848036.png" alt="Gieorgie_0-1643617848036.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My code :&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table kredyty as
select *,
	case
				when (DEF_PREV_MONTH) = '0' and (spr_DEFAULT) = '1' then '1' 		
				when (DEF_PREV_MONTH) = '1' and (spr_DEFAULT) = '1' then '0' 		
				end													as NEW_DEFAULT

				from kredyty as a
				left join (select spr_NRB, DEF_PREV_MONTH from NewDef) as b on a.spr_NRB = b.spr_NRB
;
				quit;&lt;/PRE&gt;</description>
    <pubDate>Mon, 31 Jan 2022 08:34:47 GMT</pubDate>
    <dc:creator>Gieorgie</dc:creator>
    <dc:date>2022-01-31T08:34:47Z</dc:date>
    <item>
      <title>Problem with showing results after creating a column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-showing-results-after-creating-a-column/m-p/793435#M254322</link>
      <description>&lt;P&gt;I have a ringing situation, because I created a column with case when, but after run it shows that all fields are empty, but if I create a query with one of the conditions, it shows the results. The same in Excel, when it will generate a SAS file, it shows that there are empty fields, but when I created a pivot table, it shows me the results.&lt;BR /&gt;What could it be caused by ? &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gieorgie_0-1643617848036.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67983i3C9B8833A63BF80E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gieorgie_0-1643617848036.png" alt="Gieorgie_0-1643617848036.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My code :&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table kredyty as
select *,
	case
				when (DEF_PREV_MONTH) = '0' and (spr_DEFAULT) = '1' then '1' 		
				when (DEF_PREV_MONTH) = '1' and (spr_DEFAULT) = '1' then '0' 		
				end													as NEW_DEFAULT

				from kredyty as a
				left join (select spr_NRB, DEF_PREV_MONTH from NewDef) as b on a.spr_NRB = b.spr_NRB
;
				quit;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Jan 2022 08:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-showing-results-after-creating-a-column/m-p/793435#M254322</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2022-01-31T08:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with showing results after creating a column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-showing-results-after-creating-a-column/m-p/793444#M254329</link>
      <description>&lt;P&gt;I note that you do not have any ELSE clause on your CASE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This means that if spr_DEFAULT is anything other than '1', you will get a missing (blank) value, and if DEF_PREV_MONTH is not '1' or '0' you will also get a blank value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is probably what happens; but unless you can share some actual data (as datastep code, please), it is hard to say where things go wrong.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 09:56:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-showing-results-after-creating-a-column/m-p/793444#M254329</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2022-01-31T09:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with showing results after creating a column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-showing-results-after-creating-a-column/m-p/793447#M254331</link>
      <description>It is as you say, thanks for the advice;)</description>
      <pubDate>Mon, 31 Jan 2022 10:23:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-showing-results-after-creating-a-column/m-p/793447#M254331</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2022-01-31T10:23:31Z</dc:date>
    </item>
  </channel>
</rss>

