<?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: probelm using macro in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298794#M1122</link>
    <description>&lt;P&gt;Yes, if you want it to do something on a Thursday, you have to change friday to Thursday (not thursday).&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2016 20:31:24 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-09-15T20:31:24Z</dc:date>
    <item>
      <title>probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298776#M1115</link>
      <description>&lt;P&gt;data cudata;&lt;BR /&gt;input ID Orderdate$ Model$12.&amp;nbsp; Quantity ;&lt;BR /&gt;cards;&lt;BR /&gt;287 15OCT03 DeltaBreeze 15&lt;BR /&gt;287 15OCT03 SantaAna&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;274 16OCT03 JetStream&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;174 17OCT03 SantaAna&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&lt;BR /&gt;174 17OCT03 Noreaster&amp;nbsp;&amp;nbsp; 5&lt;BR /&gt;174 17OCT03 Scirocco&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;347 18OCT03 Mistral&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;287 21OCT03 DeltaBreeze 30&lt;BR /&gt;287 21OCT03 SantaAna&amp;nbsp;&amp;nbsp;&amp;nbsp; 25&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro cus(dsn);&lt;/P&gt;&lt;P&gt;%if &amp;amp;sysday=monday&lt;BR /&gt;%then&amp;nbsp; %do;&lt;BR /&gt;proc print data=&amp;amp;dsn;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%else %if &amp;amp;sysday=friday&lt;BR /&gt;%then&amp;nbsp; %do;&lt;BR /&gt;proc summary data=&amp;amp;dsn;&lt;BR /&gt;class ID;&lt;BR /&gt;var Quantity ;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend cus;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%cus(cudata)&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No errors are coming up but still not getting the desire output&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 19:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298776#M1115</guid>
      <dc:creator>rishabhmehra13</dc:creator>
      <dc:date>2016-09-15T19:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298779#M1116</link>
      <description>&lt;P&gt;The values of SYSDAY are Monday not monday, Friday not friday (capital first letter)&lt;/P&gt;
