This is within a simulation, I run it for just one iteration, that is &p=1. The code has append and quit. Your help is highly need Sir Here is the log file: data KMM_&p; 570 set testt_&p; 571 set KM_&p; 572 if censored=1 then SurvivalM=Survival1; else SurvivalM=Survival1; 573 if censored=1 then InverseC=1/survival1; else InverseC=0; 574 keep time censored y frequency survival1 obs replicate SurvivalM InverseC; 575 run; 576 577 578 proc iml; 579 use KMM_&p; 580 read all var{ Replicate time censored obs y Frequency SURVIVAL1 SurvivalM InverseC } into 580! DM; 581 close; 581! /*close the link between the dataset and IML*/ 582 InverseC=DM[,9];SurvivalM=DM[,8];survival1=DM[,7]; frequency=DM[,6]; y=DM[,5];obs 582! =DM[,4]; censored=DM[,3]; time= DM[,2]; replicate = DM[,1]; /*Survivalival is second 582! column*/ /*time is first column*/ 583 584 n = nrow(byGroup); 585 u = unique(Replicate); 586 BIG=J(20,10,-1) ; 587 InverseC=J(nrow(survival1),1,1); 588 survival1= J(nrow(survival1),1,1); 589 t=J(nrow(survival1),1,1); 590 do k = 1 to nrow(byGroup); 591 byGroup = DM[loc(replicate=u ),]; 592 *byIdx = loc(Replicate=u ); /* the UNIQUE-LOC trick */ 593 *byGroup = DM[byIdx,]; /* extract BY group */ /* extract BY group 593! */ 594 InverseC=byGroup[,9];SurvivalM=byGroup[,8]; survival1=byGroup[,7]; 594! frequency=byGroup[,6];y=byGroup[,10];obs =byGroup[,4]; censored =byGroup[,3]; time= 594! byGroup[,2]; replicate= byGroup[,1]; 595 t=InverseC[(loc(InverseC^=0))]; print t; 596 tt=t(t); *print tt; 597 Big[(k-1)*10+(1:10),1:(sum(censored=1)+1)]=survival1*t(t); 598 end; 599 600 601 create GIB_&p from BIG[colname={COL1}]; 602 append from BIG; 603 quit; 604 605 606 OTE: There were 20 observations read from the data set WORK.TESTT_1. NOTE: There were 20 observations read from the data set WORK.KM_1. NOTE: The data set WORK.KMM_1 has 20 observations and 9 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds NOTE: IML Ready NOTE: Closing WORK.KMM_1 NOTE: Exiting IML. NOTE: The data set WORK.GIB_1 has 20 observations and 10 variables. NOTE: PROCEDURE IML used (Total process time): real time 0.01 seconds cpu time 0.01 seconds NOTE: Line generated by the invoked macro "SURV". 26 (InverseC^=0))]; print t; tt=t(t); *print tt; 26 ! Big[(k-1)*10+(1:10),1:(sum(censored=1)+1)]=survival1*t(t); end; create GIB_&p from 26 ! BIG[colname={COL1}]; append from BIG; quit; ; end; *print InverseC; --- 180 ERROR 180-322: Statement is not valid or it is used out of proper order.
... View more