<?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: Creating a Macro Program to Summarise a Numeric Variable From Any Data Set. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-Program-to-Summarise-a-Numeric-Variable-From/m-p/703965#M215758</link>
    <description>&lt;P&gt;I agree that the advice given above is sound. You have to create &lt;EM&gt;working&lt;/EM&gt; SAS code for one such variable from one such data set, without macros and without macro variables, before you can write a macro. If you don't have &lt;EM&gt;working&lt;/EM&gt; SAS code without macros and without macro variables, then you will never achieve a working macro.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So show us the &lt;EM&gt;working &lt;/EM&gt;SAS code with no macros and no macro variables that will do what you want for one numeric variable.&lt;/P&gt;</description>
    <pubDate>Sun, 06 Dec 2020 21:18:19 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-12-06T21:18:19Z</dc:date>
    <item>
      <title>Creating a Macro Program to Summarise a Numeric Variable From Any Data Set.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-Program-to-Summarise-a-Numeric-Variable-From/m-p/703931#M215742</link>
      <description>&lt;P&gt;Hello SAS Communities!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to macro programming and need some help in creating a macro program. Any help will be appreciated! I am wanting to create a macro program named 'GraphStats' which may be used to summarise a numeric variable from any data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The macro should be able to generate 2 pieces of output (i.e. the macro should contain 2 steps):&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. A histogram with PROC SGPLOT&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Summary statistics with PROC SUMMARY&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The macro should also contain the following 4 parameters:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. ‘DSName’ to specify the data set name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. ‘Vbl’ to specify the numeric variable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. ‘Stats’ to specify summary statistics. Include the defaults statistics of N, MEAN, and STDEV&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4. ‘NDec’ to specify the number of decimals. Include a default value of 1&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;- James&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-Program-to-Summarise-a-Numeric-Variable-From/m-p/703931#M215742</guid>
      <dc:creator>JamesPatton01</dc:creator>
      <dc:date>2020-12-10T15:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Macro Program to Summarise a Numeric Variable From Any Data Set.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-Program-to-Summarise-a-Numeric-Variable-From/m-p/703932#M215743</link>
      <description>&lt;P&gt;You have all the information you need to write the %MACRO statement that begins the definition of the macro.&lt;/P&gt;
&lt;P&gt;But to actually write the macro you need to first produce working PROC SGPLOT and PROC SUMMARY statements. First write the code without and macro definition or macro variables. Then you can think about how to convert it into a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hint if you want PROC SUMMARY to produce output you need to add the PRINT option. At which point you should have just called it by its other name of PROC MEANS where the PRINT option is on by default.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 16:14:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-Program-to-Summarise-a-Numeric-Variable-From/m-p/703932#M215743</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-12-06T16:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Macro Program to Summarise a Numeric Variable From Any Data Set.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-Program-to-Summarise-a-Numeric-Variable-From/m-p/703943#M215746</link>
      <description>Hi: This paper, entitled Macro Basics for New SAS Users &lt;A href="https://support.sas.com/resources/papers/proceedings13/120-2013.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings13/120-2013.pdf&lt;/A&gt; shows you the entire process you need to go through to write your macro program. The key is to start with a working SAS program.&lt;BR /&gt;Cynthia</description>
      <pubDate>Sun, 06 Dec 2020 18:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-Program-to-Summarise-a-Numeric-Variable-From/m-p/703943#M215746</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-12-06T18:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Macro Program to Summarise a Numeric Variable From Any Data Set.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-Program-to-Summarise-a-Numeric-Variable-From/m-p/703965#M215758</link>
      <description>&lt;P&gt;I agree that the advice given above is sound. You have to create &lt;EM&gt;working&lt;/EM&gt; SAS code for one such variable from one such data set, without macros and without macro variables, before you can write a macro. If you don't have &lt;EM&gt;working&lt;/EM&gt; SAS code without macros and without macro variables, then you will never achieve a working macro.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So show us the &lt;EM&gt;working &lt;/EM&gt;SAS code with no macros and no macro variables that will do what you want for one numeric variable.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Dec 2020 21:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Macro-Program-to-Summarise-a-Numeric-Variable-From/m-p/703965#M215758</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-06T21:18:19Z</dc:date>
    </item>
  </channel>
</rss>

