<?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: SAS Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506169#M135641</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/241478"&gt;@jdykstra&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;can't seem to figure out why my macro will not run more than once. (...)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;%create(trans,&amp;amp;t7.,table11&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;(Closing parenthesis inserted.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unbalanced parentheses can also cause programs to "&lt;SPAN&gt;not run more than once." However, this doesn't explain the log message about "an identifier after a quoted string."&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2018 21:01:33 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-10-19T21:01:33Z</dc:date>
    <item>
      <title>SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506139#M135626</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;can't seem to figure out why my macro will not run more than once. The error i am getting is something like: "The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended". I get it... i have a messed up quote somewhere.. but i cannot find it anywhere.. please help. Here is code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;proc datasets lib=work nolist kill; run; quit;
libname tw '';
libname jrd   '';
ods results = off;
options varinitchk=error;

proc sort data=tw.datset_name out=x0; by inquiry_id quote_time_dt quote_time;

data quotes; set x0; by inquiry_id quote_time_dt quote_time;
if first.inquiry_id;
year =year(quote_time_dt);
count =1;
run;

data transactions; set dataset_name;
year = year(execution_time_dt);
count = 1;run;

%let q1 = swap_product instr_desc;
%let q2 = package_type;
%let q3 = dealer;
%let q4 = recipient_company;

%let t1 = swap_product instr_desc;
%let t2 = on_sef;
%let t3 = package_ind package_type;
%let t4 = alloc_ind;
%let t5 = block_ind;
%let t6 = initiating_company;
%let t7 = dealer;
%let t8 = exec_platform;

%macro create(input, vars, output);
proc summary data=&amp;amp;input. nway; class &amp;amp;vars. year; var count;
output out=t1(drop=_:) sum()=;

proc sort data=t1; by &amp;amp;vars.;
proc transpose data=t1 out=t2(drop=_name_); by &amp;amp;vars.; var count; id year; 

proc summary data=t2 nway; var _numeric_;
output out=t2sums(drop=_:) sum()=;

data &amp;amp;output.; format &amp;amp;vars.; set t2 t2sums;
total = sum(of _numeric_);
array p _character_;
    do over p;
        if p = '' then p = 'Total';
    end;
run;
%mend; quit;

%create(quotes,&amp;amp;q1.,table1);
%create(quotes,&amp;amp;q2.,table2);
%create(quotes,&amp;amp;q3.,table3);
%create(quotes,&amp;amp;q4.,table4);

%create(trans,&amp;amp;t1.,table5);
%create(trans,&amp;amp;t2.,table6);
%create(trans,&amp;amp;t3.,table7);
%create(trans,&amp;amp;t4.,table8);
%create(trans,&amp;amp;t5.,table9);
%create(trans,&amp;amp;t6.,table10);
%create(trans,&amp;amp;t7.,table11;
%create(trans,&amp;amp;t8.,table12);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 19:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506139#M135626</guid>
      <dc:creator>jdykstra</dc:creator>
      <dc:date>2018-10-19T19:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506145#M135632</link>
      <description>&lt;P&gt;Run it in BATCH or start a new SAS session and run it.&amp;nbsp; Also use MPRINT option so you can see then code where any errors, warning or notes are referring to.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 19:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506145#M135632</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-19T19:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506147#M135634</link>
      <description>Not sure why your macro isn't working, but I think you could get better results using PROC MEANS with the STACKODS options and avoid having to reshape your data.&lt;BR /&gt;To help debug this, please run it with the MPRINT and SYMBOLGEN options enabled and post the log.</description>
      <pubDate>Fri, 19 Oct 2018 19:50:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506147#M135634</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-19T19:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506149#M135636</link>
      <description>&lt;P&gt;So i place "options symbolgen;" below the "options varinitchk=error" and i put "options mprint" after "%mend;"???&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 19:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506149#M135636</guid>
      <dc:creator>jdykstra</dc:creator>
      <dc:date>2018-10-19T19:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506152#M135637</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options varinitchk=error mprint=1 symbolgen=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Make it easy put them all at the top.&amp;nbsp; You don't really need symbolgen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 19:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506152#M135637</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-19T19:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506169#M135641</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/241478"&gt;@jdykstra&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;can't seem to figure out why my macro will not run more than once. (...)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;%create(trans,&amp;amp;t7.,table11&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;&lt;/STRONG&gt;;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;(Closing parenthesis inserted.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unbalanced parentheses can also cause programs to "&lt;SPAN&gt;not run more than once." However, this doesn't explain the log message about "an identifier after a quoted string."&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 21:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506169#M135641</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-19T21:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506171#M135642</link>
      <description>&lt;P&gt;Nice!! Hawk eye:)&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 21:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506171#M135642</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-19T21:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506172#M135643</link>
      <description>&lt;P&gt;Actually, this completely solved my issue.&amp;nbsp; I can't believe i didn't see that, tbh. I'm blind.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 21:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/506172#M135643</guid>
      <dc:creator>jdykstra</dc:creator>
      <dc:date>2018-10-19T21:30:57Z</dc:date>
    </item>
  </channel>
</rss>

