<?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 SAS PROCEDURES INDISE A DO LOOP. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520237#M3992</link>
    <description>&lt;P&gt;I am trying to create a macro which does simulation. Inside the macro I have PROC IML. Inside the PROC IML I have a DO LOOP. Inside that DO LOOP, how can I use SAS procedure? I would really appreciate an simple example of this.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Dec 2018 03:57:15 GMT</pubDate>
    <dc:creator>themanoj20080</dc:creator>
    <dc:date>2018-12-11T03:57:15Z</dc:date>
    <item>
      <title>SAS PROCEDURES INDISE A DO LOOP.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520237#M3992</link>
      <description>&lt;P&gt;I am trying to create a macro which does simulation. Inside the macro I have PROC IML. Inside the PROC IML I have a DO LOOP. Inside that DO LOOP, how can I use SAS procedure? I would really appreciate an simple example of this.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 03:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520237#M3992</guid>
      <dc:creator>themanoj20080</dc:creator>
      <dc:date>2018-12-11T03:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS PROCEDURES INDISE A DO LOOP.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520247#M3993</link>
      <description>&lt;P&gt;SAS Procedures cannot be run inside each other, they have to run on their own sequentially - one after another.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could have a macro loop that runs PROC IML, then following that another PROC and keep repeating that sequence.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 05:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520247#M3993</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-12-11T05:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS PROCEDURES INDISE A DO LOOP.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520636#M4067</link>
      <description>&lt;P&gt;Actually, I have a macro to start with then I have proc iml.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro mymacro(mydata,X,Y,M);
proc corr data=&amp;amp;mydata outs=M;
var &amp;amp;X &amp;amp;Y;
run;

/*Now let's begin Proc IML*/
proc iml;
use &amp;amp;mydata; read all var{&amp;amp;X} into xvar;
use &amp;amp;mydata; read all var{&amp;amp;Y} into yvar;
create combined var{xvar,yvar};
append;
close combined;

use M;
read all var {&amp;amp;Y};
close M;
RR = &amp;amp;Y[4];

print RR;
AA=j(&amp;amp;M,1,0);
quit;

proc iml;
do i = 1 to &amp;amp;M;
	U=uniform(repeat(0,nrow(&amp;amp;X),1));
	create together var{&amp;amp;X,U};
	append;
	close together;
	
	proc sort data=together;
	by U;
	run;

	data together;
	merge together &amp;amp;mydata;
	run;
	
	
	proc corr data=together spearman outs=MM noprint;
	var &amp;amp;X &amp;amp;Y;
	run;
	

	use MM;
	read all var {&amp;amp;Y};
	close MM;
	R = &amp;amp;Y[4];
	*print R;
	
	if abs(R) &amp;gt; RR then AA[i]=1;
	else  AA[i]=0;
	

end;
quit;
p_value=mean(AA);
print p_value;

%mend mymacro;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Dec 2018 00:18:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520636#M4067</guid>
      <dc:creator>themanoj20080</dc:creator>
      <dc:date>2018-12-12T00:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS PROCEDURES INDISE A DO LOOP.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520637#M4068</link>
      <description>&lt;P&gt;What is wrong with the code that I just posted? I cannot get it to work.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 00:19:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520637#M4068</guid>
      <dc:creator>themanoj20080</dc:creator>
      <dc:date>2018-12-12T00:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS PROCEDURES INDISE A DO LOOP.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520640#M4069</link>
      <description>Hi:&lt;BR /&gt;  The SAS IML forum is here: &lt;A href="https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bd-p/sas_iml" target="_blank"&gt;https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bd-p/sas_iml&lt;/A&gt; you might have better response from participants who are using IML.&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 12 Dec 2018 00:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520640#M4069</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-12-12T00:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS PROCEDURES INDISE A DO LOOP.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520647#M4070</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/250512"&gt;@themanoj20080&lt;/a&gt;&amp;nbsp;- You have PROC SORT, a DATA step and PROC CORR code inside a PROC IML step. A PROC IML step can only contain PROC IML code and nothing else. Removing &lt;SPAN&gt;PROC SORT, the DATA step and PROC CORR&lt;/SPAN&gt; will get you closer to a working program.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 00:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520647#M4070</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-12-12T00:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS PROCEDURES INDISE A DO LOOP.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520650#M4071</link>
      <description>&lt;P&gt;Okay. I removed those procedures from proc iml. I quitted proc iml before the do loop and started with&lt;/P&gt;&lt;P&gt;%do i = 1 %to &amp;amp;M;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But still it is not working. I think the problem now is with use MM part.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 01:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520650#M4071</guid>
      <dc:creator>themanoj20080</dc:creator>
      <dc:date>2018-12-12T01:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS PROCEDURES INDISE A DO LOOP.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520750#M4082</link>
      <description>&lt;P&gt;Let's move this conversation to the IML Community:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-inside-SAS-Macro/m-p/520660/highlight/false#M4476" target="_blank"&gt;https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-inside-SAS-Macro/m-p/520660/highlight/false#M4476&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 11:29:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-PROCEDURES-INDISE-A-DO-LOOP/m-p/520750#M4082</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-12-12T11:29:32Z</dc:date>
    </item>
  </channel>
</rss>

