<?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 create a dummy row using proc sql in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-dummy-row-using-proc-sql/m-p/518715#M3609</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table dummy
       (Gender char(10),
        count num(8)
        );

insert into dummy
    values('Female',3)
    values('Male',2);
	 
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 05 Dec 2018 09:40:34 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2018-12-05T09:40:34Z</dc:date>
    <item>
      <title>How to create a dummy row using proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-dummy-row-using-proc-sql/m-p/518713#M3608</link>
      <description>&lt;P&gt;I want to create a dummy row using proc SQL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below example we can get male and female count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And for that&amp;nbsp;GENDER&amp;nbsp;we usually create a dummy data set and set back. So is it possible do the same using proc SQL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Example :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gender&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Male&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800080"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Female&amp;nbsp; &amp;nbsp; 3&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 09:34:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-dummy-row-using-proc-sql/m-p/518713#M3608</guid>
      <dc:creator>jashu14</dc:creator>
      <dc:date>2018-12-05T09:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dummy row using proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-dummy-row-using-proc-sql/m-p/518715#M3609</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table dummy
       (Gender char(10),
        count num(8)
        );

insert into dummy
    values('Female',3)
    values('Male',2);
	 
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Dec 2018 09:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-dummy-row-using-proc-sql/m-p/518715#M3609</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-12-05T09:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dummy row using proc sql</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-dummy-row-using-proc-sql/m-p/518716#M3610</link>
      <description>&lt;P&gt;Do you mean that you want to create a count of observations for the two possible values of gender?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A SQL approach would be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select
  'Male' as gender length = 6,
  count(*) as count
from have
where gender = 'Male'
union all
select
  'Female' as gender,
  count(*)
from have
where gender = 'Female'
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that this is very much a waste of code space and performance as this will do the same:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have noprint;
table gender / out=want (drop=percent);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See Maxim 14.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 09:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-dummy-row-using-proc-sql/m-p/518716#M3610</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-05T09:46:33Z</dc:date>
    </item>
  </channel>
</rss>

