<?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: Call execute to work with another program.sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143761#M296979</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And creating a macro variable from dataset:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set sashelp.class;&lt;/P&gt;&lt;P&gt;call symput('name'||put(_n_,2.), name);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; want;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;set&lt;/SPAN&gt; sashelp.class;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;call&lt;/SPAN&gt; symput(&lt;SPAN style="color: #942193;"&gt;'name'&lt;/SPAN&gt;||put(_n_,&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2.&lt;/STRONG&gt;&lt;/SPAN&gt; -l), name);&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;%put&lt;/SPAN&gt; &amp;amp;name1;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;%put&lt;/SPAN&gt; &amp;amp;name10;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Dec 2014 00:06:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-12-10T00:06:56Z</dc:date>
    <item>
      <title>Call execute to work with another program.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143759#M296977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that write "call execute" to work with two programs sas (for example) is no the useful way but, i'd like to work using it for this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've the following (example) situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Data test1;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Input name $ sector $;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Datalines;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;John Sales&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Bryan Comercial&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Tedd Sales&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Run;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="EN-US"&gt;Data test2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="EN-US"&gt;Set test1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="EN-US"&gt;Call execute (&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="EN-US"&gt;‘ %let var1 = “something1”;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&amp;nbsp; %let var2 = “&lt;SPAN lang="EN-US"&gt;something2&lt;/SPAN&gt;”;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&amp;nbsp; %let var3 = “&lt;SPAN lang="EN-US"&gt;something3&lt;/SPAN&gt;”; (in this 3 vars, I work with fixed values.... but I need (and you'll see below, work with var1, var2 ou 3.... receive a value stored in a variable (colunm) for example... Sector colunm..)&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&amp;nbsp; %let var4 = "%include and type the way where another program .sas was save”;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Run;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;In this case&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;my program is&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;running without problems &lt;/SPAN&gt;&lt;SPAN class="hps"&gt;but,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I need&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;program&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;receive&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the value&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;of some variable&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;(column) and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;pass this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;value within the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;command. &lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;The idea would be&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;something like this....&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="EN-US"&gt;Data test2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="EN-US"&gt;Set test1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="EN-US"&gt;Receive here the value, for example -&amp;gt; new_var = variable (column) sector&lt;/SPAN&gt;&lt;SPAN lang="EN-US"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="EN-US"&gt;Call execute (&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;SPAN lang="EN-US"&gt;‘ %let var1 = new_var (that I create above...)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&amp;nbsp; %let var2 = “&lt;SPAN lang="EN-US"&gt;something2&lt;/SPAN&gt;”;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&amp;nbsp; %let var3 = “&lt;SPAN lang="EN-US"&gt;something3&lt;/SPAN&gt;”;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&amp;nbsp; %let var4 = "%include and type the way where another program .sas was save”;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Run;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Please, can you help me with this?&lt;/P&gt;&lt;P class="ecxMsoNormal"&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Dec 2014 23:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143759#M296977</guid>
      <dc:creator>Kleber</dc:creator>
      <dc:date>2014-12-09T23:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Call execute to work with another program.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143760#M296978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see how test1 comes into play.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you want to create a macro that takes specific parameters and then use call execute to call the macro?&lt;/P&gt;&lt;P&gt;call symput/call symputx is also used to create macro variables from variables in a dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you could elaborate someone can provide sample code, but also here's an example of a macro with a parameter from a dataset:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;data sample;&lt;BR /&gt;do date='01Jan2014'd to '31Jan2014'd;&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;%macro print_date(date);&lt;BR /&gt;&lt;BR /&gt;proc print data=sample;&lt;BR /&gt;where date="&amp;amp;date"d;&lt;BR /&gt;format date date9.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%let date_start=05Jan2014;&lt;BR /&gt;%let date_end=11Jan2014;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;&amp;nbsp; do date1="&amp;amp;date_start"d to "&amp;amp;date_end"d by 1;&lt;BR /&gt;&amp;nbsp; str='%print_date('||put(date1, date9.)||');';&lt;BR /&gt;&amp;nbsp; call execute(str);&amp;nbsp; &lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 00:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143760#M296978</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-10T00:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Call execute to work with another program.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143761#M296979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And creating a macro variable from dataset:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set sashelp.class;&lt;/P&gt;&lt;P&gt;call symput('name'||put(_n_,2.), name);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; want;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;set&lt;/SPAN&gt; sashelp.class;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;call&lt;/SPAN&gt; symput(&lt;SPAN style="color: #942193;"&gt;'name'&lt;/SPAN&gt;||put(_n_,&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;2.&lt;/STRONG&gt;&lt;/SPAN&gt; -l), name);&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New'; color: #011993;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;%put&lt;/SPAN&gt; &amp;amp;name1;&lt;/P&gt;&lt;P style="font-size: 10px; font-family: 'Courier New';"&gt;&lt;SPAN style="color: #0433ff;"&gt;%put&lt;/SPAN&gt; &amp;amp;name10;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 00:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143761#M296979</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-10T00:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Call execute to work with another program.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143762#M296980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good evening Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your colaboration!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;I thought&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in replacing&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;macros&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for several&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;sas&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;programs&lt;/SPAN&gt; because I &lt;SPAN class="hps"&gt;have&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;132&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;bases, they'll&lt;/SPAN&gt;&lt;SPAN class="hps"&gt; create&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;using joins&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;between other&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;bases.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;Are&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;132&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;bases&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;and 132&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;different businesses rules.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I tried to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;use the programs&lt;/SPAN&gt; because &lt;SPAN class="hps"&gt;I thought the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;project&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;could be&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;more organized&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;than &lt;/SPAN&gt;&lt;SPAN class="hps"&gt;many&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;macros in a&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;single program.&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I thought&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in the project&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;this way&lt;/SPAN&gt; because &lt;SPAN class="hps"&gt;there is no escape&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;from need to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;create&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;132&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;rules&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;of different&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;joins&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;... &lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;unfortunately...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 00:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143762#M296980</guid>
      <dc:creator>Kleber</dc:creator>
      <dc:date>2014-12-10T00:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Call execute to work with another program.sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143763#M296981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fair enough. If the joins are a lookup, perhaps proc format could help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regardless, using call symput is probably your best bet to creating the macro variables and then call execute to include your code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 00:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-execute-to-work-with-another-program-sas/m-p/143763#M296981</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-12-10T00:48:31Z</dc:date>
    </item>
  </channel>
</rss>

