Hello, I have the below code that works as a retain statement in SAS. However, I believe it could be done more effectively using an array statement and was wondering if someone could shead some light on how I could do it or even show me. DATA CONCAT ;
SET WEEKS_OWNERSHIPS;
BY SBR_ID;
FORMAT RESORT1 RESORT2 RESORT3 $500.;
RETAIN RESORT1 RESORT2 RESORT3 ;
IF FIRST.SBR_ID THEN DO;
RESORT1=''; RESORT2='';RESORT3='';FLAG1=. ;
END;
IF FLAG1 = . THEN DO
RESORT1=RESORT_ID;
END;
IF FLAG1 = 1 THEN DO
RESORT2=RESORT_ID;
END;
IF FLAG1 = 2 THEN DO
RESORT3=RESORT_ID;
END;
FLAG1+1;
IF LAST.SBR_ID THEN OUTPUT;
RUN; Thanks, Cam
... View more