Ken Kleinman

Biostatistician

  • Increase font size
  • Default font size
  • Decrease font size

The "do over" syntax for arrays

E-mail Print PDF

This is another useful not-a-trick.

No longer to be found in the documentation is the "do over" syntax, which can simplify code and keep datasets narrower.  The syntax works like this:

   data ...;

array arrayname x y z var1 - var3;

do over arrayname;

if arrayname lt 0 then arrayname eq 0;

end;

run;

 

In the example above, all the variables listed after "arrayname" are recoded so that the smallest value is 0.  Note that the array is not explicitly indexed, even with the [*] format.

 

Contents


RSS feed