<?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: How to update a SAS table using CALL EXECUTE macro function inside a Data Step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706944#M217056</link>
    <description>&lt;P&gt;It does not matter if the &amp;amp; macro triggers are in single quotes in the data step that is pushing the code. When CALL EXECUTE pushes the code onto the stack to run the macro variable references will be resolved.&lt;/P&gt;
&lt;P&gt;So if you run this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call execute('data &amp;amp;ltbl;set &amp;amp;ltbl;run;');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then the value of LTBL macro variable will be evaluated at the time that CALL EXECUTE statement runs and code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data XXX; set XXX; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will be pushed onto the stack to run after the current data step finishes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you saying the issue is that the value of LTBL is changed after the CALL EXECUTE() statement runs and you want this code to run after the data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data &amp;amp;ltbl;set &amp;amp;ltbl;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so the updated value of LTBL will be used?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Dec 2020 13:31:11 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-12-18T13:31:11Z</dc:date>
    <item>
      <title>How to update a SAS table using CALL EXECUTE macro function inside a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706848#M217022</link>
      <description>&lt;P&gt;Hello, everybody !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying&amp;nbsp;to develop a code&amp;nbsp;&amp;nbsp;to identify a empty table and update another table "&amp;nbsp;type of control table" with a information in specific field, after stop the process or depending run the process normally.&lt;/P&gt;&lt;P&gt;But something happen in the update step&amp;nbsp;that this code doesn't work sucessfully.&lt;/P&gt;&lt;P&gt;Could anybody help in this task, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Accordin SAS&amp;nbsp;code below:&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; work.tasktable; &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008000"&gt;* to simulating a empty source table*;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; orig_info_1 $ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080"&gt;1.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; orig_info_2 $ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080"&gt;1.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; dt_carga &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008080"&gt;DDMMYY10.&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; work.logtable; &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008000"&gt;* to simulating a control table*;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; process_nm $ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080"&gt;7.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; msg_log $ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080"&gt;30.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; load_dt &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008080"&gt;DDMMYY10.&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;process_nm=&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;"ABCD123"&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New"&gt;load_dt&lt;/FONT&gt;&lt;/FONT&gt;=today( );&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; load_dt=&lt;/FONT&gt;&lt;FONT face="Courier New" color="#008080"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="1"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;******** Assigning macro variables **********************;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;options&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;mprint&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; ttbl=work.tasktable; &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; tab_de_trabalho=&amp;amp;ttbl;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; fnsh=EOF; &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; end_of_file=&amp;amp;fnsh;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; load_dt=&lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;(PUTN( &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;(today()), ddmmyyS10.)); &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; load_date=&amp;amp;load_dt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; load_tt=&lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;(PUTC(&lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;(today()),$10.)); &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; load_date_char=&amp;amp;load_tt; &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008000"&gt;*SAS date in char format*;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; ltbl=work.logtable; &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; log_table=&amp;amp;ltbl;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; var1='XPTO567'; &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; system_name=&amp;amp;var1;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; var2='empty_source_file'; &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; error_message=&amp;amp;var2;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#000080"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;_NULL_&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;FORMAT&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; END &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008080"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;SET&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; &amp;amp;ttbl &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;END&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=&amp;amp;fnsh;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;BY&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; dt_carga; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; END=&amp;amp;fnsh &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;AND&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; _N_ LE &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;AND&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; orig_info_1=&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;' '&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;THEN&lt;/FONT&gt; &lt;FONT face="Courier New" color="#008000"&gt;/* testing the condition of empty table*/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; execute (&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;'data &amp;amp;ltbl;set &amp;amp;ltbl;format process_nm $ 7.;if &amp;amp;load_tt=put(today(),$10.)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#800080"&gt;and process_nm=&amp;amp;var1 and INDEX(msg_log," ") GE 1 then msg_log=%str(&amp;amp;var2);run;'&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;); &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008000"&gt;*update a character value in msg_log colunm*;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; END=&amp;amp;fnsh &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;AND&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; _N_ LE &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;AND&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; orig_info_1=&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;' '&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;THEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; execute (&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;'data_null_;STOP;run;'&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;); &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008000"&gt;*stop the process*;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; END=&amp;amp;fnsh &lt;/FONT&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;AND&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; _N_ LE &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color="#008080"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;AND&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; orig_info_1 NE &lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;' '&lt;/FONT&gt; &lt;FONT face="Courier New" color="#0000ff"&gt;THEN&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#0000ff"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; execute (&lt;/FONT&gt;&lt;FONT face="Courier New" color="#800080"&gt;'data_null_;output="OK";run;'&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;); &lt;/FONT&gt;&lt;FONT face="Courier New" color="#008000"&gt;*else output=ok "do nothing" *;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;FONT face="Courier New" color="#000080"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 00:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706848#M217022</guid>
      <dc:creator>flavio_bra21</dc:creator>
      <dc:date>2020-12-18T00:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a SAS table using CALL EXECUTE macro function inside a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706859#M217027</link>
      <description>&lt;P&gt;You've got macro variables inside single quotes here so they won't resolve:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call execute ('data &amp;amp;ltbl;set &amp;amp;ltbl;format process_nm $ 7.;if &amp;amp;load_tt=put(today(),$10.)

and process_nm=&amp;amp;var1 and INDEX(msg_log," ") GE 1 then msg_log=%str(&amp;amp;var2);run;');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Try this (untested):&lt;/P&gt;
&lt;PRE&gt;call execute (%nstr(%str(%')data &amp;amp;ltbl;set &amp;amp;ltbl;format process_nm $ 7.;if &amp;amp;load_tt=put(today(),$10.)

and process_nm=&amp;amp;var1 and INDEX(msg_log," ") GE 1 then msg_log=%str(&amp;amp;var2);run;%str(%')));&lt;/PRE&gt;
&lt;P&gt;It would be better to construct the required code in a separate statement rather than doing it all in one go.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 02:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706859#M217027</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-12-18T02:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a SAS table using CALL EXECUTE macro function inside a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706866#M217031</link>
      <description>&lt;P&gt;Unfortunetelly your sugestion doesn't work:&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;24&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;25 GOPTIONS ACCESSIBLE;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;26&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;27 DATA _NULL_;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;28 FORMAT END $3.;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;29 SET &amp;amp;ttbl END=&amp;amp;fnsh;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;30 BY dt_carga;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;31 IF END=&amp;amp;fnsh AND _N_ LE 1 AND orig_info_1=' ' THEN /* testing the condition of empty table*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;32 call execute&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;32 ! (%nstr(%str(%')data &amp;amp;ltbl;set &amp;amp;ltbl;format process_nm $ 7.;if &amp;amp;load_tt=put(today(),$10.)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;_&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;22&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;WARNING: Apparent invocation of macro NSTR not resolved.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;32 %nstr(%str(%')data &amp;amp;ltbl;set &amp;amp;ltbl;format process_nm $ 7.;if &amp;amp;load_tt=put(today(),$10.)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;_&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;200&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;_______&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;252&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;a missing value, arrayname, (, ), +, ',', -, INPUT, NOT, OF, PUT, ^, _NEW_, ~.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;ERROR 252-185: The EXECUTE subroutine call does not have enough arguments.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 02:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706866#M217031</guid>
      <dc:creator>flavio_bra21</dc:creator>
      <dc:date>2020-12-18T02:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a SAS table using CALL EXECUTE macro function inside a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706867#M217032</link>
      <description>&lt;P&gt;Sorry I got the spelling wrong:&amp;nbsp;%nrstr&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 03:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706867#M217032</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-12-18T03:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a SAS table using CALL EXECUTE macro function inside a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706944#M217056</link>
      <description>&lt;P&gt;It does not matter if the &amp;amp; macro triggers are in single quotes in the data step that is pushing the code. When CALL EXECUTE pushes the code onto the stack to run the macro variable references will be resolved.&lt;/P&gt;
&lt;P&gt;So if you run this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call execute('data &amp;amp;ltbl;set &amp;amp;ltbl;run;');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then the value of LTBL macro variable will be evaluated at the time that CALL EXECUTE statement runs and code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data XXX; set XXX; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will be pushed onto the stack to run after the current data step finishes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you saying the issue is that the value of LTBL is changed after the CALL EXECUTE() statement runs and you want this code to run after the data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data &amp;amp;ltbl;set &amp;amp;ltbl;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so the updated value of LTBL will be used?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 13:31:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706944#M217056</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-12-18T13:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to update a SAS table using CALL EXECUTE macro function inside a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706954#M217059</link>
      <description>Firstly, thanks for your interest in help me.&lt;BR /&gt;I answered that yes, the updated value of LTBL will be used. I'm trying substitute the original value of msg_log column [ ] by [&amp;amp;var2]. in this specific case the value doesn't change.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Dec 2020 14:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-update-a-SAS-table-using-CALL-EXECUTE-macro-function/m-p/706954#M217059</guid>
      <dc:creator>flavio_bra21</dc:creator>
      <dc:date>2020-12-18T14:25:02Z</dc:date>
    </item>
  </channel>
</rss>

