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-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

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