<?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: Accessing Table records (using row column indexing) inside a macro function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546772#M151445</link>
    <description>&lt;P&gt;You can't access variables in a table in that manner. You need to first store the output into a data table and then capture that into a macro variable. Depending on exactly what you're doing you may have other options but based on what you've said here that's pretty much the option. &lt;/P&gt;
&lt;P&gt;Here's an example of how that can happen:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. ODS SELECT NONE/ALL -&amp;gt; can be used to control if output is generated to ODS destinations&lt;/P&gt;
&lt;P&gt;2. PROC SQL (INTO) to capture macro variables&lt;/P&gt;
&lt;P&gt;3. %IF/%THEN is valid in 'open code' if you're in SAS 9.4 TS1M5 or later, if you're using an older version you'll need to have a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*T-Test code;
ods select none; *suppress output;
proc ttest data=sashelp.class;
    class sex;
    var weight;
    ods output ttests=demo1 summaryPanel=demo2;
run;
ods select all;

*capture p-value;
proc sql noprint;
    select probt into :TTest_PValue from demo1 where method='Pooled';
quit;


*demo output;
%put &amp;amp;TTEST_PValue;
%if %sysevalf(&amp;amp;TTEST_PValue &amp;lt; 0.05) %then %do;
    %put Test is significant;
%end;
%else %do;
    %put Test is not significant;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268247"&gt;@dwights&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to access table indexes with an %IF condition. The table is an output of a T-test. I'm trying to enter the %if loop and rerun the t-test when results are significant.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Variable&lt;/TD&gt;
&lt;TD&gt;Method&lt;/TD&gt;
&lt;TD&gt;Variances&lt;/TD&gt;
&lt;TD&gt;t-Value&lt;/TD&gt;
&lt;TD&gt;D-F&lt;/TD&gt;
&lt;TD&gt;Prob-t&lt;/TD&gt;
&lt;TD&gt;char_var&lt;/TD&gt;
&lt;TD&gt;number-var&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;Pooled&lt;/TD&gt;
&lt;TD&gt;Equal&lt;/TD&gt;
&lt;TD&gt;4.12&lt;/TD&gt;
&lt;TD&gt;3450&lt;/TD&gt;
&lt;TD&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;TD&gt;0.000&lt;/TD&gt;
&lt;TD&gt;0.000038&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;S&lt;/TD&gt;
&lt;TD&gt;Unequal&lt;/TD&gt;
&lt;TD&gt;4.12&lt;/TD&gt;
&lt;TD&gt;3402&lt;/TD&gt;
&lt;TD&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;TD&gt;0.000&lt;/TD&gt;
&lt;TD&gt;0.000038&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Prob-t is a numeric value. char_var and number-var are character and numeric(increased decimal precision) transformations of Prob-t column.&lt;/P&gt;
&lt;P&gt;Here is the code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;%if (table[1][6]&amp;lt;0.05 or table[1][7] = '0.000' or table[1][7] = '.') %then %do;



