<?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: Create Proc Expand in macro using call execute in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343986#M272940</link>
    <description>Thanks so much for your response. I tried both suggestions and still get&lt;BR /&gt;errors... please do let me know if you have any idea what may be causing&lt;BR /&gt;the problem!&lt;BR /&gt;&lt;BR /&gt;1.) Replacing &amp;amp;&amp;amp;var&amp;amp;j. with "&amp;amp;&amp;amp;var&amp;amp;j." inside the macro %get_word but not&lt;BR /&gt;using double-quotes in the macro call gives the error:&lt;BR /&gt;&lt;BR /&gt;NOTE 137-205: Line generated by the invoked macro "TEST".&lt;BR /&gt;3            call execute ( 'convert '|| %get_word(&amp;amp;orderedvars2,&amp;amp;i)||' =&lt;BR /&gt;                                                                    --&lt;BR /&gt;                                                                    22&lt;BR /&gt;3  ! log_'||%get_word(&amp;amp;orderedvars2,&amp;amp;i)||' / transformout=(log);');&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a&lt;BR /&gt;quoted string,&lt;BR /&gt;              a numeric constant, a datetime constant, a missing value,&lt;BR /&gt;INPUT, PUT.&lt;BR /&gt;&lt;BR /&gt;ERROR: More positional parameters found than defined.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2.) Enclosing the macro call in double_quotes, but not changing the&lt;BR /&gt;%get_word macro also gives an error:&lt;BR /&gt;%macro test;&lt;BR /&gt;  %let n = %sysfunc(countw(&amp;amp;orderedvars2));&lt;BR /&gt;  data _null_;&lt;BR /&gt;  call execute ('proc expand data=STNDStandardized3 out=logvars1 method =&lt;BR /&gt;none;&lt;BR /&gt;  id date2; ');&lt;BR /&gt;     %do i = 1 %to &amp;amp;n;&lt;BR /&gt;       call execute ( 'convert '|| "%get_word(&amp;amp;orderedvars2,&amp;amp;i)"||' =&lt;BR /&gt;log_'||"%get_word(&amp;amp;orderedvars2,&amp;amp;i)"||' / transformout=(log);');&lt;BR /&gt;     %end;&lt;BR /&gt;  call execute ( ';run;');&lt;BR /&gt;  run;&lt;BR /&gt;%mend;&lt;BR /&gt;%test;&lt;BR /&gt;&lt;BR /&gt;ERROR: More positional parameters found than defined.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
    <pubDate>Fri, 24 Mar 2017 09:01:32 GMT</pubDate>
    <dc:creator>nstdt</dc:creator>
    <dc:date>2017-03-24T09:01:32Z</dc:date>
    <item>
      <title>Create Proc Expand in macro using call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343690#M272936</link>
      <description>&lt;P&gt;I'm trying to use Call Execute along with Proc expand in order to log transform a large number of variables.&lt;/P&gt;
&lt;P&gt;I'm however getting some errors and would appreciate any advice.&lt;/P&gt;
&lt;P&gt;Here is my code set-up:&lt;/P&gt;
&lt;P&gt;1)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%let orderedvars2 = a b c d&lt;/STRONG&gt; /*long &amp;nbsp;list of variables to be log transformed */;&lt;/P&gt;
&lt;P&gt;2)&lt;/P&gt;
&lt;P&gt;I have a macro called get_word which extracts the i-th element of the list of variables in orderedvars2&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%macro get_word(string=,j=); &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; %let word_cnt=%sysfunc(countw(%superq(string)));&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%let var&amp;amp;j=%scan(&amp;amp;string,&amp;amp;j);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;amp;&amp;amp;var&amp;amp;j.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%mend ;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;3)&lt;/P&gt;
&lt;P&gt;Then I have Call Execute with proc expand in the argument as below. I thought I was supposed to concatenate the output of %get_word along with the usual syntax for Proc expand. I would like to rename the original variables with the prefix 'log_' in front. My code produces &amp;nbsp;the following error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;NOTE 137-205: Line generated by the invoked macro "TEST".&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;35 call execute ( 'convert '|| %get_word(&amp;amp;orderedvars2,&amp;amp;i)||' = log_'||%get_word(&amp;amp;orderedvars2,&amp;amp;i)||' /&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt; __&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt; 22&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;35 ! transformout=(log);');&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&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;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt; a missing value, INPUT, PUT.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;ERROR: More positional parameters found than defined.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Here is my macro %test below:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%macro test;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; %let n = %sysfunc(countw(&amp;amp;orderedvars2));&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; data _null_;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; call execute ('proc expand data=work.Standardized3 out=logvars1 method = none; id date2; ');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; %do i = 1 %to &amp;amp;n;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; call execute ( 'convert '|| %get_word(&amp;amp;orderedvars2,&amp;amp;i)||' = log_'||%get_word(&amp;amp;orderedvars2,&amp;amp;i)||' / transformout=(log);');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; %end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; call execute ( ';run;');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%test;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank&amp;nbsp;you for any help and advice.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 13:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343690#M272936</guid>
      <dc:creator>nstdt</dc:creator>
      <dc:date>2017-03-23T13:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create Proc Expand in macro using call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343699#M272937</link>
      <description>&lt;P&gt;It looks like you're pretty close here.&amp;nbsp; The interior macro calls should add double quotes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;|| %get_word(&amp;amp;orderedvars2,&amp;amp;i)||&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;should become:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;|| "%get_word(&amp;amp;orderedvars2,&amp;amp;i)" ||&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's the difference between CALL EXECUTE seeing || a || vs. || "a" ||.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, add the double quotes within the macro definition, changing &amp;amp;&amp;amp;var&amp;amp;j. to "&amp;amp;&amp;amp;var&amp;amp;j."&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 13:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343699#M272937</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-23T13:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create Proc Expand in macro using call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343704#M272938</link>
      <description>&lt;P&gt;Why not run it from a dataset without macro code?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data orderedvars;
