<?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: Can anybody explain me why we use '||' in call %execute() routine?? below is the given problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144382#M261862</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;|| is the concatenation operator in SAS.&amp;nbsp; In Excel you would use &amp;amp;.&lt;/P&gt;&lt;P&gt;Call execute(&amp;lt;code to be executed&amp;gt;) allows SAS to place a section of code into the program flow to be executed immediately after the data step concludes.&amp;nbsp; In this case the code to be executed is a macro rept which is intended to draw a vbar chart on var1 for a given date drawing data from the reptdata table.&amp;nbsp; The data _null_ step is intended to provide the date parameter from a table called dates.&amp;nbsp; Lets say the date, being numeric, has the unformatted value 12345 (I have no idea what date that is).&amp;nbsp; Then the code inserted into the program flow should be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;%rept(12345,var1,reptdata)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;To get this result the data _null_ step has to join some constant text values: &lt;EM&gt;%rept(&lt;/EM&gt;&amp;nbsp;&amp;nbsp; and then later&amp;nbsp;&amp;nbsp; &lt;EM&gt;,var1,reptdata)&lt;/EM&gt;&amp;nbsp;&amp;nbsp; with the date value 12345 taken from the dates table in the middle.&amp;nbsp; The expression could be simplified as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;call execute('%rept('&amp;nbsp; ||date||&amp;nbsp; ', var1, reptdata)');&amp;nbsp; /* spaces added for clarity */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.8000001907349px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;since apparently for this example var1 from &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;reptdata&lt;/SPAN&gt; is always used when table dates is used as the source of date data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 14 Sep 2014 12:41:26 GMT</pubDate>
    <dc:creator>RichardinOz</dc:creator>
    <dc:date>2014-09-14T12:41:26Z</dc:date>
    <item>
      <title>Can anybody explain me why we use '||' in call %execute() routine?? below is the given problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144380#M261860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%macro rept(dat,a,dsn);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; proc chart data=&amp;amp;dsn;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title "Chart for &amp;amp;dat";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where(date="&amp;amp;dat");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbar &amp;amp;a;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%mend rept;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set dates;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call execute('%rept('||date||','||'var1,reptdata)'); /* here is use of pipe that I need to know */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Sep 2014 11:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144380#M261860</guid>
      <dc:creator>Paari</dc:creator>
      <dc:date>2014-09-14T11:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can anybody explain me why we use '||' in call %execute() routine?? below is the given problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144381#M261861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H2 class="xis-title" style="font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #353535; font-size: 16px; margin-top: 0.5em; background-color: #ffffff;"&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/67401/HTML/default/viewer.htm#p00iah2thp63bmn1lt20esag14lh.htm"&gt;The Concatenation Operator&lt;/A&gt;&lt;/H2&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Sep 2014 12:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144381#M261861</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-09-14T12:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can anybody explain me why we use '||' in call %execute() routine?? below is the given problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144382#M261862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;|| is the concatenation operator in SAS.&amp;nbsp; In Excel you would use &amp;amp;.&lt;/P&gt;&lt;P&gt;Call execute(&amp;lt;code to be executed&amp;gt;) allows SAS to place a section of code into the program flow to be executed immediately after the data step concludes.&amp;nbsp; In this case the code to be executed is a macro rept which is intended to draw a vbar chart on var1 for a given date drawing data from the reptdata table.&amp;nbsp; The data _null_ step is intended to provide the date parameter from a table called dates.&amp;nbsp; Lets say the date, being numeric, has the unformatted value 12345 (I have no idea what date that is).&amp;nbsp; Then the code inserted into the program flow should be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;%rept(12345,var1,reptdata)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;To get this result the data _null_ step has to join some constant text values: &lt;EM&gt;%rept(&lt;/EM&gt;&amp;nbsp;&amp;nbsp; and then later&amp;nbsp;&amp;nbsp; &lt;EM&gt;,var1,reptdata)&lt;/EM&gt;&amp;nbsp;&amp;nbsp; with the date value 12345 taken from the dates table in the middle.&amp;nbsp; The expression could be simplified as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;call execute('%rept('&amp;nbsp; ||date||&amp;nbsp; ', var1, reptdata)');&amp;nbsp; /* spaces added for clarity */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.8000001907349px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;since apparently for this example var1 from &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;reptdata&lt;/SPAN&gt; is always used when table dates is used as the source of date data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Sep 2014 12:41:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144382#M261862</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-09-14T12:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can anybody explain me why we use '||' in call %execute() routine?? below is the given problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144383#M261863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Stated in &lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543697.htm"&gt;CALL EXECUTE Routine&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;to generate a macro invocation whose parameter is the value of the variable resolved by the DATA step to a macro text expression or a SAS statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Sep 2014 12:54:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144383#M261863</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2014-09-14T12:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can anybody explain me why we use '||' in call %execute() routine?? below is the given problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144384#M261864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you like, you could use the cats() function instead, which will give you commas instead of the double pipes.&lt;/P&gt;&lt;P&gt;A bit more readable if you ask me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Sep 2014 14:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-anybody-explain-me-why-we-use-in-call-execute-routine-below/m-p/144384#M261864</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-09-14T14:39:08Z</dc:date>
    </item>
  </channel>
</rss>

