Hello everyone, I'm try to use array to transpose long to wide format. However, the log shows "ERRO: Array subscript out of range at line 1602 column 8." Could you please tell me where the problem is? Thank you so much! 1586 data test; 1587 set C1_10; 1588 by casid; 1589 1590 retain 1591 ACEMED1-ACEMED6 ACEMED8 ACEMED10; 1592 1593 array aACEMED{8} ACEMED1-ACEMED6 ACEMED8 ACEMED10; 1594 1595 1596 if first.casid then do; 1597 do i=1 to 8; 1598 aACEMED{i}=.; 1599 end; 1600 end; 1601 1602 aACEMED{EXAMN}=ACEMED; 1603 1604 if last.casid then output; 1605 1606 keep casid 1607 ACEMED1-ACEMED6 ACEMED8 ACEMED10; 1608 1609 run; ERROR: Array subscript out of range at line 1602 column 8. CASID=7 WT=62 GHB=7.4 TOALC=0 SMEVR=1 SMNOW=0 NHTN=0 TCHOL=245 HDL=45 TRIG=158 LDL=168 AGE=44.07118412 DUR=30.71321013 SBP=109 DBP=60 THENAER=2.625374813 EXAMN=10 WHR=0.857580398 BMI=23.77095534 LVEDU=3 HINYR=1 TOTUNI=50 MARST=3 FHHBP=1 WBC=4.5 REABP=0 ACEMED=0 LIPMED=0 GFRCG=100.3226373 ESTGDR=8.824056209 Fromcycle=10 DCCTA1c=7.7407407407 totuniwt=0.8064516129 observed=1 FIRST.CASID=0 LAST.CASID=1 ACEMED1=0 ACEMED2=0 ACEMED3=0 ACEMED4=0 ACEMED5=0 ACEMED6=0 ACEMED8=. ACEMED10=0 i=. _ERROR_=1 _N_=8 NOTE: The SAS System stopped processing this step because of errors. NOTE: There were 9 observations read from the data set WORK.C1_10. WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0 observations and 9 variables. WARNING: Data set WORK.TEST was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds
... View more