BookmarkSubscribeRSS Feed
telescopic
Calcite | Level 5

Question1) When I run the following iteration at SAS/base, the log window won't pause. I want to see the 'z' result at each iteration k. How can i do that?

If I am correct, command 'pause;' work only inside a module.

Question 2) Does it exist a summary listing or explorer telling the matrices' size in SAS/iml, like Matlab? I always use 'print' , but it's not convenient.

Thanks you

-----------------------------------------------

proc iml;
reset log print;
use Myfile var{a b c d};
names={a b c d};
read all into X[colname=names];


use Myfile var{e};
names={e};
read all into r[colname=names];


%let H=5;
%let d_plus1=7;
W= (uniform( repeat(0,&H,&d_plus1) )*0.02)-0.01;  /*generate uniform random matrix*/
V= (uniform( repeat(0,&H,1) ) )*0.02-0.01;

do k=1 to 50;
z=1/( 1+EXP(-W*(X`)) );           /*I want to see this result at every k value*/

end;

1 REPLY 1
Rick_SAS
SAS Super FREQ

Well, if that's really what you want, you can wrap a little module around the loop like this: 

start foo;

do k=1 to 50;

   z=1/( 1+EXP(-W*(X`)) ); /*I want to see this result at every k value*/

   pause;

end;

finish;

run foo;

Alternatively, just print all the values and then scroll up in the output window.

 

2) You might want the SHOW command: http://blogs.sas.com/iml/index.php?/archives/142-Listing-SASIML-Variables.html

 

3) In SAS/IML Studio (which is good for beginners), you can use the pause in "open code" (=not in a module). See http://blogs.sas.com/iml/index.php?/archives/123-How-to-Learn-SASIML-Five-Resources-for-the-Beginner...

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 921 views
  • 0 likes
  • 2 in conversation