<?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: Assign value to missing value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582017#M165480</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp; &amp;nbsp; Do you mean , should a column be all missings, you want to replace with zero?&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 17:32:53 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-08-18T17:32:53Z</dc:date>
    <item>
      <title>Assign value to missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582016#M165479</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; temp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;infile&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATALINES&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dsd&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;missover&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; a $ b $ c $ d $;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CARDS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;, 2, 3, 4&lt;/P&gt;
&lt;P&gt;, 3, , 5&lt;/P&gt;
&lt;P&gt;, 3&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;This code will list a with no records.&amp;nbsp; Actually I am using a proc sql however using the above discussion.&amp;nbsp; In my proc sql, the A column does not show up if there were no records.&amp;nbsp; My question is, in the event of no records how can I still show the column and assign a 0 to show that there were no records for (in this case column A) The reason for this need is that I need to do a proc transpose and need to show all columns even if there are no records for a column&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 17:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582016#M165479</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-08-18T17:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value to missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582017#M165480</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp; &amp;nbsp; Do you mean , should a column be all missings, you want to replace with zero?&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 17:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582017#M165480</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-18T17:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value to missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582018#M165481</link>
      <description>&lt;P&gt;For example in this datastep column A would show up with no records.&amp;nbsp; So for A I still want to show the column A and assign 0 in the rows.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 18:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582018#M165481</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2019-08-18T18:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value to missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582019#M165482</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp; Well FWIW, I'm offering an approach based on my understanding of your objective. Of course you are better off waiting for somebody like Tom to chime in as they can provide more guided and pointed approaches/solutions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data temp;
infile DATALINES dsd missover;
input a $ b $ c $ d $;
CARDS;
, 2, 3, 4
, 3, , 5
, 3
;
/*Get a subset of columns that has all missing values*/
ods output nlevels =nlevels(where=(nlevels=nmisslevels));
proc freq data=temp nlevels ;
tables _all_ /noprint ;
run;

/*Assign zero for the identified columns in the previous step*/
data _null_;
set nlevels(keep=tablevar) end=z;
if _n_=1 then call execute('data want;set temp;');
call execute(tablevar||'='||'"0";');
if z then call execute('run;');
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 21:33:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582019#M165482</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-18T21:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assign value to missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582031#M165487</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before trying to provide a solution we need to understand the problem. What you describe doesn't add up for me because Proc Transpose will treat a missing like any other value and won't drop observations even if all variables are missing. Using your sample below code illustrates this behavior. So... What's the problem?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
  infile DATALINES dsd missover;
  input a $ b $ c $ d $;
  CARDS;
 
, 2, 3, 4
, 3, , 5
, 3
;
run;

proc transpose data=temp out=want prefix=wantvar_;
  var a b;
run;

proc print data=want;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 395px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31834iA8933D8F302C0E71/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 21:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-value-to-missing-value/m-p/582031#M165487</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-08-18T21:52:21Z</dc:date>
    </item>
  </channel>
</rss>