&lt;P&gt;Either use the actual returned results for &amp;amp;SYSDAY or %upcase or %lowcase everything to match.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 19:59:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298779#M1116</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-15T19:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298780#M1117</link>
      <description>Hi, still the same result, any other thing that can be done?&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Thu, 15 Sep 2016 20:02:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298780#M1117</guid>
      <dc:creator>rishabhmehra13</dc:creator>
      <dc:date>2016-09-15T20:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298787#M1118</link>
      <description>&lt;P&gt;What result do you desire when the day is Thursday?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 20:16:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298787#M1118</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-15T20:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298789#M1119</link>
      <description>If it is run on monday then print a detaik report and if on friday then a&lt;BR /&gt;summary report (no other day)&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Thu, 15 Sep 2016 20:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298789#M1119</guid>
      <dc:creator>rishabhmehra13</dc:creator>
      <dc:date>2016-09-15T20:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298790#M1120</link>
      <description>&lt;P&gt;Add &lt;STRONG&gt;%put SYSDAY = &amp;amp;sysday;&lt;/STRONG&gt; to your code;&lt;/P&gt;&lt;P&gt;Did you run it on Monday or Friday ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If YES - please upload the results you got and what you expected to get/&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 20:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298790#M1120</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-09-15T20:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298792#M1121</link>
      <description>Still the same no result.No i want to run it for thursday to give the&lt;BR /&gt;summary.i have changed the sysday frm friday to thursday now?&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Thu, 15 Sep 2016 20:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298792#M1121</guid>
      <dc:creator>rishabhmehra13</dc:creator>
      <dc:date>2016-09-15T20:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298794#M1122</link>
      <description>&lt;P&gt;Yes, if you want it to do something on a Thursday, you have to change friday to Thursday (not thursday).&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 20:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298794#M1122</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-15T20:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298795#M1123</link>
      <description>&lt;P&gt;data cudata;&lt;BR /&gt;input ID Orderdate$ Model$12.&amp;nbsp; Quantity ;&lt;BR /&gt;cards;&lt;BR /&gt;287 15OCT03 DeltaBreeze 15&lt;BR /&gt;287 15OCT03 SantaAna&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;BR /&gt;274 16OCT03 JetStream&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;174 17OCT03 SantaAna&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&lt;BR /&gt;174 17OCT03 Noreaster&amp;nbsp;&amp;nbsp; 5&lt;BR /&gt;174 17OCT03 Scirocco&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;347 18OCT03 Mistral&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;BR /&gt;287 21OCT03 DeltaBreeze 30&lt;BR /&gt;287 21OCT03 SantaAna&amp;nbsp;&amp;nbsp;&amp;nbsp; 25&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro cus(dsn);&lt;/P&gt;&lt;P&gt;%if &amp;amp;sysday=Monday&lt;BR /&gt;%then&amp;nbsp; %do;&lt;BR /&gt;proc print data=&amp;amp;dsn;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%else %if &amp;amp;sysday=Thursday&lt;BR /&gt;%then&amp;nbsp; %do;&lt;BR /&gt;proc summary data=&amp;amp;dsn;&lt;BR /&gt;class ID;&lt;BR /&gt;var Quantity ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;%put SYSDAY=&amp;amp;sysday;&lt;/P&gt;&lt;P&gt;%mend cus;&lt;/P&gt;&lt;P&gt;%cus(cudata);&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 20:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298795#M1123</guid>
      <dc:creator>rishabhmehra13</dc:creator>
      <dc:date>2016-09-15T20:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298796#M1124</link>
      <description>&lt;P&gt;Looks right.&amp;nbsp; Did you test it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I take it back.&amp;nbsp; PROC SUMMARY requires either the PRINT option or an OUTPUT statement.&amp;nbsp; Otherwise, there won't be any output.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 20:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298796#M1124</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-15T20:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298797#M1125</link>
      <description>Getting this error neither thr print option nor a valid output statement&lt;BR /&gt;has been given&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Thu, 15 Sep 2016 20:34:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298797#M1125</guid>
      <dc:creator>rishabhmehra13</dc:creator>
      <dc:date>2016-09-15T20:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298800#M1126</link>
      <description>&lt;P&gt;Yes, you put nonworking SAS code into a macro.&amp;nbsp; So it's no surprise that it still doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Get your PROC SUMMARY to work outside of a macro.&amp;nbsp; Then you will know what to put into the macro.&amp;nbsp; It could be as simple as adding the word PRINT to the end of the PROC statement.&amp;nbsp; But you will need to inspect the results to see if it does what you want it to do.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 20:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298800#M1126</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-15T20:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298809#M1127</link>
      <description>my question is write a macro that prints a detail report if you run it on&lt;BR /&gt;monday and a summary report if you run it on friday(no other days)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;now what should i do?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Thu, 15 Sep 2016 21:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298809#M1127</guid>
      <dc:creator>rishabhmehra13</dc:creator>
      <dc:date>2016-09-15T21:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298811#M1128</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/98572"&gt;@rishabhmehra13﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;1. Develop working non macro code&lt;/P&gt;
&lt;P&gt;2. Figure out how to determine day of week. SYSDATE should not be used since it reflects the date when SAS started.&lt;/P&gt;
&lt;P&gt;Use today() to get the date and then use WEEKDAY() to get the day of the week.&lt;/P&gt;
&lt;P&gt;3. Place code in macro logic - test your logic first with %PUT statements to make sure the evaluate correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your initial code:&lt;/P&gt;
&lt;P&gt;SYSDATE won't work - change using my comments in #2. Make sure to test what you're getting out of the today and weekday functions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your macro logic is correct. Not sure why your proc summary may not work, I haven't read all the messages here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 22:02:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298811#M1128</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-15T22:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: probelm using macro</title>
      <link>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298823#M1129</link>
      <description>&lt;P&gt;This assignment is unfair. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to understand that macro language doesn't generate any reports. &amp;nbsp;It only generates a SAS program. &amp;nbsp;When the SAS program runs, it can generate a report. &amp;nbsp;You can't make use of macro language until you know the SAS language statements it would take to generate the reports that you want. &amp;nbsp;With no macro language, you need to be able to construct a SAS language program that generates a detailed report, and a SAS language program that generates a summary report. &amp;nbsp;Only then can we talk about how to apply macro language. &amp;nbsp;(Just for the record, it looks like the macro portion of the program is in good shape. &amp;nbsp;But that's only part of the task.) &amp;nbsp;So develop those reporting programs with no macro language, make sure they work, get the format of the report approved so you won't need to change the SAS code later, and then they can be fit into the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 23:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/probelm-using-macro/m-p/298823#M1129</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-15T23:02:10Z</dc:date>
    </item>
  </channel>
</rss>

