<?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: using the call execute in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206283#M306501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your request is very confusing.&amp;nbsp; If you want find_days in your original dataset then just mere it on:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table THREE as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TWO.*,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B.FIND_DAYS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TWO TWO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left join (select&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em; background-color: #ffffff;"&gt; count(*) from&lt;/SPAN&gt; from HOLLYDAY where IN_DATE &amp;lt;= &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;HOLLYDAY&lt;/SPAN&gt; and OUT_DATE &amp;gt;= HOLLYDAY)&amp;nbsp; B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1=1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for your question on call execute, I am afraid I do not follow at all what you are saying.&amp;nbsp; Post test data in a datastep, and required output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jul 2015 08:23:49 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-07-20T08:23:49Z</dc:date>
    <item>
      <title>using the call execute, proc sql, or macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206282#M306500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi everyone,&lt;/P&gt;&lt;P&gt;i have the following issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have created the table &lt;STRONG&gt;Hollyday_Tab&lt;/STRONG&gt; containing one column (&lt;STRONG&gt;Hollyday&lt;/STRONG&gt;). A list of hollydays, on which the workers &lt;SPAN style="font-size: 13.3333330154419px;"&gt;are not supposed to work. here is a subset&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Hollyday&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="0" style="border: 1px solid #000000; width: 789px; height: 8px;" width="787"&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;01JAN2008&lt;/P&gt;&lt;P&gt;21MAR2008&lt;/P&gt;&lt;P&gt;23MAR2008&lt;/P&gt;&lt;P&gt;24MAR2008&lt;/P&gt;&lt;P&gt;01MAY2008&lt;/P&gt;&lt;P&gt;01MAY2008&lt;/P&gt;&lt;P&gt;11MAY2008&lt;/P&gt;&lt;P&gt;12MAY2008&lt;/P&gt;&lt;P&gt;03OCT2008&lt;/P&gt;&lt;P&gt;24DEC2008&lt;/P&gt;&lt;P&gt;25DEC2008&lt;/P&gt;&lt;P&gt;26DEC2008&lt;/P&gt;&lt;P&gt;31DEC2008&lt;/P&gt;&lt;P&gt;01JAN2009&lt;/P&gt;&lt;P&gt;10APR2009&lt;/P&gt;&lt;P&gt;12APR2009&lt;/P&gt;&lt;P&gt;13APR2009&lt;/P&gt;&lt;P&gt;01MAY2009&lt;/P&gt;&lt;P&gt;21MAY2009&lt;/P&gt;&lt;P&gt;31MAY2009&lt;/P&gt;&lt;P&gt;01JUN2009&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;subset Dataset &lt;STRONG&gt;One&lt;/STRONG&gt; contains two columns: the dates on which the documents are available (&lt;STRONG&gt;in_date&lt;/STRONG&gt;) and the deadline to be done with the documents (&lt;STRONG&gt;out_date&lt;/STRONG&gt;). However, the working_days for each document start the next day after its in_date.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;In_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out_date&lt;/P&gt;&lt;TABLE style="font-size: 13.3333330154419px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;14.11.2006&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;14.11.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20.11.2006&lt;/TD&gt;&lt;TD&gt;20.11.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01.12.2006&lt;/TD&gt;&lt;TD&gt;01.12.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;05.12.2006&lt;/TD&gt;&lt;TD&gt;05.12.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11.12.2006&lt;/TD&gt;&lt;TD&gt;11.12.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19.12.2006&lt;/TD&gt;&lt;TD&gt;19.12.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21.12.2006&lt;/TD&gt;&lt;TD&gt;21.12.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;08.02.2007&lt;/TD&gt;&lt;TD&gt;08.02.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;08.02.2007&lt;/TD&gt;&lt;TD&gt;08.02.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12.02.2007&lt;/TD&gt;&lt;TD&gt;12.02.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;26.02.2007&lt;/TD&gt;&lt;TD&gt;26.02.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14.03.2007&lt;/TD&gt;&lt;TD&gt;14.03.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17.04.2007&lt;/TD&gt;&lt;TD&gt;17.04.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17.04.2007&lt;/TD&gt;&lt;TD&gt;17.04.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;07.06.2007&lt;/TD&gt;&lt;TD&gt;07.06.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;29.06.2007&lt;/TD&gt;&lt;TD&gt;29.06.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30.07.2007&lt;/TD&gt;&lt;TD&gt;30.07.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;04.09.2007&lt;/TD&gt;&lt;TD&gt;04.09.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;25.09.2007&lt;/TD&gt;&lt;TD&gt;25.09.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;09.11.2007&lt;/TD&gt;&lt;TD&gt;09.11.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12.07.2006&lt;/TD&gt;&lt;TD&gt;16.08.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;29.03.2006&lt;/TD&gt;&lt;TD&gt;29.03.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;07.09.2006&lt;/TD&gt;&lt;TD&gt;07.09.2006&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;29.08.2007&lt;/TD&gt;&lt;TD&gt;29.08.2007&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;19.01.2008&lt;/TD&gt;&lt;TD&gt;19.01.2008&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;25.07.2006&lt;/TD&gt;&lt;TD&gt;28.07.2010&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;i wrote a data step to count the number of days on which the workers do the job. the employee receives documents on &lt;STRONG&gt;in_date&lt;/STRONG&gt; and has until the &lt;STRONG&gt;out_date&lt;/STRONG&gt; to be done with them. And nobody works on saturdays and sundays.&lt;/P&gt;&lt;P&gt;note: working_process = working_days.&lt;/P&gt;&lt;P&gt; a&lt;/P&gt;&lt;P&gt;data Two ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set One;&lt;/P&gt;&lt;P&gt;&amp;nbsp; working_days=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if out_date &amp;gt;= in_date then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=(in_date + 1) to out_date;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if weekday(i) in (2,3,4,5,6) then &lt;SPAN style="font-size: 13.3333330154419px;"&gt;working_days&lt;/SPAN&gt; = &lt;SPAN style="font-size: 13.3333330154419px;"&gt;working_days&lt;/SPAN&gt; + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;working_process&lt;/SPAN&gt; = &lt;SPAN style="font-size: 13.3333330154419px;"&gt;working_days&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here comes my issue: the woking_days still includes the hollydays, on which the employees are not supposed to work. and i wrote a proc sql to count the number of hollydays between in_date and out_date,&lt;/P&gt;&lt;P&gt;which works well, when testing it with some random real in_date and out_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL NOPRINT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SELECT count(*) INTO :find_days&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Hollyday_tab&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WHERE in_date &amp;lt;= &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Hollyday&lt;/SPAN&gt; AND out_date &amp;gt;= &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Hollyday&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do i get the numeric value of the macrovariable find_days in my datastep?&lt;/P&gt;&lt;P&gt;how do i use the call execute within my data step to get the correct final result of working process? Which is working_process = working_days - find_days?&lt;/P&gt;&lt;P&gt;is there another possibility else than call execute to soleve the problem?&lt;/P&gt;&lt;P&gt;Thx!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 07:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206282#M306500</guid>
      <dc:creator>Landry</dc:creator>
      <dc:date>2015-07-20T07:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: using the call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206283#M306501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your request is very confusing.&amp;nbsp; If you want find_days in your original dataset then just mere it on:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table THREE as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TWO.*,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B.FIND_DAYS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TWO TWO&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left join (select&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em; background-color: #ffffff;"&gt; count(*) from&lt;/SPAN&gt; from HOLLYDAY where IN_DATE &amp;lt;= &lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;HOLLYDAY&lt;/SPAN&gt; and OUT_DATE &amp;gt;= HOLLYDAY)&amp;nbsp; B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1=1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for your question on call execute, I am afraid I do not follow at all what you are saying.&amp;nbsp; Post test data in a datastep, and required output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 08:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206283#M306501</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-20T08:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: using the call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206284#M306502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; Thx for the answer, i'll try it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;obviously i cannot whrite the following proc sql statement within the data step:&lt;/P&gt;&lt;P&gt;weekday(i) in (2,3,4,5,6) and where i not in (select hollyday from Hollyday). &lt;/P&gt;&lt;P&gt; so i wanted to know, how i should write tthe sql statement in a call execute, which is in the data step. besause i saw that the call execute is a possibility to run another step within the data step.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 08:46:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206284#M306502</guid>
      <dc:creator>Landry</dc:creator>
      <dc:date>2015-07-20T08:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: using the call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206285#M306503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, you can subquery in proc sql:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table WANT as&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC.ABC,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (select TASK from XYZ where ABC=A.ABC) as TASK&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, call execute does Not execute one datastep within another.&amp;nbsp; What it does it takes the string - i.e. call execute('data xyz'), and puts that string into the compiler After the current datastep has finished.&amp;nbsp; If you explain clearly (with test data and expected output) we might be able to provide some code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 08:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206285#M306503</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-20T08:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: using the call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206286#M306504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have provided you with some test data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 09:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-the-call-execute-proc-sql-or-macro-variable/m-p/206286#M306504</guid>
      <dc:creator>Landry</dc:creator>
      <dc:date>2015-07-20T09:36:25Z</dc:date>
    </item>
  </channel>
</rss>