/*&amp;nbsp; &amp;nbsp; Code here&amp;nbsp; &amp;nbsp; to proc t-test&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/



%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The if loop is not being executed for the table above. Can someone please let me know why.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is being executed if I change the '&amp;lt;' symbol to '&amp;gt;'&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using Enterprise Guide 7.1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2019 02:41:03 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-03-28T02:41:03Z</dc:date>
    <item>
      <title>Accessing Table records (using row column indexing) inside a macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546758#M151442</link>
      <description>&lt;P&gt;I'm trying to access table indexes with an %IF condition. The table is an output of a T-test. I'm trying to enter the %if loop and rerun the t-test when results are significant.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Variable&lt;/TD&gt;&lt;TD&gt;Method&lt;/TD&gt;&lt;TD&gt;Variances&lt;/TD&gt;&lt;TD&gt;t-Value&lt;/TD&gt;&lt;TD&gt;D-F&lt;/TD&gt;&lt;TD&gt;Prob-t&lt;/TD&gt;&lt;TD&gt;char_var&lt;/TD&gt;&lt;TD&gt;number-var&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Pooled&lt;/TD&gt;&lt;TD&gt;Equal&lt;/TD&gt;&lt;TD&gt;4.12&lt;/TD&gt;&lt;TD&gt;3450&lt;/TD&gt;&lt;TD&gt;&amp;lt;.0001&lt;/TD&gt;&lt;TD&gt;0.000&lt;/TD&gt;&lt;TD&gt;0.000038&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;S&lt;/TD&gt;&lt;TD&gt;Unequal&lt;/TD&gt;&lt;TD&gt;4.12&lt;/TD&gt;&lt;TD&gt;3402&lt;/TD&gt;&lt;TD&gt;&amp;lt;.0001&lt;/TD&gt;&lt;TD&gt;0.000&lt;/TD&gt;&lt;TD&gt;0.000038&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Prob-t is a numeric value. char_var and number-var are character and numeric(increased decimal precision) transformations of Prob-t column.&lt;/P&gt;&lt;P&gt;Here is the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;%if (table[1][6]&amp;lt;0.05 or table[1][7] = '0.000' or table[1][7] = '.') %then %do;



/*&amp;nbsp; &amp;nbsp; Code here&amp;nbsp; &amp;nbsp; to proc t-test&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/



%end;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The if loop is not being executed for the table above. Can someone please let me know why.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is being executed if I change the '&amp;lt;' symbol to '&amp;gt;'&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using Enterprise Guide 7.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 23:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546758#M151442</guid>
      <dc:creator>dwights</dc:creator>
      <dc:date>2019-03-27T23:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Table records (using row column indexing) inside a macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546772#M151445</link>
      <description>&lt;P&gt;You can't access variables in a table in that manner. You need to first store the output into a data table and then capture that into a macro variable. Depending on exactly what you're doing you may have other options but based on what you've said here that's pretty much the option. &lt;/P&gt;
&lt;P&gt;Here's an example of how that can happen:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. ODS SELECT NONE/ALL -&amp;gt; can be used to control if output is generated to ODS destinations&lt;/P&gt;
&lt;P&gt;2. PROC SQL (INTO) to capture macro variables&lt;/P&gt;
&lt;P&gt;3. %IF/%THEN is valid in 'open code' if you're in SAS 9.4 TS1M5 or later, if you're using an older version you'll need to have a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*T-Test code;
ods select none; *suppress output;
proc ttest data=sashelp.class;
    class sex;
    var weight;
    ods output ttests=demo1 summaryPanel=demo2;
run;
ods select all;

*capture p-value;
proc sql noprint;
    select probt into :TTest_PValue from demo1 where method='Pooled';
quit;


*demo output;
%put &amp;amp;TTEST_PValue;
%if %sysevalf(&amp;amp;TTEST_PValue &amp;lt; 0.05) %then %do;
    %put Test is significant;
%end;
%else %do;
    %put Test is not significant;
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268247"&gt;@dwights&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to access table indexes with an %IF condition. The table is an output of a T-test. I'm trying to enter the %if loop and rerun the t-test when results are significant.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Variable&lt;/TD&gt;
&lt;TD&gt;Method&lt;/TD&gt;
&lt;TD&gt;Variances&lt;/TD&gt;
&lt;TD&gt;t-Value&lt;/TD&gt;
&lt;TD&gt;D-F&lt;/TD&gt;
&lt;TD&gt;Prob-t&lt;/TD&gt;
&lt;TD&gt;char_var&lt;/TD&gt;
&lt;TD&gt;number-var&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;Pooled&lt;/TD&gt;
&lt;TD&gt;Equal&lt;/TD&gt;
&lt;TD&gt;4.12&lt;/TD&gt;
&lt;TD&gt;3450&lt;/TD&gt;
&lt;TD&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;TD&gt;0.000&lt;/TD&gt;
&lt;TD&gt;0.000038&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ID&lt;/TD&gt;
&lt;TD&gt;S&lt;/TD&gt;
&lt;TD&gt;Unequal&lt;/TD&gt;
&lt;TD&gt;4.12&lt;/TD&gt;
&lt;TD&gt;3402&lt;/TD&gt;
&lt;TD&gt;&amp;lt;.0001&lt;/TD&gt;
&lt;TD&gt;0.000&lt;/TD&gt;
&lt;TD&gt;0.000038&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Prob-t is a numeric value. char_var and number-var are character and numeric(increased decimal precision) transformations of Prob-t column.&lt;/P&gt;
&lt;P&gt;Here is the code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;%if (table[1][6]&amp;lt;0.05 or table[1][7] = '0.000' or table[1][7] = '.') %then %do;



/*&amp;nbsp; &amp;nbsp; Code here&amp;nbsp; &amp;nbsp; to proc t-test&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/



%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The if loop is not being executed for the table above. Can someone please let me know why.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is being executed if I change the '&amp;lt;' symbol to '&amp;gt;'&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using Enterprise Guide 7.1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 02:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546772#M151445</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-03-28T02:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Table records (using row column indexing) inside a macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546775#M151446</link>
      <description>&lt;P&gt;I did store it in a data table - output_Ttest. The following condition is being executed (notice the &amp;gt; symbol)&amp;nbsp;&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 macrostatement"&gt;%if&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(output_Ttest&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&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 number"&gt;6&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0.05&lt;/SPAN&gt; or &lt;SPAN class="token punctuation"&gt;output_Ttest&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&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 number"&gt;7&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'0.000'&lt;/SPAN&gt; or &lt;SPAN class="token punctuation"&gt;output_Ttest&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&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 number"&gt;7&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'.'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token macrostatement"&gt;%then&lt;/SPAN&gt; &lt;SPAN class="token macrostatement"&gt;%do&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 02:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546775#M151446</guid>
      <dc:creator>dwights</dc:creator>
      <dc:date>2019-03-28T02:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Table records (using row column indexing) inside a macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546776#M151447</link>
      <description>You cannot access information in a table using this type of notation:&lt;BR /&gt;&lt;BR /&gt;output_ttest[1][6] unless you're using SAS IML or something else, but since this is in the programming, I assumed your'e using programming. And when comparing values within macro logic, you need to use %SYSEVALF. Another option that may make more sense to you may be using CALL EXECUTE() or DOSUBL(). &lt;BR /&gt;&lt;BR /&gt;I'll see if I can draft a version of that. I'm guessing you're coming from R, Python or Matlab to SAS?</description>
      <pubDate>Thu, 28 Mar 2019 03:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546776#M151447</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-03-28T03:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Table records (using row column indexing) inside a macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546777#M151448</link>
      <description>&lt;P&gt;You can use a data _null_ step to use data step logic but not generate a data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case you can pass new commands to the system within CALL EXECUTE or DOSUBL().&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The logic executes the same way as a standard data step - I'm not sure how much you know of that so if need more details please let us know.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a full data step approach.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*T-Test code;
ods select none;
*suppress output;

proc ttest data=sashelp.cars;
    where origin in ('USA', 'Asia');
    class origin;
    var mpg_city;
    ods output ttests=demo1;
run;

ods select all;

data _null_;
    set demo1 (where=(method='Pooled'));

    if probt &amp;lt; 0.05 then
        do;
            call execute ('title "demo proc"; proc ttest data=sashelp.class; class sex; var height;run;');
        end;
    else
        do;
            call execute("title 'This is not significant'; proc print data=demo1 noobs label; run;");
        end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 03:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546777#M151448</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-03-28T03:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Table records (using row column indexing) inside a macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546778#M151449</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268247"&gt;@dwights&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I did store it in a data table - output_Ttest. The following condition is being executed (notice the &amp;gt; symbol)&amp;nbsp;&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 macrostatement"&gt;%if&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(output_Ttest&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&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 number"&gt;6&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0.05&lt;/SPAN&gt; or &lt;SPAN class="token punctuation"&gt;output_Ttest&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&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 number"&gt;7&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'0.000'&lt;/SPAN&gt; or &lt;SPAN class="token punctuation"&gt;output_Ttest&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&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 number"&gt;7&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'.'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token macrostatement"&gt;%then&lt;/SPAN&gt; &lt;SPAN class="token macrostatement"&gt;%do&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If by table you mean dataset then why are you using %IF instead of IF?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 03:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546778#M151449</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-28T03:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Table records (using row column indexing) inside a macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546788#M151457</link>
      <description>&lt;P&gt;Thank you very much! I totally forgot about the select into macro statement.&amp;nbsp; However in my case (select num_var&amp;nbsp;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;into&lt;/SPAN&gt; :TTest_PValue)&lt;/CODE&gt;&amp;nbsp; works instead of (select&amp;nbsp;&amp;nbsp;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token function"&gt;probt&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;into&lt;/SPAN&gt; :TTest_PValue) because for probt, the&amp;nbsp;&amp;nbsp;TTest_PValue is going to return &amp;lt;.0001 which isn't very useful.&amp;nbsp; And yes, I have a Python background.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="  language-sas"&gt;Thank you!&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="  language-sas"&gt;Now I can return to my beet farm.&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 05:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546788#M151457</guid>
      <dc:creator>dwights</dc:creator>
      <dc:date>2019-03-28T05:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Table records (using row column indexing) inside a macro function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546789#M151458</link>
      <description>Thanks for replying. Because it is inside a macro function&lt;BR /&gt;- Dwight</description>
      <pubDate>Thu, 28 Mar 2019 05:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Accessing-Table-records-using-row-column-indexing-inside-a-macro/m-p/546789#M151458</guid>
      <dc:creator>dwights</dc:creator>
      <dc:date>2019-03-28T05:21:49Z</dc:date>
    </item>
  </channel>
</rss>

