<?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: Add Record in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554033#M9439</link>
    <description>&lt;P&gt;Make your own shell with all the values:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data shell;
   sum=0;
   do source='A', 'B', 'C';
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can merge it with your original data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   merge shell have;
   by source;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 25 Apr 2019 17:34:23 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-04-25T17:34:23Z</dc:date>
    <item>
      <title>Add Record</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554026#M9436</link>
      <description>&lt;P&gt;Source&lt;BR /&gt;A&lt;BR /&gt;B&lt;BR /&gt;C&lt;/P&gt;&lt;P&gt;We expect to see A B C as sources. But sometimes the source may not have all three values.&lt;BR /&gt;I would like to add missing source in this case C with sum 0 to final table.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Source&amp;nbsp; &amp;nbsp; &amp;nbsp; TA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sum&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; diabetes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&lt;BR /&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;diabetes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;200&lt;BR /&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; diabetes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 17:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554026#M9436</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2019-04-25T17:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add Record</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554029#M9437</link>
      <description>&lt;P&gt;How are you generating the table? Code at least.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might be able to use one of the procedures that supports PRELOADFMT to include all levels of a format for a variable in a table. That would require 1) a custom format for the variable with all of the levels and 2) the appropriate syntax for using PRELOADFMT.&lt;/P&gt;
&lt;P&gt;Each procedure that allows use of the PRELOADFMT option has slight differences in syntax requirements so the following is only one way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value $source
'A' = 'A'
'B' = 'B'
'C' = 'C'
;
run;

data example;
   input source $ value;
datalines;
A 123
A 5
B 43
B 18
A 8
;
run;

proc tabulate data=example;
   class source /preloadfmt  ;
   format source $source.;
   var value;
   table source,
         value*sum
         / printmiss misstext='0'
  ;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Apr 2019 17:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554029#M9437</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-25T17:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add Record</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554030#M9438</link>
      <description>&lt;P&gt;I don't understand this. Are A, B and C data sets or variables or?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please be more specific&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 17:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554030#M9438</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-04-25T17:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add Record</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554033#M9439</link>
      <description>&lt;P&gt;Make your own shell with all the values:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data shell;
   sum=0;
   do source='A', 'B', 'C';
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can merge it with your original data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   merge shell have;
   by source;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Apr 2019 17:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554033#M9439</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-04-25T17:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Add Record</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554264#M9476</link>
      <description>&lt;PRE&gt;data level;
input source $;
cards;
A
B
C
;
run;

data example;
   input source $ value;
datalines;
A 123
A 5
B 43
B 18
A 8
;
run;
proc summary data=example classdata=level nway;
class source;
var value;
output out=want sum=;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 14:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-Record/m-p/554264#M9476</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-04-26T14:02:37Z</dc:date>
    </item>
  </channel>
</rss>

