What report will be produced with these SAS codes -


given sas data set work.one:

  x  y   z    -  -  --    1   27    1   33    1  b  45    2   52    2  b  69    3  b  70    4   82    4  c  91 

the following sas program submitted:

  data work.two;      set work.one;       x y;      if first.y;   run;   proc print data=work.two noobs;   run; 

i don't understand first. , last. after statement 2 variables. if it's y; if first.y; know what's going on in data step. now, seems bit more complicated.

two contain records one first record each new value of y, or each new value of x (if additional records). so, first record 1 a, 1 b, 2 a, 2 b, 3 b, 4 a, , 4 c.

basically, in compound by statement, each time variable's value changes, variable and every variable right in statement sets first. 1 (true).


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -