BookmarkSubscribeRSS Feed
nata1
Calcite | Level 5

data repeat;
input month irri $ rep response;
datalines;
1 irri60 1 13
1 irri60 2 14
1 irri60 3 15
1 irri80 1 16
1 irri80 2 16
1 irri80 3 16
2 irri60 1 15
2 irri60 2 14
2 irri60 3 15
2 irri80 1 24
2 irri80 2 27
2 irri80 3 25
3 irri60 1 17
3 irri60 2 16
3 irri60 3 17
3 irri80 1 32
3 irri80 2 27
3 irri80 3 30
4 irri60 1 19
4 irri60 2 17
4 irri60 3 23
4 irri80 1 32
4 irri80 2 38
4 irri80 3 34
5 irri60 1 20
5 irri60 2 19
5 irri60 3 26
5 irri80 1 35
5 irri80 2 40
5 irri80 3 37
;

3 REPLIES 3
nata1
Calcite | Level 5
Thank you, it worked!
this data was for repeated measures anaysis
Jagadishkatam
Amethyst | Level 16

we can achieve the same by arrays as below 

 

data want;
set repeat;
by month irri;
retain rep1-rep3;
array resp(*) rep1-rep3;
do i = 1 to dim(resp);
if first.irri then resp(i)=.;
end;
if response ne . then resp(rep)=response;
if last.irri;
drop rep response i;
run;
Thanks,
Jag

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2010 views
  • 1 like
  • 3 in conversation