<?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: Question about Level 2 Practice: Creating an Output Table with Custom Columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Question-about-Level-2-Practice-Creating-an-Output-Table-with/m-p/558521#M155880</link>
    <description>&lt;P&gt;The PRINT procedure does not support the KEEP statement.&amp;nbsp; That is really only used in a DATA step.&amp;nbsp; Plus even if it DID work it would not have any impact on the order of the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PRINT procedure does support the VAR statement. You use it to list the variables that you want to print.&lt;/P&gt;</description>
    <pubDate>Tue, 14 May 2019 03:09:01 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-05-14T03:09:01Z</dc:date>
    <item>
      <title>Question about Level 2 Practice: Creating an Output Table with Custom Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-Level-2-Practice-Creating-an-Output-Table-with/m-p/558517#M155878</link>
      <description>&lt;P&gt;Please help me with the Level 2 practice question in Week 5_Creating Summary Reports and Data.&lt;/P&gt;&lt;P&gt;I'm confused with the second question (continue with the first question).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the instructions.&lt;/P&gt;&lt;P&gt;1. Write a PROC PRINT step to print the&lt;STRONG&gt; rainstats&lt;/STRONG&gt; table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Suppress the printing observation numbers, and display column labels.&lt;/P&gt;&lt;P&gt;3. Display the columns in the following order: &lt;STRONG&gt;Name&lt;/STRONG&gt;, &lt;STRONG&gt;Year&lt;/STRONG&gt;, &lt;STRONG&gt;RainDays&lt;/STRONG&gt;, and &lt;STRONG&gt;TotalRain&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;4. Label &lt;STRONG&gt;Name&lt;/STRONG&gt; as Park Name, &lt;STRONG&gt;RainDays&lt;/STRONG&gt; as Number of Days Raining, and &lt;STRONG&gt;TotalRain&lt;/STRONG&gt; as Total Rain Amount(inches).&lt;/P&gt;&lt;P&gt;5. Use &lt;STRONG&gt;Rain Statistics by Year and Park&lt;/STRONG&gt; as the report title.&lt;/P&gt;&lt;P&gt;6. Submit the program and review the results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;My Answer&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "Rain Statistics by Year and Park";

proc print data=rainstats noobs label;
	&lt;FONT color="#3366FF"&gt;keep Name Year RainDays TotalRain;&lt;/FONT&gt;
	label Name="Park Name" RainDays="Number of Days Raining" 
		TotalRain="Total Rain Amount(inches)";
run;

title;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;lt;Answer&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "Rain Statistics by Year and Park";

proc print data=rainstats noobs label;
	&lt;FONT color="#FF00FF"&gt;var Name Year RainDays TotalRain;&lt;/FONT&gt;
	label Name="Park Name" RainDays="Number of Days Raining" 
		TotalRain="Total Rain Amount(inches)";
run;

title;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm confused with the usage of&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;keep&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;and&lt;/FONT&gt;&lt;SPAN style="background-color: #ffffff; font-family: HelevticaNeue-light, 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;var&lt;/STRONG&gt; &lt;/FONT&gt;&lt;SPAN style="background-color: #ffffff; font-family: HelevticaNeue-light, 'Helvetica Neue', Helvetica, Arial, sans-serif; white-space: normal;"&gt;statement.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;According to SAS document, &lt;STRONG&gt;keep&lt;/STRONG&gt; statement specifies the variables to include in output SAS data sets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone explain the difference between &lt;STRONG&gt;keep&lt;/STRONG&gt; and &lt;STRONG&gt;var&lt;/STRONG&gt; statement?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 02:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-Level-2-Practice-Creating-an-Output-Table-with/m-p/558517#M155878</guid>
      <dc:creator>easthill93</dc:creator>
      <dc:date>2019-05-14T02:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Level 2 Practice: Creating an Output Table with Custom Columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-Level-2-Practice-Creating-an-Output-Table-with/m-p/558521#M155880</link>
      <description>&lt;P&gt;The PRINT procedure does not support the KEEP statement.&amp;nbsp; That is really only used in a DATA step.&amp;nbsp; Plus even if it DID work it would not have any impact on the order of the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PRINT procedure does support the VAR statement. You use it to list the variables that you want to print.&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 03:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-Level-2-Practice-Creating-an-Output-Table-with/m-p/558521#M155880</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-14T03:09:01Z</dc:date>
    </item>
  </channel>
</rss>