input var $;
cards;
a
b
c
d
;
run;

data _null_;
set orderedvars end=done;
if _n_ = 1 then
call execute ('proc expand data=work.Standardized3 out=logvars1 method = none; id date2; ');
call execute ( 'convert '|| trim(var) ||' = log_'|| trim(var) ||' / transformout=(log);');
if done then
call execute ( ';run;');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2017 13:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343704#M272938</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-23T13:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create Proc Expand in macro using call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343714#M272939</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;How to stop at compilation on on a specific iteration

data _null_;

  if _n_=0 then do;
    %let rc=%sysfunc(dosubl('
     proc sql noprint;
       select
          quote(var)
       into
          :vars
       separated by
          ","
       from
          orderedvars
     ;quit;
   '));
  end;

  * compile fail?;
  %sysfunc(ifc(&amp;amp;rc.=0,%str( ),%str(put "failed at compilation";stop;)));

  do var=(&amp;amp;vars);
     call symputx('var',var_;
     rc=dosubl('
       proc expand data=work.Standardized3 out=logvars1 method = none;
         id date2;
         convert &amp;amp;var. = log_&amp;amp;var. transformout=(log);
       run;quit;
     ');

     * excecution fail;
     if rc&amp;gt;0 then do;
         put "Failed for variable &amp;amp;var";
         put "Processing stopped";
         stop;
     end;
  end;

run;quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2017 14:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343714#M272939</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-03-23T14:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create Proc Expand in macro using call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343986#M272940</link>
      <description>Thanks so much for your response. I tried both suggestions and still get&lt;BR /&gt;errors... please do let me know if you have any idea what may be causing&lt;BR /&gt;the problem!&lt;BR /&gt;&lt;BR /&gt;1.) Replacing &amp;amp;&amp;amp;var&amp;amp;j. with "&amp;amp;&amp;amp;var&amp;amp;j." inside the macro %get_word but not&lt;BR /&gt;using double-quotes in the macro call gives the error:&lt;BR /&gt;&lt;BR /&gt;NOTE 137-205: Line generated by the invoked macro "TEST".&lt;BR /&gt;3            call execute ( 'convert '|| %get_word(&amp;amp;orderedvars2,&amp;amp;i)||' =&lt;BR /&gt;                                                                    --&lt;BR /&gt;                                                                    22&lt;BR /&gt;3  ! log_'||%get_word(&amp;amp;orderedvars2,&amp;amp;i)||' / transformout=(log);');&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a&lt;BR /&gt;quoted string,&lt;BR /&gt;              a numeric constant, a datetime constant, a missing value,&lt;BR /&gt;INPUT, PUT.&lt;BR /&gt;&lt;BR /&gt;ERROR: More positional parameters found than defined.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2.) Enclosing the macro call in double_quotes, but not changing the&lt;BR /&gt;%get_word macro also gives an error:&lt;BR /&gt;%macro test;&lt;BR /&gt;  %let n = %sysfunc(countw(&amp;amp;orderedvars2));&lt;BR /&gt;  data _null_;&lt;BR /&gt;  call execute ('proc expand data=STNDStandardized3 out=logvars1 method =&lt;BR /&gt;none;&lt;BR /&gt;  id date2; ');&lt;BR /&gt;     %do i = 1 %to &amp;amp;n;&lt;BR /&gt;       call execute ( 'convert '|| "%get_word(&amp;amp;orderedvars2,&amp;amp;i)"||' =&lt;BR /&gt;log_'||"%get_word(&amp;amp;orderedvars2,&amp;amp;i)"||' / transformout=(log);');&lt;BR /&gt;     %end;&lt;BR /&gt;  call execute ( ';run;');&lt;BR /&gt;  run;&lt;BR /&gt;%mend;&lt;BR /&gt;%test;&lt;BR /&gt;&lt;BR /&gt;ERROR: More positional parameters found than defined.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Fri, 24 Mar 2017 09:01:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/343986#M272940</guid>
      <dc:creator>nstdt</dc:creator>
      <dc:date>2017-03-24T09:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create Proc Expand in macro using call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/344006#M272941</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I also tried with single quotes instead of double quotes. and get these errors--- not sure what they indicate-- here it looks like the %get_word macro's output does not get generated inside call execute:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;%macro test;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; %let n = %sysfunc(countw(&amp;amp;orderedvars2)&lt;WBR /&gt;);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; data _null_;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; call execute ('proc expand data=STNDStandardized3 out=logvars1 method = none;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; id date2; ');&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;%do i = 1 %to &amp;amp;n;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;call execute ( 'convert %get_word(&amp;amp;orderedvars2,&amp;amp;i) = log_'||'%get_word(&amp;amp;&lt;WBR /&gt;orderedvars2,&amp;amp;i) / transformout=(log);');&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;%end;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; call execute ( ';run;');&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; run;&lt;/DIV&gt;
&lt;DIV&gt;%mend;&lt;/DIV&gt;
&lt;DIV&gt;%test;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;ERROR: More positional parameters found than defined.&lt;/DIV&gt;
&lt;DIV&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;
&lt;DIV&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; real time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.08 seconds&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; cpu time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.09 seconds&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;NOTE: CALL EXECUTE generated line.&lt;/DIV&gt;
&lt;DIV&gt;1 &amp;nbsp; + proc expand data=STNDStandardized3 out=logvars1 method = none; &amp;nbsp;id date2;&lt;/DIV&gt;
&lt;DIV&gt;NOTE: Line generated by the CALL EXECUTE routine.&lt;/DIV&gt;
&lt;DIV&gt;2 &amp;nbsp; + convert = log_ / transformout=(log);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; -------&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 180&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Mar 2017 10:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/344006#M272941</guid>
      <dc:creator>nstdt</dc:creator>
      <dc:date>2017-03-24T10:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create Proc Expand in macro using call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/344008#M272942</link>
      <description>&lt;P&gt;Thanks, I really like the solution and it works.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only thing is that the variable names are actually long and sometimes are just long alphanumeric codes -- in this case , is there a short cut to creating the dataset orderedvars? I have all the variable names stored as a list in the macrovariabe &amp;amp;orderedvars2.&lt;/P&gt;
&lt;P&gt;I tried using the code below but it&amp;nbsp;didn't run. Should I use call execute inside the data step --- what would be the syntax, if its advisable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; orderedvars&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;var&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token keyword"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;
&amp;amp;orderedvars2;
&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; It says&amp;nbsp;in the error message:&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the macro variable "ORDEREDVARS2".&lt;BR /&gt;27 STD_fri STD_VEHICLE_SALES STD_PASSCAR_SALES STD_TRK_SALES STD_CPI_TRANSPORT STD_LF_PART_RATE STD_GASCPI_NSA STD_CANCPI&lt;BR /&gt; _______&lt;BR /&gt; 180&lt;BR /&gt;27 ! STD_CANCORECPI STD_UNEMPLOY_RATE STD_BOND_RATE_10YR STD_CPI STD_CPI_CORE STD_RGDP STD_RGDP_USD STD_EXCH_CAND_USD&lt;BR /&gt;27 ! STD_EXCH_CAND_EUR&lt;/P&gt;
&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 10:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/344008#M272942</guid>
      <dc:creator>nstdt</dc:creator>
      <dc:date>2017-03-24T10:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create Proc Expand in macro using call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/344019#M272943</link>
      <description>&lt;P&gt;Create the dataset in this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data orderedvars;
length var $32;
do i = 1 to countw("&amp;amp;orderedvars");
  var = scan("&amp;amp;orderedvars",i);
  output;
end;
keep var;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now you can inspect the dataset for being correct and then run the data step with call execute off it.&lt;/P&gt;
&lt;P&gt;You can integrate the steps, but I just want my call execute data steps to be as simple as can be.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 10:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/344019#M272943</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-24T10:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create Proc Expand in macro using call execute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/344030#M272944</link>
      <description>&lt;P&gt;Since you defined the macro with keyword parameters, you have to call it with keyword parameters:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%get_word(string=&amp;amp;orderedvars2, j=&amp;amp;i)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better might be to simplify and get rid of the macro entirely. &amp;nbsp;Within CALL EXECUTE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;|| "%scan(&amp;amp;orderedvar2, &amp;amp;i) " ||&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 11:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-Proc-Expand-in-macro-using-call-execute/m-p/344030#M272944</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-24T11:16:33Z</dc:date>
    </item>
  </channel>
</rss>

