<?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: Help to understand If-then-do-end vs. %if %then %do %end in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141513#M37772</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza, Jaap, Tom and Cynthia,&lt;/P&gt;&lt;P&gt;Many thanks to each one of you for this help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Cynthia,&lt;BR /&gt;Your paper is very helpful for me. Thank you very much for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Miris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Mar 2014 12:53:04 GMT</pubDate>
    <dc:creator>Mirisage</dc:creator>
    <dc:date>2014-03-13T12:53:04Z</dc:date>
    <item>
      <title>Help to understand If-then-do-end vs. %if %then %do %end</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141508#M37767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG style="color: #000081; font-family: 'Courier New';"&gt;Hi SAS Forum,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #376092; font-size: 12pt;"&gt;I did a literature survey to understand the difference between “If-then-do-end” vs. %if %then %do %end.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #376092; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: #376092; font-size: 12pt;"&gt;Below conditional logic code (SUGI29 paper 243-29 by Slaughter and Delwiche acknowledged) prints data set called “orders” if the current day is Monday. And creates a table using proc tabulate if the current day is Friday. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000081; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: #000081;"&gt;%MACRO &lt;/SPAN&gt;&lt;EM style="color: black; font-family: 'Courier New';"&gt;reports&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;%IF &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;amp;SYSDAY = Monday &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;%THEN %DO&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;PROC PRINT DATA = orders &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;NOOBS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;FORMAT OrderDate &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: #008181;"&gt;DATE7.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;TITLE &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: #810081;"&gt;"&amp;amp;SYSDAY Report: Current Orders"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;%END&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;%ELSE %IF &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;&amp;amp;SYSDAY = Friday &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;%THEN %DO&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;PROC TABULATE DATA = orders;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;CLASS CustomerID;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;VAR Quantity;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;TABLE CustomerID ALL, Quantity;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;TITLE &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: #810081;"&gt;"&amp;amp;SYSDAY Report: Summary of Orders"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;%END&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: #000081;"&gt;%MEND &lt;/SPAN&gt;&lt;EM style="color: black; font-family: 'Courier New';"&gt;reports&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000081; font-family: 'Courier New';"&gt;RUN&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;%&lt;STRONG&gt;&lt;EM&gt;reports&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000081; font-family: 'Courier New';"&gt;RUN&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;Q: Why cannot we simply replace all the places having &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;%IF %THEN %DO %END &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;and &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue;"&gt;%ELSE %IF %THEN %DO %END &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;with standard &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: #c00000;"&gt;IF THEN DO END &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #c00000;"&gt;ELSE IF THEN DO END ?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #c00000;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #376092;"&gt;Sorry if my question looks like a stupid one. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #376092;"&gt;Miris&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 18:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141508#M37767</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2014-03-12T18:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help to understand If-then-do-end vs. %if %then %do %end</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141509#M37768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF/THEN/DO/etc work inside a data step and or procs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%IF/%THEN/%DO/%etc work in macro code, for example not in a data step. So they are used to conditionally execute a data step/proc. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 19:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141509#M37768</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-03-12T19:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help to understand If-then-do-end vs. %if %then %do %end</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141510#M37769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are many languages being mixed in your daily SAS usage.&lt;/P&gt;&lt;P&gt;SAS macro language is different from the data-step and that is different to using a proc and there are more.&lt;/P&gt;&lt;P&gt;See: &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p0znr2zp0ubdzjn10wmhw0y2ef1q.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p0znr2zp0ubdzjn10wmhw0y2ef1q.htm"&gt;SAS(R) 9.3 Macro Language: Reference&lt;/A&gt; how it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As being different languages being processed at different moments the interactions can be sometimes a challenge.&lt;/P&gt;&lt;P&gt;It is the programmers task to understand that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same intention, different words as Reeza.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 21:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141510#M37769</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-03-12T21:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help to understand If-then-do-end vs. %if %then %do %end</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141511#M37770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macro logic is used to conditionally generate code that is then passed onto regular SAS to interpret and execute. &lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;In another sense you can think of them as two separate processes.&amp;nbsp; The different syntax (% versus no %) are what keeps the &lt;/SPAN&gt;interpreter (and the programmer) from getting confused.&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 23:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141511#M37770</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-03-12T23:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help to understand If-then-do-end vs. %if %then %do %end</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141512#M37771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt; I explained a lot of these concepts for the beginner in this paper:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings13/120-2013.pdf" title="http://support.sas.com/resources/papers/proceedings13/120-2013.pdf"&gt;http://support.sas.com/resources/papers/proceedings13/120-2013.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 05:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141512#M37771</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-03-13T05:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help to understand If-then-do-end vs. %if %then %do %end</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141513#M37772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza, Jaap, Tom and Cynthia,&lt;/P&gt;&lt;P&gt;Many thanks to each one of you for this help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Cynthia,&lt;BR /&gt;Your paper is very helpful for me. Thank you very much for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Miris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 12:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-to-understand-If-then-do-end-vs-if-then-do-end/m-p/141513#M37772</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2014-03-13T12:53:04Z</dc:date>
    </item>
  </channel>
</rss>

