<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Some programing problem about SAS macro. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755517#M238463</link>
    <description>&lt;P&gt;1.Your log has warnings and error messages. Please pay attention to them.&lt;/P&gt;
&lt;P&gt;2.Run the code in parts, step by step and then convert it to macro.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jul 2021 00:46:31 GMT</pubDate>
    <dc:creator>Sajid01</dc:creator>
    <dc:date>2021-07-21T00:46:31Z</dc:date>
    <item>
      <title>Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755228#M238308</link>
      <description>&lt;P&gt;Hello all, I was hoping to find some help regarding this macro, which is from a paper named "A SAS macro for estimation of direct adjusted survival curves based on a stratified Cox regression model". However, when I try to apply the macro using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname data "C:\Research 2\datacheck\datacheck1";&lt;BR /&gt;%INCLUDE 'ADJSURV.sas';&lt;BR /&gt;%_ADJSURV (data=data.cox&lt;BR /&gt;, time=time&lt;BR /&gt;, event=event&lt;BR /&gt;, group=group&lt;BR /&gt;, x=sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after&lt;BR /&gt;, model=1&lt;BR /&gt;, out=data.coxout);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here comes a lot of error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble identifying the cause, and I am sure this would be a simple resolution for someone with more experience utilizing macros. Any help would be very much appreciated. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code from the paper:&lt;/P&gt;&lt;PRE&gt;/*****************************************************************
                                                                  
_ADJSURV calculates the direct adjusted survival probabilities   
for K treatment groups at predetermined time points, based on     
a regular Cox model (Model=2) or a stratified Cox regression model
(Model=1).                                                        
                                                                  
Macro parameters:                                                 
   inputdata - the input sas data name;                           
   time      - the survival time variable;                        
   event     - the event indicator;                               
   group     - the treatment group variable,                      
                    which must take values 1,...,K for K&amp;lt;10 groups  
   covlist   - a list of covariate names;                         
   model     - 1 if a stratified Cox model is selected,           
               2 if a regular Cox model is selected;              
   outdata   - the output sas data name.                          
                                                                  
The output dataset contains:                                      
   time - the event times                                         
   survi, i=1,...,K                                               
   sei,   i=1,...,K                                               
   seij, 1&amp;lt;=i&amp;lt;j&amp;lt;=K                                               

Authored by Xu Zhang 2007
Re-formatted by Rodney Sparapani 02/17/2014                                                                    
*****************************************************************/

%*macro ADJSURV(inputdata, time, event, group, covlist, model, outdata); 
    
%macro _ADJSURV(data=REQUIRED, out=REQUIRED, time=REQUIRED, 
    event=REQUIRED, group=REQUIRED, x=REQUIRED, model=1, 
    inputdata=&amp;amp;data, outdata=&amp;amp;out, covlist=&amp;amp;x);

%_require(&amp;amp;data &amp;amp;time &amp;amp;event &amp;amp;group &amp;amp;out &amp;amp;x)

%local numgroup numcov i j adj1 adj2 group iter strata1 strata2;

%let covlist=%_list(&amp;amp;covlist); %* 08/18/15;

proc means data=&amp;amp;inputdata noprint;
    var &amp;amp;group;
    output out=maxout max(&amp;amp;group)=numgroup;
run;

data _null_;
    set maxout;
    call symput('numgroup', numgroup);	
run;

proc iml;
    use &amp;amp;inputdata;
    read all var {&amp;amp;covlist} into x;
    close &amp;amp;inputdata;

    numcov=ncol(x);

    create ncovout from numcov[colname='numcov'];
    append from numcov;
    close ncovout;
run;
quit;

data _null_;
    set ncovout;
    call symput('numcov', numcov);
run;

%if &amp;amp;model=2 %then %do;    

/************************************/
/*                                  */
/*  Model 2 : A regular Cox model   */
/*                                  */
/************************************/

/*************************************************/
/*                                               */
/*  Assign names to variables in the input data. */
/*                                               */
/*************************************************/

proc iml;
    use &amp;amp;inputdata;
    read all var {&amp;amp;time} into time;
    read all var {&amp;amp;event} into event;
    read all var {&amp;amp;group} into group;
    read all var {&amp;amp;covlist} into x;
    close &amp;amp;inputdata;

    numobs=nrow(time);

    gmat=j(&amp;amp;numgroup, &amp;amp;numgroup-1, 0);
    do i=2 to &amp;amp;numgroup;
 	gmat[i, i-1]=1;
    end;

    zmat=j(numobs, &amp;amp;numgroup-1+&amp;amp;numcov, 0);
    do i=1 to numobs;
	zmat[i,]=gmat[group[i],]||x[i,];
    end;

    out=time||event||zmat;

    names={'time' 'event' %do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; "z&amp;amp;i" %end;};
    create indata from out[colname=names];
    append from out;
    close indata;
quit;

/**********************************************/
/*                                            */
/*  Get regression coefficient estimates from */
/*  proc phreg, read in these estimates and   */
/*  calculate s0(b,t), s1(b,t).               */
/*                                            */
/**********************************************/

ODS LISTING CLOSE;    
proc freq data=indata; 
    where event=1; 
    table time/out=dcount; 
run;    
ODS LISTING;    
    
proc sort data=indata; 
    by descending time event; 
run;            
            
proc phreg data=indata covout outest=best noprint;
    model time*event(0)=
        %do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; z&amp;amp;i %end;;
    output out=coxout xbeta=zb;	
run;

proc sort data=coxout; 
    by descending time; 
run;

data best sigma;
    set best;
    if _type_='PARMS' then output best;
    if _type_='COV' then output sigma; 
run;

data riskset;
    set coxout; 
    by descending time;
    keep time s0 s1:;
    
    s0+exp(zb);
    
    %do i=1 %to &amp;amp;numcov+&amp;amp;numgroup-1;
	s1_&amp;amp;i+z&amp;amp;i * exp(zb);
    %end;
    
    if event;
run;

data riskset;
    set riskset; 
    by descending time;
    
    if last.time;
run;
    
proc sort data=riskset; 
    by time; 
run;
    
data riskset;
    merge riskset dcount (keep=time count); 
    by time;
run;

/****************************************/
/*                                      */
/*  Get weighted survival function      */
/*  estimate and its variance estimate  */
/*                                      */
/****************************************/
                   
proc iml;
    use riskset;
    read all var{time} into time;
    read all var{s0} into s0;
    read all var{%do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; s1_&amp;amp;i %end;} into s1;
    read all var{count} into count;
    close riskset;
              
    use best;
    read all var{%do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; z&amp;amp;i %end;} into b;
    close best;

    use sigma;
    read all var{%do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; z&amp;amp;i %end;} into sigma;
    close sigma;

    use indata;
    read all var{%do i=&amp;amp;numgroup %to &amp;amp;numgroup-1+&amp;amp;numcov; z&amp;amp;i %end;} into zmat;
    close indata;

    numtime=nrow(time);
    numobs=nrow(zmat);
    numcov=ncol(s1);    

    ctemp=0;
    wtemp=0;
    cumuhaz=j(numtime,1,0);
    w1=j(numtime,1,0);

    do i=1 to numtime;
   	ctemp=ctemp+count[i]/s0[i];
	wtemp=wtemp+count[i]/s0[i]/s0[i];
	cumuhaz[i]=ctemp;
	w1[i]=wtemp;
    end;
    
/********************************************************/
/*                                                      */
/*  Do loop calculate the direct adjusted probabilities */
/*  and their variance estimates at time 'tau'.         */
/*                                                      */
/********************************************************/
   
    g=j(&amp;amp;numgroup, &amp;amp;numgroup-1,0);

    do i=2 to &amp;amp;numgroup;
        g[i,i-1]=1;
    end;

    survmat=time;
        
    %do iter=1 %to &amp;amp;numgroup;    
    zz=j(numobs, &amp;amp;numgroup-1+&amp;amp;numcov, 0);

    do 	i=1 to numobs;
	zz[i,]=g[&amp;amp;iter,]||zmat[i,];
    end;
  	
    adjsurv=j(numtime,1,0);      
    fexpbz=j(numtime,1,0);
    fh=j(numtime,numcov,0);

    do i=1 to numobs;
        expbz=exp(zz[i,]*t(b));
        surv=exp(-cumuhaz)##expbz;
        adjsurv=adjsurv+surv;
	fexpbz=fexpbz+surv#expbz;

	h=j(numtime,numcov,0);
	htemp=j(1,numcov,0);
    
	do j=1 to numtime;
	    htemp=htemp+count[j]/s0[j]*(zz[i,]-s1[j,]/s0[j]);
	    h[j,]=htemp;
	end;

	fh=fh+surv#h#expbz;
    end;
    
    term1=(fexpbz##2)#w1;
    term2=j(numtime,1,0);
    
    do i=1 to numtime;
	term2[i]=fh[i,]*sigma*t(fh[i,]);
    end;
    
    varsurv=term1+term2;
    adjsurv=adjsurv/numobs;
    varsurv=varsurv/numobs/numobs;

    sesurv=varsurv##0.5;                 

    survmat=survmat||adjsurv||sesurv;                                
    %end;

/*********************************************************/
/*                                                       */
/*  Calculate covariance estimates between two direct    */
/*  adjusted survival probabilities.                     */
/*                                                       */
/*********************************************************/

    %do adj1=1 %to &amp;amp;numgroup;

    z1=j(numobs, &amp;amp;numgroup-1+&amp;amp;numcov, 0);
    
    do i=1 to numobs;
	z1[i,]=g[&amp;amp;adj1,]||zmat[i,];
    end;

        %do adj2=&amp;amp;adj1+1 %to &amp;amp;numgroup;

        z2=j(numobs, &amp;amp;numgroup-1+&amp;amp;numcov, 0);    	

        do i=1 to numobs;
            z2[i,]=g[&amp;amp;adj2,]||zmat[i,];
        end;
 
        fe2_fe1=j(numtime,1,0);
        fh2_fh1=j(numtime,numcov,0);

        do i=1 to numobs;
            h1=j(numtime,numcov,0);
            htemp1=j(1,numcov,0);
            
            do j=1 to numtime;
                htemp1=htemp1+count[j]/s0[j]*(z1[i,]-s1[j,]/s0[j]);
                h1[j,]=htemp1;
            end;

            h2=j(numtime,numcov,0);
            htemp2=j(1,numcov,0);
            
            do j=1 to numtime;
                htemp2=htemp2+count[j]/s0[j]*(z2[i,]-s1[j,]/s0[j]);
        	h2[j,]=htemp2;
            end;

            expbz1=exp(z1[i,]*t(b));
            expbz2=exp(z2[i,]*t(b));
            surv1=exp(-cumuhaz)##expbz1;
            surv2=exp(-cumuhaz)##expbz2;

            fe2_fe1=fe2_fe1+surv2#expbz2-surv1#expbz1;
            fh2_fh1=fh2_fh1+surv2#h2#expbz2-surv1#h1#expbz1;
        end;

        term1=(fe2_fe1##2)#w1;
        term2=j(numtime,1,0);
        
        do i=1 to numtime;
            term2[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
        end;

        covar=term1+term2;            
        covar=covar/numobs/numobs;                
        sqcov=covar##0.5;                

        survmat=survmat||sqcov;
        
        %end;
    %end;    
                 
    names={'time' %do i=1 %to &amp;amp;numgroup; "surv&amp;amp;i" "se&amp;amp;i" %end; 
        %do i=1 %to &amp;amp;numgroup; 
            %do j=&amp;amp;i+1 %to &amp;amp;numgroup; "se&amp;amp;i.&amp;amp;j" %end; 
        %end; };
    create mout from survmat[colname=names]; 
    append from survmat; 
    close mout;
run;
quit;

%end;
%else %do;

/***************************************/
/*                                     */
/*  Model 1 : a stratified Cox model   */
/*                                     */
/***************************************/    

proc iml;
    use &amp;amp;inputdata;
    read all var {&amp;amp;time} into time;
    read all var {&amp;amp;event} into event;
    read all var {&amp;amp;group} into group;
    read all var {&amp;amp;covlist} into x;
    close &amp;amp;inputdata;
    
    out=time||event||group||x;

    names={'time' 'event' 'strata' %do i=1 %to &amp;amp;numcov; "z&amp;amp;i" %end;};
    create indata from out[colname=names];
    append from out;
    close indata;
run;
quit;

/**********************************************/
/*                                            */
/*  Get regression coefficient estimates from */
/*  proc phreg, read in these estimates and   */
/*  calculate s0(b,t), s1(b,t).               */
/*                                            */
/**********************************************/
    
proc sort data=indata; 
    by descending time descending event; 
run;                        

data alltime;
    set indata (keep=time event); 
    by descending time;
    drop event;
    
    if first.time;
    
    if event;
run;

proc sort data=alltime; 
    by time; 
run;

proc phreg data=indata covout outest=best noprint;
    model time*event(0)=%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;;
    strata strata;
    output out=coxout xbeta=zb;
run;

proc sort data=coxout; 
    by strata descending time; 
run;

data best sigma;
    set best;
    
    if _type_='PARMS' then output best;
    else if _type_='COV' then output sigma; 
run;
   
    %do group=1 %to &amp;amp;numgroup;       

data riskset&amp;amp;group;
    set coxout (keep=time strata %do i=1 %to &amp;amp;numcov; z&amp;amp;i %end; zb); 
    where strata=&amp;amp;group;
    by descending time;
    keep time s0 %do i=1 %to &amp;amp;numcov; s1_&amp;amp;i %end;;
    
    s0+exp(zb);
    
    %do i=1 %to &amp;amp;numcov;
	s1_&amp;amp;i+z&amp;amp;i * exp(zb);
    %end;
    
    if last.time;
run;

proc sort data=riskset&amp;amp;group; 
    by time; 
run;

ODS LISTING CLOSE;    
proc freq data=indata; 
    where strata=&amp;amp;group &amp;amp; event=1; 
    table time/out=dcount&amp;amp;group; 
run;    
ODS LISTING;    

data riskset&amp;amp;group;
    merge alltime (in=inall) riskset&amp;amp;group dcount&amp;amp;group (keep=time count); 
    by time;
    drop ts:;
    retain ts0 %do i=1 %to &amp;amp;numcov; ts1_&amp;amp;i %end; 999;
    
    if inall;
    
    if count=. then count=0;
    
    if s0^=. then ts0=s0;
    else s0=ts0;
    
    %do i=1 %to &amp;amp;numcov;
	if s1_&amp;amp;i^=. then ts1_&amp;amp;i=s1_&amp;amp;i;
	else s1_&amp;amp;i=ts1_&amp;amp;i;
    %end;
run;              
                  
/*****************************************************/
/*                                                   */
/*  Calculate direct adjusted survival probabilites  */
/*  and their variance estimates at time 'tau'.      */
/*                                                   */
/*****************************************************/
       
proc iml;
    use riskset&amp;amp;group;
    read all var{time} into time;
    read all var{s0} into s0;
    read all var{%do i=1 %to &amp;amp;numcov; s1_&amp;amp;i %end;} into s1;
    read all var{count} into count;
    close riskset&amp;amp;group;
        
    use best;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into b;
    close best;

    use sigma;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into sigma;
    close sigma;
                
    use indata;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into zmat;
    close indata;
    
    numtime=nrow(s0);
    numcov=ncol(s1);            
                                  
    cumuhaz=j(numtime,1,0);
    w1=j(numtime,1,0);
       
    ctemp=0;
    wtemp=0;       
    
    do i=1 to numtime;
        ctemp=ctemp+count[i]/s0[i];
        wtemp=wtemp+count[i]/s0[i]/s0[i];       
 	cumuhaz[i]=ctemp;
	w1[i]=wtemp;
    end; 
                         
    numobs=nrow(zmat);
        
    adjsurv=j(numtime,1,0);
    varsurv=j(numtime,1,0);    
    fexpbz=j(numtime,1,0);
    fh=j(numtime,numcov,0);
    
    do i=1 to numobs;
        expbz=exp(zmat[i,]*t(b));
        surv=exp(-cumuhaz)##expbz;
        adjsurv=adjsurv+surv;
	fexpbz=fexpbz+surv#expbz;	

    	h=j(numtime,numcov,0);
 	htemp=j(1, numcov, 0);
    
	do j=1 to numtime;
	    htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]); 
	    h[j,]=htemp;
    	end;
    
	fh=fh+surv#h#expbz;
    end;
    
    adjsurv=adjsurv/numobs;
    term1=(fexpbz##2)#w1;
    term2=j(numtime,1,0);
    
    do i=1 to numtime;
	term2[i]=fh[i,]*sigma*t(fh[i,]);
    end;

    varsurv=term1+term2;
    varsurv=varsurv/numobs/numobs;
    sesurv=varsurv##0.5;
   
    outmat=time||adjsurv||sesurv;
    names={'time' 'surv' 'se'};
    create surv&amp;amp;group from outmat[colname=names];
    append from outmat;
    close surv&amp;amp;group;
run;
quit;            

%end;                                  
                    
/*******************************************************/
/*                                                     */
/*  Calculate covariance estimates between two direct  */
/*  adjusted survival probabilities.                   */
/*                                                     */
/*******************************************************/                

%do strata1=1 %to &amp;amp;numgroup;
    %do strata2=&amp;amp;strata1+1 %to &amp;amp;numgroup;
    
proc iml;
    use riskset&amp;amp;strata1;
    read all var{time} into time;
    read all var{s0} into s01;
    read all var{%do i=1 %to &amp;amp;numcov; s1_&amp;amp;i %end;} into s11;
    read all var{count} into count1; 
    close riskset&amp;amp;strata1;        

    use riskset&amp;amp;strata2;
    read all var{s0} into s02;
    read all var{%do i=1 %to &amp;amp;numcov; s1_&amp;amp;i %end;} into s12;
    read all var{count} into count2; 
    close riskset&amp;amp;strata2;                
        
    use best;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into b;
    close best;
        
    use sigma;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into sigma;
    close sigma;
                            
                    
    use indata;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into zmat;
    close indata;
    
    numtime=nrow(time);               
    numobs=nrow(zmat);
    numcov=ncol(s11);
    
    cumuhaz1=j(numtime,1,0);
    cumuhaz2=j(numtime,1,0);
    w1=j(numtime,1,0);
    w2=j(numtime,1,0);
    ctemp1=0;
    ctemp2=0;  
    wtemp1=0;
    wtemp2=0;  
 
    do i=1 to numtime;
        ctemp1=ctemp1+count1[i]/s01[i];
        ctemp2=ctemp2+count2[i]/s02[i];
	wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
	wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
    	cumuhaz1[i]=ctemp1;
    	cumuhaz2[i]=ctemp2;
    	w1[i]=wtemp1;
    	w2[i]=wtemp2;
    end;

    fexpbz1=j(numtime,1,0);
    fexpbz2=j(numtime,1,0);
    fh2_fh1=j(numtime,numcov,0);

    do i=1 to numobs;
        expbz=exp(zmat[i,]*t(b));
        surv1=exp(-cumuhaz1)##expbz;
        surv2=exp(-cumuhaz2)##expbz; 
	fexpbz1=fexpbz1+surv1#expbz;
	fexpbz2=fexpbz2+surv2#expbz;

    	h1=j(numtime,numcov,0);
	h2=j(numtime,numcov,0);
 	htemp1=j(1, numcov, 0);
	htemp2=j(1, numcov, 0);

	do j=1 to numtime;
	    htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]); 
	    htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]); 
	    h1[j,]=htemp1;
	    h2[j,]=htemp2;
    	end;

	fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
    end;

    term1=(fexpbz1##2)#w1;
    term2=(fexpbz2##2)#w2;
    term3=j(numtime,1,0);

    do i=1 to numtime;
	term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
    end;

    covar=term1+term2+term3;
    covar=covar/numobs/numobs;

    cov=covar##0.5;
    names={'se'};
    create cov&amp;amp;strata1&amp;amp;strata2 from cov[colname=names];
    append from cov;
    close cov&amp;amp;strata1&amp;amp;strata2;
run;
quit;    
     
    %end;
%end;

data mout;
    merge  
        %do group=1 %to &amp;amp;numgroup; 
            surv&amp;amp;group (rename=(surv=surv&amp;amp;group se=se&amp;amp;group)) 
        %end;
        
        %do i=1 %to &amp;amp;numgroup; 
            %do j=&amp;amp;i+1 %to &amp;amp;numgroup; cov&amp;amp;i&amp;amp;j (rename=(se=se&amp;amp;i.&amp;amp;j)) %end; 
        %end;;
run;        

%end;

/**************************************/
/*                                    */
/*  Make final output data            */
/*                                    */
/**************************************/     

data &amp;amp;outdata;
    time=0;
    
    %do i=1 %to &amp;amp;numgroup; 
        surv&amp;amp;i=1; 
        se&amp;amp;i=0;
        
        %do j=&amp;amp;i+1 %to &amp;amp;numgroup; se&amp;amp;i.&amp;amp;j=0; %end; 
    %end;        
        
    output;
run;

data &amp;amp;outdata;
    set &amp;amp;outdata mout;
    by time;
run;     
        
%mend;&lt;/PRE&gt;&lt;P&gt;Here is the log&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 libname data "C:\Research 2\datacheck\datacheck1";&lt;BR /&gt;2 %INCLUDE 'ADJSURV.sas';&lt;BR /&gt;708 %_ADJSURV (data=data.cox&lt;BR /&gt;709 , time=time&lt;BR /&gt;710 , event=event&lt;BR /&gt;711 , group=group&lt;BR /&gt;712 , x=sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5&lt;BR /&gt;712 ! comorbidities6 concurrent1 concurrent2 concurrent previous after&lt;BR /&gt;713 , model=1&lt;BR /&gt;714 , out=data.coxout);&lt;BR /&gt;1 %require(&amp;amp;data &amp;amp;time &amp;amp;event &amp;amp;group &amp;amp;out &amp;amp;x)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; -&lt;BR /&gt;&amp;nbsp; 180&lt;BR /&gt;WARNING: Apparent invocation of macro REQUIRE not resolved.&lt;BR /&gt;WARNING: Apparent invocation of macro _LIST not resolved.&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;3 proc means data=&amp;amp;inputdata noprint; var &amp;amp;group; output out=maxout&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ---&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;180&lt;BR /&gt;3 ! max(&amp;amp;group)=numgroup; run; data _null_; set maxout; call symput('numgroup',&lt;BR /&gt;3 ! numgroup); run; proc iml; use &amp;amp;inputdata; read all var {&amp;amp;covlist} into x;&lt;BR /&gt;3 ! close&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;3 proc means data=&amp;amp;inputdata noprint; var &amp;amp;group; output out=maxout&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;------&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;180&lt;BR /&gt;3 ! max(&amp;amp;group)=numgroup; run; data _null_; set maxout; call symput('numgroup',&lt;BR /&gt;3 ! numgroup); run; proc iml; use &amp;amp;inputdata; read all var {&amp;amp;covlist} into x;&lt;BR /&gt;3 ! close&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR: File WORK.MAXOUT.DATA does not exist.&lt;/P&gt;&lt;P&gt;1 %_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5&lt;BR /&gt;&amp;nbsp; &amp;nbsp; -&lt;BR /&gt;&amp;nbsp; &amp;nbsp;22&lt;BR /&gt;&amp;nbsp; &amp;nbsp;200&lt;BR /&gt;1 ! comorbidities6 concurrent1 concurrent2 concurrent previous after)&lt;BR /&gt;WARNING: Apparent invocation of macro _LIST not resolved.&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;BR /&gt;a numeric constant, a datetime constant, a missing value, (, (|, ), *, ',', -, =,&lt;BR /&gt;[, |, }.&lt;/P&gt;&lt;P&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data&lt;BR /&gt;contains characters that are not representable in the new encoding or truncation&lt;BR /&gt;occurred during transcoding.&lt;BR /&gt;&lt;BR /&gt;1 %_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5&lt;BR /&gt;&amp;nbsp; &amp;nbsp; -&lt;BR /&gt;&amp;nbsp; 22&lt;BR /&gt;&amp;nbsp; 200&lt;BR /&gt;1 ! comorbidities6 concurrent1 concurrent2 concurrent previous after)&lt;BR /&gt;WARNING: Apparent invocation of macro _LIST not resolved.&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;BR /&gt;a numeric constant, a datetime constant, a missing value, (, (|, ), *, ',', -, =,&lt;BR /&gt;[, |, }.&lt;/P&gt;&lt;P&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.&lt;BR /&gt;ERROR: The %TO value of the %DO GROUP loop is invalid.&lt;BR /&gt;ERROR: The macro _ADJSURV will stop executing.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 05:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755228#M238308</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-20T05:09:38Z</dc:date>
    </item>
    <item>
      <title>Some programing problem about SAS macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755219#M238462</link>
      <description>&lt;P&gt;Hello all, I was hoping to find some help regarding this macro, which is from a paper named "A SAS macro for estimation of direct adjusted survival curves based on a stratified Cox regression model". However, when I try to apply the macro using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname data "C:\Research 2\datacheck\datacheck1";&lt;BR /&gt;%INCLUDE 'ADJSURV.sas';&lt;BR /&gt;%_ADJSURV (data=data.cox&lt;BR /&gt;, time=time&lt;BR /&gt;, event=event&lt;BR /&gt;, group=group&lt;BR /&gt;, x=sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after&lt;BR /&gt;, model=1&lt;BR /&gt;, out=data.coxout);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I received a lot of error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble identifying the cause, and I am sure this would be a simple resolution for someone with more experience utilizing macros. Any help would be very much appreciated. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code from the paper:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*****************************************************************
                                                                  
_ADJSURV calculates the direct adjusted survival probabilities   
for K treatment groups at predetermined time points, based on     
a regular Cox model (Model=2) or a stratified Cox regression model
(Model=1).                                                        
                                                                  
Macro parameters:                                                 
   inputdata - the input sas data name;                           
   time      - the survival time variable;                        
   event     - the event indicator;                               
   group     - the treatment group variable,                      
                    which must take values 1,...,K for K&amp;lt;10 groups  
   covlist   - a list of covariate names;                         
   model     - 1 if a stratified Cox model is selected,           
               2 if a regular Cox model is selected;              
   outdata   - the output sas data name.                          
                                                                  
The output dataset contains:                                      
   time - the event times                                         
   survi, i=1,...,K                                               
   sei,   i=1,...,K                                               
   seij, 1&amp;lt;=i&amp;lt;j&amp;lt;=K                                               

Authored by Xu Zhang 2007
Re-formatted by Rodney Sparapani 02/17/2014                                                                    
*****************************************************************/

%*macro ADJSURV(inputdata, time, event, group, covlist, model, outdata); 
    
%macro _ADJSURV(data=REQUIRED, out=REQUIRED, time=REQUIRED, 
    event=REQUIRED, group=REQUIRED, x=REQUIRED, model=1, 
    inputdata=&amp;amp;data, outdata=&amp;amp;out, covlist=&amp;amp;x);

%_require(&amp;amp;data &amp;amp;time &amp;amp;event &amp;amp;group &amp;amp;out &amp;amp;x)

%local numgroup numcov i j adj1 adj2 group iter strata1 strata2;

%let covlist=%_list(&amp;amp;covlist); %* 08/18/15;

proc means data=&amp;amp;inputdata noprint;
    var &amp;amp;group;
    output out=maxout max(&amp;amp;group)=numgroup;
run;

data _null_;
    set maxout;
    call symput('numgroup', numgroup);	
run;

proc iml;
    use &amp;amp;inputdata;
    read all var {&amp;amp;covlist} into x;
    close &amp;amp;inputdata;

    numcov=ncol(x);

    create ncovout from numcov[colname='numcov'];
    append from numcov;
    close ncovout;
run;
quit;

data _null_;
    set ncovout;
    call symput('numcov', numcov);
run;

%if &amp;amp;model=2 %then %do;    

/************************************/
/*                                  */
/*  Model 2 : A regular Cox model   */
/*                                  */
/************************************/

/*************************************************/
/*                                               */
/*  Assign names to variables in the input data. */
/*                                               */
/*************************************************/

proc iml;
    use &amp;amp;inputdata;
    read all var {&amp;amp;time} into time;
    read all var {&amp;amp;event} into event;
    read all var {&amp;amp;group} into group;
    read all var {&amp;amp;covlist} into x;
    close &amp;amp;inputdata;

    numobs=nrow(time);

    gmat=j(&amp;amp;numgroup, &amp;amp;numgroup-1, 0);
    do i=2 to &amp;amp;numgroup;
 	gmat[i, i-1]=1;
    end;

    zmat=j(numobs, &amp;amp;numgroup-1+&amp;amp;numcov, 0);
    do i=1 to numobs;
	zmat[i,]=gmat[group[i],]||x[i,];
    end;

    out=time||event||zmat;

    names={'time' 'event' %do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; "z&amp;amp;i" %end;};
    create indata from out[colname=names];
    append from out;
    close indata;
quit;

/**********************************************/
/*                                            */
/*  Get regression coefficient estimates from */
/*  proc phreg, read in these estimates and   */
/*  calculate s0(b,t), s1(b,t).               */
/*                                            */
/**********************************************/

ODS LISTING CLOSE;    
proc freq data=indata; 
    where event=1; 
    table time/out=dcount; 
run;    
ODS LISTING;    
    
proc sort data=indata; 
    by descending time event; 
run;            
            
proc phreg data=indata covout outest=best noprint;
    model time*event(0)=
        %do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; z&amp;amp;i %end;;
    output out=coxout xbeta=zb;	
run;

proc sort data=coxout; 
    by descending time; 
run;

data best sigma;
    set best;
    if _type_='PARMS' then output best;
    if _type_='COV' then output sigma; 
run;

data riskset;
    set coxout; 
    by descending time;
    keep time s0 s1:;
    
    s0+exp(zb);
    
    %do i=1 %to &amp;amp;numcov+&amp;amp;numgroup-1;
	s1_&amp;amp;i+z&amp;amp;i * exp(zb);
    %end;
    
    if event;
run;

data riskset;
    set riskset; 
    by descending time;
    
    if last.time;
run;
    
proc sort data=riskset; 
    by time; 
run;
    
data riskset;
    merge riskset dcount (keep=time count); 
    by time;
run;

/****************************************/
/*                                      */
/*  Get weighted survival function      */
/*  estimate and its variance estimate  */
/*                                      */
/****************************************/
                   
proc iml;
    use riskset;
    read all var{time} into time;
    read all var{s0} into s0;
    read all var{%do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; s1_&amp;amp;i %end;} into s1;
    read all var{count} into count;
    close riskset;
              
    use best;
    read all var{%do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; z&amp;amp;i %end;} into b;
    close best;

    use sigma;
    read all var{%do i=1 %to &amp;amp;numgroup-1+&amp;amp;numcov; z&amp;amp;i %end;} into sigma;
    close sigma;

    use indata;
    read all var{%do i=&amp;amp;numgroup %to &amp;amp;numgroup-1+&amp;amp;numcov; z&amp;amp;i %end;} into zmat;
    close indata;

    numtime=nrow(time);
    numobs=nrow(zmat);
    numcov=ncol(s1);    

    ctemp=0;
    wtemp=0;
    cumuhaz=j(numtime,1,0);
    w1=j(numtime,1,0);

    do i=1 to numtime;
   	ctemp=ctemp+count[i]/s0[i];
	wtemp=wtemp+count[i]/s0[i]/s0[i];
	cumuhaz[i]=ctemp;
	w1[i]=wtemp;
    end;
    
/********************************************************/
/*                                                      */
/*  Do loop calculate the direct adjusted probabilities */
/*  and their variance estimates at time 'tau'.         */
/*                                                      */
/********************************************************/
   
    g=j(&amp;amp;numgroup, &amp;amp;numgroup-1,0);

    do i=2 to &amp;amp;numgroup;
        g[i,i-1]=1;
    end;

    survmat=time;
        
    %do iter=1 %to &amp;amp;numgroup;    
    zz=j(numobs, &amp;amp;numgroup-1+&amp;amp;numcov, 0);

    do 	i=1 to numobs;
	zz[i,]=g[&amp;amp;iter,]||zmat[i,];
    end;
  	
    adjsurv=j(numtime,1,0);      
    fexpbz=j(numtime,1,0);
    fh=j(numtime,numcov,0);

    do i=1 to numobs;
        expbz=exp(zz[i,]*t(b));
        surv=exp(-cumuhaz)##expbz;
        adjsurv=adjsurv+surv;
	fexpbz=fexpbz+surv#expbz;

	h=j(numtime,numcov,0);
	htemp=j(1,numcov,0);
    
	do j=1 to numtime;
	    htemp=htemp+count[j]/s0[j]*(zz[i,]-s1[j,]/s0[j]);
	    h[j,]=htemp;
	end;

	fh=fh+surv#h#expbz;
    end;
    
    term1=(fexpbz##2)#w1;
    term2=j(numtime,1,0);
    
    do i=1 to numtime;
	term2[i]=fh[i,]*sigma*t(fh[i,]);
    end;
    
    varsurv=term1+term2;
    adjsurv=adjsurv/numobs;
    varsurv=varsurv/numobs/numobs;

    sesurv=varsurv##0.5;                 

    survmat=survmat||adjsurv||sesurv;                                
    %end;

/*********************************************************/
/*                                                       */
/*  Calculate covariance estimates between two direct    */
/*  adjusted survival probabilities.                     */
/*                                                       */
/*********************************************************/

    %do adj1=1 %to &amp;amp;numgroup;

    z1=j(numobs, &amp;amp;numgroup-1+&amp;amp;numcov, 0);
    
    do i=1 to numobs;
	z1[i,]=g[&amp;amp;adj1,]||zmat[i,];
    end;

        %do adj2=&amp;amp;adj1+1 %to &amp;amp;numgroup;

        z2=j(numobs, &amp;amp;numgroup-1+&amp;amp;numcov, 0);    	

        do i=1 to numobs;
            z2[i,]=g[&amp;amp;adj2,]||zmat[i,];
        end;
 
        fe2_fe1=j(numtime,1,0);
        fh2_fh1=j(numtime,numcov,0);

        do i=1 to numobs;
            h1=j(numtime,numcov,0);
            htemp1=j(1,numcov,0);
            
            do j=1 to numtime;
                htemp1=htemp1+count[j]/s0[j]*(z1[i,]-s1[j,]/s0[j]);
                h1[j,]=htemp1;
            end;

            h2=j(numtime,numcov,0);
            htemp2=j(1,numcov,0);
            
            do j=1 to numtime;
                htemp2=htemp2+count[j]/s0[j]*(z2[i,]-s1[j,]/s0[j]);
        	h2[j,]=htemp2;
            end;

            expbz1=exp(z1[i,]*t(b));
            expbz2=exp(z2[i,]*t(b));
            surv1=exp(-cumuhaz)##expbz1;
            surv2=exp(-cumuhaz)##expbz2;

            fe2_fe1=fe2_fe1+surv2#expbz2-surv1#expbz1;
            fh2_fh1=fh2_fh1+surv2#h2#expbz2-surv1#h1#expbz1;
        end;

        term1=(fe2_fe1##2)#w1;
        term2=j(numtime,1,0);
        
        do i=1 to numtime;
            term2[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
        end;

        covar=term1+term2;            
        covar=covar/numobs/numobs;                
        sqcov=covar##0.5;                

        survmat=survmat||sqcov;
        
        %end;
    %end;    
                 
    names={'time' %do i=1 %to &amp;amp;numgroup; "surv&amp;amp;i" "se&amp;amp;i" %end; 
        %do i=1 %to &amp;amp;numgroup; 
            %do j=&amp;amp;i+1 %to &amp;amp;numgroup; "se&amp;amp;i.&amp;amp;j" %end; 
        %end; };
    create mout from survmat[colname=names]; 
    append from survmat; 
    close mout;
run;
quit;

%end;
%else %do;

/***************************************/
/*                                     */
/*  Model 1 : a stratified Cox model   */
/*                                     */
/***************************************/    

proc iml;
    use &amp;amp;inputdata;
    read all var {&amp;amp;time} into time;
    read all var {&amp;amp;event} into event;
    read all var {&amp;amp;group} into group;
    read all var {&amp;amp;covlist} into x;
    close &amp;amp;inputdata;
    
    out=time||event||group||x;

    names={'time' 'event' 'strata' %do i=1 %to &amp;amp;numcov; "z&amp;amp;i" %end;};
    create indata from out[colname=names];
    append from out;
    close indata;
run;
quit;

/**********************************************/
/*                                            */
/*  Get regression coefficient estimates from */
/*  proc phreg, read in these estimates and   */
/*  calculate s0(b,t), s1(b,t).               */
/*                                            */
/**********************************************/
    
proc sort data=indata; 
    by descending time descending event; 
run;                        

data alltime;
    set indata (keep=time event); 
    by descending time;
    drop event;
    
    if first.time;
    
    if event;
run;

proc sort data=alltime; 
    by time; 
run;

proc phreg data=indata covout outest=best noprint;
    model time*event(0)=%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;;
    strata strata;
    output out=coxout xbeta=zb;
run;

proc sort data=coxout; 
    by strata descending time; 
run;

data best sigma;
    set best;
    
    if _type_='PARMS' then output best;
    else if _type_='COV' then output sigma; 
run;
   
    %do group=1 %to &amp;amp;numgroup;       

data riskset&amp;amp;group;
    set coxout (keep=time strata %do i=1 %to &amp;amp;numcov; z&amp;amp;i %end; zb); 
    where strata=&amp;amp;group;
    by descending time;
    keep time s0 %do i=1 %to &amp;amp;numcov; s1_&amp;amp;i %end;;
    
    s0+exp(zb);
    
    %do i=1 %to &amp;amp;numcov;
	s1_&amp;amp;i+z&amp;amp;i * exp(zb);
    %end;
    
    if last.time;
run;

proc sort data=riskset&amp;amp;group; 
    by time; 
run;

ODS LISTING CLOSE;    
proc freq data=indata; 
    where strata=&amp;amp;group &amp;amp; event=1; 
    table time/out=dcount&amp;amp;group; 
run;    
ODS LISTING;    

data riskset&amp;amp;group;
    merge alltime (in=inall) riskset&amp;amp;group dcount&amp;amp;group (keep=time count); 
    by time;
    drop ts:;
    retain ts0 %do i=1 %to &amp;amp;numcov; ts1_&amp;amp;i %end; 999;
    
    if inall;
    
    if count=. then count=0;
    
    if s0^=. then ts0=s0;
    else s0=ts0;
    
    %do i=1 %to &amp;amp;numcov;
	if s1_&amp;amp;i^=. then ts1_&amp;amp;i=s1_&amp;amp;i;
	else s1_&amp;amp;i=ts1_&amp;amp;i;
    %end;
run;              
                  
/*****************************************************/
/*                                                   */
/*  Calculate direct adjusted survival probabilites  */
/*  and their variance estimates at time 'tau'.      */
/*                                                   */
/*****************************************************/
       
proc iml;
    use riskset&amp;amp;group;
    read all var{time} into time;
    read all var{s0} into s0;
    read all var{%do i=1 %to &amp;amp;numcov; s1_&amp;amp;i %end;} into s1;
    read all var{count} into count;
    close riskset&amp;amp;group;
        
    use best;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into b;
    close best;

    use sigma;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into sigma;
    close sigma;
                
    use indata;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into zmat;
    close indata;
    
    numtime=nrow(s0);
    numcov=ncol(s1);            
                                  
    cumuhaz=j(numtime,1,0);
    w1=j(numtime,1,0);
       
    ctemp=0;
    wtemp=0;       
    
    do i=1 to numtime;
        ctemp=ctemp+count[i]/s0[i];
        wtemp=wtemp+count[i]/s0[i]/s0[i];       
 	cumuhaz[i]=ctemp;
	w1[i]=wtemp;
    end; 
                         
    numobs=nrow(zmat);
        
    adjsurv=j(numtime,1,0);
    varsurv=j(numtime,1,0);    
    fexpbz=j(numtime,1,0);
    fh=j(numtime,numcov,0);
    
    do i=1 to numobs;
        expbz=exp(zmat[i,]*t(b));
        surv=exp(-cumuhaz)##expbz;
        adjsurv=adjsurv+surv;
	fexpbz=fexpbz+surv#expbz;	

    	h=j(numtime,numcov,0);
 	htemp=j(1, numcov, 0);
    
	do j=1 to numtime;
	    htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]); 
	    h[j,]=htemp;
    	end;
    
	fh=fh+surv#h#expbz;
    end;
    
    adjsurv=adjsurv/numobs;
    term1=(fexpbz##2)#w1;
    term2=j(numtime,1,0);
    
    do i=1 to numtime;
	term2[i]=fh[i,]*sigma*t(fh[i,]);
    end;

    varsurv=term1+term2;
    varsurv=varsurv/numobs/numobs;
    sesurv=varsurv##0.5;
   
    outmat=time||adjsurv||sesurv;
    names={'time' 'surv' 'se'};
    create surv&amp;amp;group from outmat[colname=names];
    append from outmat;
    close surv&amp;amp;group;
run;
quit;            

%end;                                  
                    
/*******************************************************/
/*                                                     */
/*  Calculate covariance estimates between two direct  */
/*  adjusted survival probabilities.                   */
/*                                                     */
/*******************************************************/                

%do strata1=1 %to &amp;amp;numgroup;
    %do strata2=&amp;amp;strata1+1 %to &amp;amp;numgroup;
    
proc iml;
    use riskset&amp;amp;strata1;
    read all var{time} into time;
    read all var{s0} into s01;
    read all var{%do i=1 %to &amp;amp;numcov; s1_&amp;amp;i %end;} into s11;
    read all var{count} into count1; 
    close riskset&amp;amp;strata1;        

    use riskset&amp;amp;strata2;
    read all var{s0} into s02;
    read all var{%do i=1 %to &amp;amp;numcov; s1_&amp;amp;i %end;} into s12;
    read all var{count} into count2; 
    close riskset&amp;amp;strata2;                
        
    use best;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into b;
    close best;
        
    use sigma;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into sigma;
    close sigma;
                            
                    
    use indata;
    read all var{%do i=1 %to &amp;amp;numcov; z&amp;amp;i %end;} into zmat;
    close indata;
    
    numtime=nrow(time);               
    numobs=nrow(zmat);
    numcov=ncol(s11);
    
    cumuhaz1=j(numtime,1,0);
    cumuhaz2=j(numtime,1,0);
    w1=j(numtime,1,0);
    w2=j(numtime,1,0);
    ctemp1=0;
    ctemp2=0;  
    wtemp1=0;
    wtemp2=0;  
 
    do i=1 to numtime;
        ctemp1=ctemp1+count1[i]/s01[i];
        ctemp2=ctemp2+count2[i]/s02[i];
	wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
	wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
    	cumuhaz1[i]=ctemp1;
    	cumuhaz2[i]=ctemp2;
    	w1[i]=wtemp1;
    	w2[i]=wtemp2;
    end;

    fexpbz1=j(numtime,1,0);
    fexpbz2=j(numtime,1,0);
    fh2_fh1=j(numtime,numcov,0);

    do i=1 to numobs;
        expbz=exp(zmat[i,]*t(b));
        surv1=exp(-cumuhaz1)##expbz;
        surv2=exp(-cumuhaz2)##expbz; 
	fexpbz1=fexpbz1+surv1#expbz;
	fexpbz2=fexpbz2+surv2#expbz;

    	h1=j(numtime,numcov,0);
	h2=j(numtime,numcov,0);
 	htemp1=j(1, numcov, 0);
	htemp2=j(1, numcov, 0);

	do j=1 to numtime;
	    htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]); 
	    htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]); 
	    h1[j,]=htemp1;
	    h2[j,]=htemp2;
    	end;

	fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
    end;

    term1=(fexpbz1##2)#w1;
    term2=(fexpbz2##2)#w2;
    term3=j(numtime,1,0);

    do i=1 to numtime;
	term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
    end;

    covar=term1+term2+term3;
    covar=covar/numobs/numobs;

    cov=covar##0.5;
    names={'se'};
    create cov&amp;amp;strata1&amp;amp;strata2 from cov[colname=names];
    append from cov;
    close cov&amp;amp;strata1&amp;amp;strata2;
run;
quit;    
     
    %end;
%end;

data mout;
    merge  
        %do group=1 %to &amp;amp;numgroup; 
            surv&amp;amp;group (rename=(surv=surv&amp;amp;group se=se&amp;amp;group)) 
        %end;
        
        %do i=1 %to &amp;amp;numgroup; 
            %do j=&amp;amp;i+1 %to &amp;amp;numgroup; cov&amp;amp;i&amp;amp;j (rename=(se=se&amp;amp;i.&amp;amp;j)) %end; 
        %end;;
run;        

%end;

/**************************************/
/*                                    */
/*  Make final output data            */
/*                                    */
/**************************************/     

data &amp;amp;outdata;
    time=0;
    
    %do i=1 %to &amp;amp;numgroup; 
        surv&amp;amp;i=1; 
        se&amp;amp;i=0;
        
        %do j=&amp;amp;i+1 %to &amp;amp;numgroup; se&amp;amp;i.&amp;amp;j=0; %end; 
    %end;        
        
    output;
run;

data &amp;amp;outdata;
    set &amp;amp;outdata mout;
    by time;
run;     
        
%mend;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and here is the log of SAS:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 libname data "C:\Research 2\datacheck\datacheck1";&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Libref DATA was successfully assigned as follows:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Engine: V9&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Physical Name: C:\Research 2\datacheck\datacheck1&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;2 %INCLUDE 'ADJSURV.sas';&lt;BR /&gt;708 %_ADJSURV (data=data.cox&lt;BR /&gt;709 , time=time&lt;BR /&gt;710 , event=event&lt;BR /&gt;711 , group=group&lt;BR /&gt;712 , x=sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5&lt;BR /&gt;712 ! comorbidities6 concurrent1 concurrent2 concurrent previous after&lt;BR /&gt;713 , model=1&lt;BR /&gt;714 , out=data.coxout);&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Line generated by the invoked macro "_ADJSURV".&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;1 %require(&amp;amp;data &amp;amp;time &amp;amp;event &amp;amp;group &amp;amp;out &amp;amp;x)&lt;BR /&gt;&lt;FONT color="#800000"&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; -&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;&amp;nbsp; 180&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;WARNING: Apparent invocation of macro REQUIRE not resolved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WARNING: Apparent invocation of macro _LIST not resolved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NOTE: Line generated by the invoked macro "_ADJSURV".&lt;/SPAN&gt;&lt;BR /&gt;3 proc means data=&amp;amp;inputdata noprint; var &amp;amp;group; output out=maxout&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#800000"&gt; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; ---&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;180&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;3 ! max(&amp;amp;group)=numgroup; run; data _null_; set maxout; call symput('numgroup',&lt;BR /&gt;3 ! numgroup); run; proc iml; use &amp;amp;inputdata; read all var {&amp;amp;covlist} into x;&lt;BR /&gt;3 ! close&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Line generated by the invoked macro "_ADJSURV".&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;3 proc means data=&amp;amp;inputdata noprint; var &amp;amp;group; output out=maxout&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;FONT color="#800000"&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;------&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;180&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;3 ! max(&amp;amp;group)=numgroup; run; data _null_; set maxout; call symput('numgroup',&lt;BR /&gt;3 ! numgroup); run; proc iml; use &amp;amp;inputdata; read all var {&amp;amp;covlist} into x;&lt;BR /&gt;3 ! close&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR: File WORK.MAXOUT.DATA does not exist.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Numeric values have been converted to character values at the places given by:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;(Line):(Column).&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;1079:162&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.01 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.01 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Writing HTML Body file: sashtml.htm&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: IML Ready&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;does not match the session encoding. Cross Environment Data Access will be used, which&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;might require additional CPU resources and might reduce performance.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Line generated by the macro variable "COVLIST".&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;1 %_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;FONT color="#800000"&gt;&amp;nbsp; -&lt;/FONT&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;22&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;200&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;1 ! comorbidities6 concurrent1 concurrent2 concurrent previous after)&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;WARNING: Apparent invocation of macro _LIST not resolved.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;a numeric constant, a datetime constant, a missing value, (, (|, ), *, ',', -, =,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;[, |, }.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.NCOVOUT has 1 observations and 1 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Module MAIN is undefined in IML; cannot be RUN.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Exiting IML.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: PROCEDURE IML used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.53 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.35 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Numeric values have been converted to character values at the places given by:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;(Line):(Column).&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;4:197&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: There were 1 observations read from the data set WORK.NCOVOUT.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.01 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.01 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: IML Ready&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;does not match the session encoding. Cross Environment Data Access will be used, which&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;might require additional CPU resources and might reduce performance.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;contains characters that are not representable in the new encoding or truncation&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;occurred during transcoding.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Line generated by the macro variable "COVLIST".&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;1 %_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; -&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;&amp;nbsp; 22&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;&amp;nbsp; 200&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;1 ! comorbidities6 concurrent1 concurrent2 concurrent previous after)&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;WARNING: Apparent invocation of macro _LIST not resolved.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;a numeric constant, a datetime constant, a missing value, (, (|, ), *, ',', -, =,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;[, |, }.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.INDATA has 979 observations and 3 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Module MAIN is undefined in IML; cannot be RUN.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Exiting IML.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: PROCEDURE IML used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.07 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.06 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: There were 979 observations read from the data set WORK.INDATA.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.INDATA has 979 observations and 3 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.03 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.03 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: There were 979 observations read from the data set WORK.INDATA.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.01 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.03 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: There were 166 observations read from the data set WORK.ALLTIME.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.01 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.01 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: There are no explanatory variables in the MODEL statement.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: Convergence criterion (GCONV=1E-8) satisfied.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.BEST has 1 observations and 5 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.COXOUT has 979 observations and 4 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: PROCEDURE PHREG used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.10 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.03 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: There were 979 observations read from the data set WORK.COXOUT.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.COXOUT has 979 observations and 4 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.01 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.00 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: There were 1 observations read from the data set WORK.BEST.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.BEST has 1 observations and 5 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: The data set WORK.SIGMA has 0 observations and 5 variables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;real time 0.03 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;cpu time 0.01 seconds&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR: The %TO value of the %DO GROUP loop is invalid.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;&lt;SPAN&gt;ERROR: The macro _ADJSURV will stop executing.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 04:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755219#M238462</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-20T04:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755234#M238312</link>
      <description>&lt;P&gt;First of all, please read the error message carefully. It's the basics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WARNING: Apparent invocation of macro REQUIRE not resolved.&lt;BR /&gt;WARNING: Apparent invocation of macro _LIST not resolved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have access to the paper, so I can't say for sure, but it seems that %require and %_list are not referenced in the code used internally.&lt;BR /&gt;We need to fix this first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any other code example in the paper?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 06:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755234#M238312</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-07-20T06:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755240#M238314</link>
      <description>&lt;P&gt;Thank you Kawakami. There are no other&amp;nbsp;&lt;SPAN&gt;code example in the paper. Though the log is long, there are mainly two errors. The one is&amp;nbsp;ERROR 180-322, and the other is&amp;nbsp;ERROR 22-322 and&amp;nbsp;ERROR 200-322. Are these errors fixable?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you again!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 06:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755240#M238314</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-20T06:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755244#M238318</link>
      <description>&lt;P&gt;That error is most likely caused by %_require, so first&lt;BR /&gt;The error is most likely caused by %_require, so I think you need to solve the problem of %_require and %_list first.&lt;BR /&gt;I think one way to do this is to ask the author of the paper.&lt;/P&gt;
&lt;P&gt;For now, try commenting out the %_require and %_list lines.&lt;BR /&gt;I don't know if it will work correctly, but I think it will fix the error you are seeing.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 07:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755244#M238318</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-07-20T07:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755249#M238320</link>
      <description>&lt;P&gt;The log:&lt;/P&gt;
&lt;PRE&gt;1 %require(&amp;amp;data &amp;amp;time &amp;amp;event &amp;amp;group &amp;amp;out &amp;amp;x)
    -
  180
WARNING: Apparent invocation of macro REQUIRE not resolved.
WARNING: Apparent invocation of macro _LIST not resolved.
&lt;/PRE&gt;
&lt;P&gt;complains about a macro called %REQUIRE, but the code as posted:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%_require(&amp;amp;data &amp;amp;time &amp;amp;event &amp;amp;group &amp;amp;out &amp;amp;x)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;calls a macro called %&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;_&lt;/FONT&gt;&lt;/STRONG&gt;REQUIRE. So your log does not come from the code as posted.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 07:49:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755249#M238320</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-20T07:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755253#M238324</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;said, the code and the log don't match. How can we help if you give incorrect information?&lt;/P&gt;
&lt;P&gt;Try commenting out the 2 lines.&amp;nbsp; %require seems to be a macro that checks that the variables are provided, and I am unsure what %list does, it might be mundane as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 08:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755253#M238324</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-20T08:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755343#M238361</link>
      <description>&lt;P&gt;Thank you ChrisNZ. The log did come out from the code. I upload some pictures, which shows more clearly.&lt;/P&gt;&lt;P&gt;Thank you again!&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61416i0805DDCF6A961F43/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61418iE004E88FD7BFADE7/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61419iE4C78D0985F72CA3/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61417iE3E9EE7CB46B5328/image-size/large?v=v2&amp;amp;px=999" role="button" title="4.png" alt="4.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 12:48:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755343#M238361</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-20T12:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755351#M238362</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;KurtBremser. The&amp;nbsp;log does come from the code as posted. I upload some pictures, which shows more clearly.&lt;/P&gt;&lt;P&gt;Thank you again!&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61420i77D0EABF417236A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61421i51CC0D056F9908AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61422i36236C0E06ABDC0F/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61423i6CAAF8C82A9FF032/image-size/large?v=v2&amp;amp;px=999" role="button" title="4.png" alt="4.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 12:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755351#M238362</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-20T12:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755352#M238363</link>
      <description>&lt;P&gt;Have you tried commenting out the 2 lines as suggested?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 12:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755352#M238363</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-20T12:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755353#M238364</link>
      <description>&lt;P&gt;Please do not post logs as screen captures. Please copy the entire log as text and paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon. DO NOT SKIP THIS STEP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition, to help with debugging, you should run this command before you run the macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, I agree with the above commenters, there are macros being referred to that are not being defined in your code. You need to straighten this out first; it's hard to help you when your code call a macro that SAS (and no one in this conversation) doesn't know about.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 12:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755353#M238364</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-20T12:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755364#M238369</link>
      <description>&lt;P&gt;Thank you ChrisNZ.&amp;nbsp;I have tried commenting out the 2 lines as you suggested. The warnings and errors did disappear and come a result. However, the result is not as the paper showed and this warning come out:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data&lt;BR /&gt;contains characters that are not representable in the new encoding or truncation&lt;BR /&gt;occurred during transcoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 13:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755364#M238369</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-20T13:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755366#M238370</link>
      <description>&lt;P&gt;Thank you PaigeMiller. I have tried&lt;/P&gt;&lt;PRE class="language-sas"&gt;&lt;CODE&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but it did not help.&lt;/P&gt;&lt;P&gt;I have tried commenting out the 2 lines as ChrisNZ suggested. The warnings and errors did disappear and come a result. However, the result is not as the paper showed and this warning come out:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data&lt;BR /&gt;contains characters that are not representable in the new encoding or truncation&lt;BR /&gt;occurred during transcoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 13:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755366#M238370</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-20T13:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755368#M238371</link>
      <description>&lt;P&gt;When posting logs (and code) use the Insert Code or Insert SAS Code icons in the forum editor so that you get a popup window to paste the lines of text.&amp;nbsp; This will preserve the formatting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Work your way through the errors starting with the first.&amp;nbsp; Make sure to turn on the MPRINT option so you can see the SAS code the macro generated so you know what code the errors are talking.&lt;/P&gt;
&lt;PRE&gt;1 %require(&amp;amp;data &amp;amp;time &amp;amp;event &amp;amp;group &amp;amp;out &amp;amp;x)
    -
  180
WARNING: Apparent invocation of macro REQUIRE not resolved.
WARNING: Apparent invocation of macro _LIST not resolved.

ERROR 180-322: Statement is not valid or it is used out of proper order.
3 proc means data=&amp;amp;inputdata noprint; var &amp;amp;group; output out=maxout
                                                                ---
                                                               180
3 ! max(&amp;amp;group)=numgroup; run; data _null_; set maxout; call symput('numgroup',
3 ! numgroup); run; proc iml; use &amp;amp;inputdata; read all var {&amp;amp;covlist} into x;
3 ! close
ERROR 180-322: Statement is not valid or it is used out of proper order.
3 proc means data=&amp;amp;inputdata noprint; var &amp;amp;group; output out=maxout
                                                                                   ------
                                                                                   180&lt;/PRE&gt;
&lt;P&gt;So first figure out why the macros you are calling do not exist.&amp;nbsp; If you don't have those macros then try to figure out from the code whether you really need them.&amp;nbsp; Perhaps you can skip that step?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The next error is hard to debug since you didn't paste the text into a code box and the underlines no longer align to where SAS is detecting the error.&amp;nbsp; It looks perhaps like you missed a semi-colon and so have commented out&amp;nbsp; the PROC statement so the other statements are no longer valid.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 14:02:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755368#M238371</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-20T14:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755369#M238372</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will not fix the problems&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is a good thing to use when running macros because more helpful information is written to the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data
contains characters that are not representable in the new encoding or truncation
occurred during transcoding.&lt;/PRE&gt;
&lt;P&gt;Please DO NOT show us partial logs, disconnected from the code. Please show us the entire log for this PROC or DATA step so we can see the code as it appears in the LOG, plus all NOTEs, WARNINGs and ERRORs, exactly as they appear in the log.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 14:05:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755369#M238372</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-20T14:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755493#M238415</link>
      <description>&lt;P&gt;This warning only concerns character variables, and it is very clear:&lt;/P&gt;
&lt;P&gt;You try to read data that contains characters that do not exist in your encoding mode. Most likely attempting to read UFT8 data in a wlatin session (you can run proc contents to check the data set's encoding). The only way to fix this is that your SAS session must use a different encoding. This is an option set at start-up, so if you use EG or similar, the SAS administrator is the person that can make that change.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 22:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755493#M238415</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-20T22:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755509#M238425</link>
      <description>&lt;P&gt;Thank you PaigeMiller. I have used&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;options mprint;&lt;/LI-CODE&gt;&lt;P&gt;and upload the whole log now. The log is before I comment out the two lines.&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M4)
      Licensed to KYOTO UNIVERSITY -SCSK, Site 10209371.
NOTE: This session is executing on the X64_10HOME  platform.



NOTE: Updated analytical products:

      SAS/STAT 14.2
      SAS/ETS 14.2
      SAS/OR 14.2
      SAS/IML 14.2
      SAS/QC 14.2

NOTE: Additional host information:

 X64_10HOME WIN 10.0.19041  Workstation

NOTE: SAS initialization used:
      real time           1.61 seconds
      cpu time            1.13 seconds

1    libname data "C:\Research 2\datacheck\datacheck1";
NOTE: Libref DATA was successfully assigned as follows:
      Engine:        V9
      Physical Name: C:\Research 2\datacheck\datacheck1
2    options mprint;
3    %INCLUDE 'ADJSURV.sas';
711   %_ADJSURV (data=data.cox
712   , time=time
713   , event=event
714   , group=group
715   , x=sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5
715 ! comorbidities6 concurrent1 concurrent2 concurrent previous after
716   , model=1
717   , out=data.coxout);
NOTE: Line generated by the invoked macro "_ADJSURV".
1       %_require(&amp;amp;data &amp;amp;time &amp;amp;event &amp;amp;group &amp;amp;out &amp;amp;x)
        -
        180
WARNING: Apparent invocation of macro _REQUIRE not resolved.
WARNING: Apparent invocation of macro _LIST not resolved.
MPRINT(_ADJSURV):   %_require(data.cox time event group data.coxout sex1 age1 comorbidities1
comorbidities2 comorbidities3 comorbidities4 comorbidities5 comorbidities6 concurrent1
concurrent2 concurrent previous after) proc means data=data.cox noprint;

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "_ADJSURV".
3       proc means data=&amp;amp;inputdata noprint;     var &amp;amp;group;     output out=maxout
                                                ---
                                                180
3   ! max(&amp;amp;group)=numgroup; run;  data _null_;     set maxout;     call symput('numgroup',
3   ! numgroup);  run;  proc iml;     use &amp;amp;inputdata;     read all var {&amp;amp;covlist} into x;
3   ! close
ERROR 180-322: Statement is not valid or it is used out of proper order.

MPRINT(_ADJSURV):   var group;

NOTE: Line generated by the invoked macro "_ADJSURV".
3       proc means data=&amp;amp;inputdata noprint;     var &amp;amp;group;     output out=maxout
                                                                ------
                                                                180
3   ! max(&amp;amp;group)=numgroup; run;  data _null_;     set maxout;     call symput('numgroup',
3   ! numgroup);  run;  proc iml;     use &amp;amp;inputdata;     read all var {&amp;amp;covlist} into x;
3   ! close
ERROR 180-322: Statement is not valid or it is used out of proper order.

MPRINT(_ADJSURV):   output out=maxout max(group)=numgroup;

MPRINT(_ADJSURV):   run;
MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set maxout;
ERROR: File WORK.MAXOUT.DATA does not exist.
MPRINT(_ADJSURV):   call symput('numgroup', numgroup);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      1082:162
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: Writing HTML Body file: sashtml.htm
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
NOTE: Line generated by the macro variable "COVLIST".
1     %_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5
      -
      22
      200
1   ! comorbidities6 concurrent1 concurrent2 concurrent previous after)
WARNING: Apparent invocation of macro _LIST not resolved.
MPRINT(_ADJSURV):   read all var {%_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after)}
into x;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
              a numeric constant, a datetime constant, a missing value, (, (|, ), *, ',', -, =,
              [, |, }.

ERROR 200-322: The symbol is not recognized and will be ignored.

MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   numcov=ncol(x);
MPRINT(_ADJSURV):   create ncovout from numcov[colname='numcov'];
MPRINT(_ADJSURV):   append from numcov;
MPRINT(_ADJSURV):   close ncovout;
NOTE: The data set WORK.NCOVOUT has 1 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.60 seconds
      cpu time            0.32 seconds


MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set ncovout;
MPRINT(_ADJSURV):   call symput('numcov', numcov);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      4:197
NOTE: There were 1 observations read from the data set WORK.NCOVOUT.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   read all var {time} into time;
WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data
         contains characters that are not representable in the new encoding or truncation
         occurred during transcoding.
MPRINT(_ADJSURV):   read all var {event} into event;
MPRINT(_ADJSURV):   read all var {group} into group;
NOTE: Line generated by the macro variable "COVLIST".
1     %_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5
      -
      22
      200
1   ! comorbidities6 concurrent1 concurrent2 concurrent previous after)
WARNING: Apparent invocation of macro _LIST not resolved.
MPRINT(_ADJSURV):   read all var {%_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after)}
into x;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
              a numeric constant, a datetime constant, a missing value, (, (|, ), *, ',', -, =,
              [, |, }.

ERROR 200-322: The symbol is not recognized and will be ignored.

MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   out=time||event||group||x;
MPRINT(_ADJSURV):   names={'time' 'event' 'strata'};
MPRINT(_ADJSURV):   create indata from out[colname=names];
MPRINT(_ADJSURV):   append from out;
MPRINT(_ADJSURV):   close indata;
NOTE: The data set WORK.INDATA has 979 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.13 seconds
      cpu time            0.07 seconds


MPRINT(_ADJSURV):   proc sort data=indata;
MPRINT(_ADJSURV):   by descending time descending event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.INDATA has 979 observations and 3 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   data alltime;
MPRINT(_ADJSURV):   set indata (keep=time event);
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   drop event;
MPRINT(_ADJSURV):   if first.time;
MPRINT(_ADJSURV):   if event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc sort data=alltime;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   proc phreg data=indata covout outest=best noprint;
MPRINT(_ADJSURV):   model time*event(0)=;
MPRINT(_ADJSURV):   strata strata;
MPRINT(_ADJSURV):   output out=coxout xbeta=zb;
MPRINT(_ADJSURV):   run;

NOTE: There are no explanatory variables in the MODEL statement.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The data set WORK.BEST has 1 observations and 5 variables.
NOTE: The data set WORK.COXOUT has 979 observations and 4 variables.
NOTE: PROCEDURE PHREG used (Total process time):
      real time           0.11 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc sort data=coxout;
MPRINT(_ADJSURV):   by strata descending time;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.COXOUT.
NOTE: The data set WORK.COXOUT has 979 observations and 4 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   data best sigma;
MPRINT(_ADJSURV):   set best;
MPRINT(_ADJSURV):   if _type_='PARMS' then output best;
MPRINT(_ADJSURV):   else if _type_='COV' then output sigma;
MPRINT(_ADJSURV):   run;

NOTE: There were 1 observations read from the data set WORK.BEST.
NOTE: The data set WORK.BEST has 1 observations and 5 variables.
NOTE: The data set WORK.SIGMA has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The %TO value of the %DO GROUP loop is invalid.
ERROR: The macro _ADJSURV will stop executing.
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the log after I comment out the 2 lines:&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M4)
      Licensed to KYOTO UNIVERSITY -SCSK, Site 10209371.
NOTE: This session is executing on the X64_10HOME  platform.



NOTE: Updated analytical products:

      SAS/STAT 14.2
      SAS/ETS 14.2
      SAS/OR 14.2
      SAS/IML 14.2
      SAS/QC 14.2

NOTE: Additional host information:

 X64_10HOME WIN 10.0.19041  Workstation

NOTE: SAS initialization used:
      real time           1.49 seconds
      cpu time            0.90 seconds

1    libname data "C:\Research 2\datacheck\datacheck1";
NOTE: Libref DATA was successfully assigned as follows:
      Engine:        V9
      Physical Name: C:\Research 2\datacheck\datacheck1
2    options mprint;
3    %INCLUDE 'ADJSURV.sas';
711   %_ADJSURV (data=data.cox
712   , time=time
713   , event=event
714   , group=group
715   , x=sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5
715 ! comorbidities6 concurrent1 concurrent2 concurrent previous after
716   , model=1
717   , out=data.coxout);
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   proc means data=data.cox noprint;
MPRINT(_ADJSURV):   var group;
MPRINT(_ADJSURV):   output out=maxout max(group)=numgroup;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set DATA.COX.
NOTE: The data set WORK.MAXOUT has 1 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set maxout;
MPRINT(_ADJSURV):   call symput('numgroup', numgroup);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      1072:162
NOTE: There were 1 observations read from the data set WORK.MAXOUT.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: Writing HTML Body file: sashtml.htm
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   read all var {sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after}
into x;
WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data
         contains characters that are not representable in the new encoding or truncation
         occurred during transcoding.
MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   numcov=ncol(x);
MPRINT(_ADJSURV):   create ncovout from numcov[colname='numcov'];
MPRINT(_ADJSURV):   append from numcov;
MPRINT(_ADJSURV):   close ncovout;
NOTE: The data set WORK.NCOVOUT has 1 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.57 seconds
      cpu time            0.34 seconds


MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set ncovout;
MPRINT(_ADJSURV):   call symput('numcov', numcov);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      2:197
NOTE: There were 1 observations read from the data set WORK.NCOVOUT.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   read all var {time} into time;
WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data
         contains characters that are not representable in the new encoding or truncation
         occurred during transcoding.
MPRINT(_ADJSURV):   read all var {event} into event;
MPRINT(_ADJSURV):   read all var {group} into group;
MPRINT(_ADJSURV):   read all var {sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after}
into x;
MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   out=time||event||group||x;
MPRINT(_ADJSURV):   names={'time' 'event' 'strata' "z1" "z2" "z3" "z4" "z5" "z6" "z7" "z8" "z9"
"z10" "z11" "z12" "z13"};
MPRINT(_ADJSURV):   create indata from out[colname=names];
MPRINT(_ADJSURV):   append from out;
MPRINT(_ADJSURV):   close indata;
NOTE: The data set WORK.INDATA has 979 observations and 16 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.08 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   proc sort data=indata;
MPRINT(_ADJSURV):   by descending time descending event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.INDATA has 979 observations and 16 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   data alltime;
MPRINT(_ADJSURV):   set indata (keep=time event);
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   drop event;
MPRINT(_ADJSURV):   if first.time;
MPRINT(_ADJSURV):   if event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=alltime;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   proc phreg data=indata covout outest=best noprint;
MPRINT(_ADJSURV):   model time*event(0)= z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13;
MPRINT(_ADJSURV):   strata strata;
MPRINT(_ADJSURV):   output out=coxout xbeta=zb;
MPRINT(_ADJSURV):   run;

NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The data set WORK.BEST has 14 observations and 18 variables.
NOTE: The data set WORK.COXOUT has 979 observations and 17 variables.
NOTE: PROCEDURE PHREG used (Total process time):
      real time           0.12 seconds
      cpu time            0.06 seconds


MPRINT(_ADJSURV):   proc sort data=coxout;
MPRINT(_ADJSURV):   by strata descending time;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.COXOUT.
NOTE: The data set WORK.COXOUT has 979 observations and 17 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   data best sigma;
MPRINT(_ADJSURV):   set best;
MPRINT(_ADJSURV):   if _type_='PARMS' then output best;
MPRINT(_ADJSURV):   else if _type_='COV' then output sigma;
MPRINT(_ADJSURV):   run;

NOTE: There were 14 observations read from the data set WORK.BEST.
NOTE: The data set WORK.BEST has 1 observations and 18 variables.
NOTE: The data set WORK.SIGMA has 13 observations and 18 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   data riskset1;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=1;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 98 observations read from the data set WORK.COXOUT.
      WHERE strata=1;
NOTE: The data set WORK.RISKSET1 has 35 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=riskset1;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 35 observations read from the data set WORK.RISKSET1.
NOTE: The data set WORK.RISKSET1 has 35 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=1 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount1;
MPRINT(_ADJSURV):   run;

NOTE: There were 41 observations read from the data set WORK.INDATA.
      WHERE (strata=1) and (event=1);
NOTE: The data set WORK.DCOUNT1 has 34 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.08 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset1;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset1 dcount1 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 35 observations read from the data set WORK.RISKSET1.
NOTE: There were 34 observations read from the data set WORK.DCOUNT1.
NOTE: The data set WORK.RISKSET1 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv1 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv1;
NOTE: The data set WORK.SURV1 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.57 seconds
      cpu time            0.54 seconds


MPRINT(_ADJSURV):   data riskset2;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=2;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 148 observations read from the data set WORK.COXOUT.
      WHERE strata=2;
NOTE: The data set WORK.RISKSET2 has 29 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=riskset2;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 29 observations read from the data set WORK.RISKSET2.
NOTE: The data set WORK.RISKSET2 has 29 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=2 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount2;
MPRINT(_ADJSURV):   run;

NOTE: There were 37 observations read from the data set WORK.INDATA.
      WHERE (strata=2) and (event=1);
NOTE: The data set WORK.DCOUNT2 has 28 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.05 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset2;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset2 dcount2 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 29 observations read from the data set WORK.RISKSET2.
NOTE: There were 28 observations read from the data set WORK.DCOUNT2.
NOTE: The data set WORK.RISKSET2 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv2 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv2;
NOTE: The data set WORK.SURV2 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.60 seconds
      cpu time            0.59 seconds


MPRINT(_ADJSURV):   data riskset3;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=3;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 86 observations read from the data set WORK.COXOUT.
      WHERE strata=3;
NOTE: The data set WORK.RISKSET3 has 34 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=riskset3;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 34 observations read from the data set WORK.RISKSET3.
NOTE: The data set WORK.RISKSET3 has 34 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=3 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount3;
MPRINT(_ADJSURV):   run;

NOTE: There were 38 observations read from the data set WORK.INDATA.
      WHERE (strata=3) and (event=1);
NOTE: The data set WORK.DCOUNT3 has 33 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.05 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset3;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset3 dcount3 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 34 observations read from the data set WORK.RISKSET3.
NOTE: There were 33 observations read from the data set WORK.DCOUNT3.
NOTE: The data set WORK.RISKSET3 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv3 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv3;
NOTE: The data set WORK.SURV3 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.61 seconds
      cpu time            0.59 seconds


MPRINT(_ADJSURV):   data riskset4;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=4;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 647 observations read from the data set WORK.COXOUT.
      WHERE strata=4;
NOTE: The data set WORK.RISKSET4 has 128 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=riskset4;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 128 observations read from the data set WORK.RISKSET4.
NOTE: The data set WORK.RISKSET4 has 128 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=4 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount4;
MPRINT(_ADJSURV):   run;

NOTE: There were 258 observations read from the data set WORK.INDATA.
      WHERE (strata=4) and (event=1);
NOTE: The data set WORK.DCOUNT4 has 127 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.07 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset4;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset4 dcount4 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 128 observations read from the data set WORK.RISKSET4.
NOTE: There were 127 observations read from the data set WORK.DCOUNT4.
NOTE: The data set WORK.RISKSET4 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv4 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv4;
NOTE: The data set WORK.SURV4 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.58 seconds
      cpu time            0.50 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov12 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov12;
NOTE: The data set WORK.COV12 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.08 seconds
      cpu time            1.07 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov13 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov13;
NOTE: The data set WORK.COV13 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.08 seconds
      cpu time            1.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov14 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov14;
NOTE: The data set WORK.COV14 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.24 seconds
      cpu time            1.20 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov23 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov23;
NOTE: The data set WORK.COV23 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.16 seconds
      cpu time            1.07 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov24 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov24;
NOTE: The data set WORK.COV24 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.15 seconds
      cpu time            1.14 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov34 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov34;
NOTE: The data set WORK.COV34 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.09 seconds
      cpu time            1.04 seconds


MPRINT(_ADJSURV):   data mout;
MPRINT(_ADJSURV):   merge surv1 (rename=(surv=surv1 se=se1)) surv2 (rename=(surv=surv2 se=se2))
surv3 (rename=(surv=surv3 se=se3)) surv4 (rename=(surv=surv4 se=se4)) cov12 (rename=(se=se12))
cov13 (rename=(se=se13)) cov14 (rename=(se=se14)) cov23 (rename=(se=se23)) cov24
(rename=(se=se24)) cov34 (rename=(se=se34));
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.SURV1.
NOTE: There were 166 observations read from the data set WORK.SURV2.
NOTE: There were 166 observations read from the data set WORK.SURV3.
NOTE: There were 166 observations read from the data set WORK.SURV4.
NOTE: There were 166 observations read from the data set WORK.COV12.
NOTE: There were 166 observations read from the data set WORK.COV13.
NOTE: There were 166 observations read from the data set WORK.COV14.
NOTE: There were 166 observations read from the data set WORK.COV23.
NOTE: There were 166 observations read from the data set WORK.COV24.
NOTE: There were 166 observations read from the data set WORK.COV34.
NOTE: The data set WORK.MOUT has 166 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   data data.coxout;
MPRINT(_ADJSURV):   time=0;
MPRINT(_ADJSURV):   surv1=1;
MPRINT(_ADJSURV):   se1=0;
MPRINT(_ADJSURV):   se12=0;
MPRINT(_ADJSURV):   se13=0;
MPRINT(_ADJSURV):   se14=0;
MPRINT(_ADJSURV):   surv2=1;
MPRINT(_ADJSURV):   se2=0;
MPRINT(_ADJSURV):   se23=0;
MPRINT(_ADJSURV):   se24=0;
MPRINT(_ADJSURV):   surv3=1;
MPRINT(_ADJSURV):   se3=0;
MPRINT(_ADJSURV):   se34=0;
MPRINT(_ADJSURV):   surv4=1;
MPRINT(_ADJSURV):   se4=0;
MPRINT(_ADJSURV):   output;
MPRINT(_ADJSURV):   run;

NOTE: Data file DATA.COXOUT.DATA is in a format that is native to another host, or the file
      encoding does not match the session encoding. Cross Environment Data Access will be used,
      which might require additional CPU resources and might reduce performance.
NOTE: The data set DATA.COXOUT has 1 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   data data.coxout;
MPRINT(_ADJSURV):   set data.coxout mout;
NOTE: Data file DATA.COXOUT.DATA is in a format that is native to another host, or the file
      encoding does not match the session encoding. Cross Environment Data Access will be used,
      which might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: Data file DATA.COXOUT.DATA is in a format that is native to another host, or the file
      encoding does not match the session encoding. Cross Environment Data Access will be used,
      which might require additional CPU resources and might reduce performance.
NOTE: There were 1 observations read from the data set DATA.COXOUT.
NOTE: There were 166 observations read from the data set WORK.MOUT.
NOTE: The data set DATA.COXOUT has 167 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds


&lt;/LI-CODE&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 00:03:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755509#M238425</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-21T00:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755510#M238426</link>
      <description>&lt;P&gt;Thank you Tom. I have used&amp;nbsp;&lt;SPAN&gt;MPRINT option&lt;/SPAN&gt; and upload the whole log now. The log is before I comment out the two warning lines.&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M4)
      Licensed to KYOTO UNIVERSITY -SCSK, Site 10209371.
NOTE: This session is executing on the X64_10HOME  platform.



NOTE: Updated analytical products:

      SAS/STAT 14.2
      SAS/ETS 14.2
      SAS/OR 14.2
      SAS/IML 14.2
      SAS/QC 14.2

NOTE: Additional host information:

 X64_10HOME WIN 10.0.19041  Workstation

NOTE: SAS initialization used:
      real time           1.42 seconds
      cpu time            1.01 seconds

1    libname data "C:\Research 2\datacheck\datacheck1";
NOTE: Libref DATA was successfully assigned as follows:
      Engine:        V9
      Physical Name: C:\Research 2\datacheck\datacheck1
2    options mprint;
3    %INCLUDE 'ADJSURV.sas';
711   %_ADJSURV (data=data.cox
712   , time=time
713   , event=event
714   , group=group
715   , x=sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5
715 ! comorbidities6 concurrent1 concurrent2 concurrent previous after
716   , model=1
717   , out=data.coxout);
NOTE: Line generated by the invoked macro "_ADJSURV".
1       %_require(&amp;amp;data &amp;amp;time &amp;amp;event &amp;amp;group &amp;amp;out &amp;amp;x)
        -
        180
WARNING: Apparent invocation of macro _REQUIRE not resolved.
WARNING: Apparent invocation of macro _LIST not resolved.
MPRINT(_ADJSURV):   %_require(data.cox time event group data.coxout sex1 age1 comorbidities1
comorbidities2 comorbidities3 comorbidities4 comorbidities5 comorbidities6 concurrent1
concurrent2 concurrent previous after) proc means data=data.cox noprint;

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "_ADJSURV".
3       proc means data=&amp;amp;inputdata noprint;     var &amp;amp;group;     output out=maxout
                                                ---
                                                180
3   ! max(&amp;amp;group)=numgroup; run;  data _null_;     set maxout;     call symput('numgroup',
3   ! numgroup);  run;  proc iml;     use &amp;amp;inputdata;     read all var {&amp;amp;covlist} into x;
3   ! close
ERROR 180-322: Statement is not valid or it is used out of proper order.

MPRINT(_ADJSURV):   var group;

NOTE: Line generated by the invoked macro "_ADJSURV".
3       proc means data=&amp;amp;inputdata noprint;     var &amp;amp;group;     output out=maxout
                                                                ------
                                                                180
3   ! max(&amp;amp;group)=numgroup; run;  data _null_;     set maxout;     call symput('numgroup',
3   ! numgroup);  run;  proc iml;     use &amp;amp;inputdata;     read all var {&amp;amp;covlist} into x;
3   ! close
ERROR 180-322: Statement is not valid or it is used out of proper order.

MPRINT(_ADJSURV):   output out=maxout max(group)=numgroup;

MPRINT(_ADJSURV):   run;
MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set maxout;
ERROR: File WORK.MAXOUT.DATA does not exist.
MPRINT(_ADJSURV):   call symput('numgroup', numgroup);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      1082:162
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: Writing HTML Body file: sashtml.htm
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
NOTE: Line generated by the macro variable "COVLIST".
1     %_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5
      -
      22
      200
1   ! comorbidities6 concurrent1 concurrent2 concurrent previous after)
WARNING: Apparent invocation of macro _LIST not resolved.
MPRINT(_ADJSURV):   read all var {%_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after)}
into x;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
              a numeric constant, a datetime constant, a missing value, (, (|, ), *, ',', -, =,
              [, |, }.

ERROR 200-322: The symbol is not recognized and will be ignored.

MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   numcov=ncol(x);
MPRINT(_ADJSURV):   create ncovout from numcov[colname='numcov'];
MPRINT(_ADJSURV):   append from numcov;
MPRINT(_ADJSURV):   close ncovout;
NOTE: The data set WORK.NCOVOUT has 1 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.59 seconds
      cpu time            0.29 seconds


MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set ncovout;
MPRINT(_ADJSURV):   call symput('numcov', numcov);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      4:197
NOTE: There were 1 observations read from the data set WORK.NCOVOUT.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   read all var {time} into time;
WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data
         contains characters that are not representable in the new encoding or truncation
         occurred during transcoding.
MPRINT(_ADJSURV):   read all var {event} into event;
MPRINT(_ADJSURV):   read all var {group} into group;
NOTE: Line generated by the macro variable "COVLIST".
1     %_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5
      -
      22
      200
1   ! comorbidities6 concurrent1 concurrent2 concurrent previous after)
WARNING: Apparent invocation of macro _LIST not resolved.
MPRINT(_ADJSURV):   read all var {%_list(sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after)}
into x;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
              a numeric constant, a datetime constant, a missing value, (, (|, ), *, ',', -, =,
              [, |, }.

ERROR 200-322: The symbol is not recognized and will be ignored.

MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   out=time||event||group||x;
MPRINT(_ADJSURV):   names={'time' 'event' 'strata'};
MPRINT(_ADJSURV):   create indata from out[colname=names];
MPRINT(_ADJSURV):   append from out;
MPRINT(_ADJSURV):   close indata;
NOTE: The data set WORK.INDATA has 979 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.08 seconds
      cpu time            0.06 seconds


MPRINT(_ADJSURV):   proc sort data=indata;
MPRINT(_ADJSURV):   by descending time descending event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.INDATA has 979 observations and 3 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   data alltime;
MPRINT(_ADJSURV):   set indata (keep=time event);
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   drop event;
MPRINT(_ADJSURV):   if first.time;
MPRINT(_ADJSURV):   if event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=alltime;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   proc phreg data=indata covout outest=best noprint;
MPRINT(_ADJSURV):   model time*event(0)=;
MPRINT(_ADJSURV):   strata strata;
MPRINT(_ADJSURV):   output out=coxout xbeta=zb;
MPRINT(_ADJSURV):   run;

NOTE: There are no explanatory variables in the MODEL statement.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The data set WORK.BEST has 1 observations and 5 variables.
NOTE: The data set WORK.COXOUT has 979 observations and 4 variables.
NOTE: PROCEDURE PHREG used (Total process time):
      real time           0.12 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   proc sort data=coxout;
MPRINT(_ADJSURV):   by strata descending time;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.COXOUT.
NOTE: The data set WORK.COXOUT has 979 observations and 4 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   data best sigma;
MPRINT(_ADJSURV):   set best;
MPRINT(_ADJSURV):   if _type_='PARMS' then output best;
MPRINT(_ADJSURV):   else if _type_='COV' then output sigma;
MPRINT(_ADJSURV):   run;

NOTE: There were 1 observations read from the data set WORK.BEST.
NOTE: The data set WORK.BEST has 1 observations and 5 variables.
NOTE: The data set WORK.SIGMA has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The %TO value of the %DO GROUP loop is invalid.
ERROR: The macro _ADJSURV will stop executing.
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this log is after I comment out the two warning lines.&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M4)
      Licensed to KYOTO UNIVERSITY -SCSK, Site 10209371.
NOTE: This session is executing on the X64_10HOME  platform.



NOTE: Updated analytical products:

      SAS/STAT 14.2
      SAS/ETS 14.2
      SAS/OR 14.2
      SAS/IML 14.2
      SAS/QC 14.2

NOTE: Additional host information:

 X64_10HOME WIN 10.0.19041  Workstation

NOTE: SAS initialization used:
      real time           1.49 seconds
      cpu time            0.90 seconds

1    libname data "C:\Research 2\datacheck\datacheck1";
NOTE: Libref DATA was successfully assigned as follows:
      Engine:        V9
      Physical Name: C:\Research 2\datacheck\datacheck1
2    options mprint;
3    %INCLUDE 'ADJSURV.sas';
711   %_ADJSURV (data=data.cox
712   , time=time
713   , event=event
714   , group=group
715   , x=sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5
715 ! comorbidities6 concurrent1 concurrent2 concurrent previous after
716   , model=1
717   , out=data.coxout);
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   proc means data=data.cox noprint;
MPRINT(_ADJSURV):   var group;
MPRINT(_ADJSURV):   output out=maxout max(group)=numgroup;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set DATA.COX.
NOTE: The data set WORK.MAXOUT has 1 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set maxout;
MPRINT(_ADJSURV):   call symput('numgroup', numgroup);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      1072:162
NOTE: There were 1 observations read from the data set WORK.MAXOUT.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: Writing HTML Body file: sashtml.htm
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   read all var {sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after}
into x;
WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data
         contains characters that are not representable in the new encoding or truncation
         occurred during transcoding.
MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   numcov=ncol(x);
MPRINT(_ADJSURV):   create ncovout from numcov[colname='numcov'];
MPRINT(_ADJSURV):   append from numcov;
MPRINT(_ADJSURV):   close ncovout;
NOTE: The data set WORK.NCOVOUT has 1 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.57 seconds
      cpu time            0.34 seconds


MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set ncovout;
MPRINT(_ADJSURV):   call symput('numcov', numcov);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      2:197
NOTE: There were 1 observations read from the data set WORK.NCOVOUT.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   read all var {time} into time;
WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data
         contains characters that are not representable in the new encoding or truncation
         occurred during transcoding.
MPRINT(_ADJSURV):   read all var {event} into event;
MPRINT(_ADJSURV):   read all var {group} into group;
MPRINT(_ADJSURV):   read all var {sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after}
into x;
MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   out=time||event||group||x;
MPRINT(_ADJSURV):   names={'time' 'event' 'strata' "z1" "z2" "z3" "z4" "z5" "z6" "z7" "z8" "z9"
"z10" "z11" "z12" "z13"};
MPRINT(_ADJSURV):   create indata from out[colname=names];
MPRINT(_ADJSURV):   append from out;
MPRINT(_ADJSURV):   close indata;
NOTE: The data set WORK.INDATA has 979 observations and 16 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.08 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   proc sort data=indata;
MPRINT(_ADJSURV):   by descending time descending event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.INDATA has 979 observations and 16 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   data alltime;
MPRINT(_ADJSURV):   set indata (keep=time event);
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   drop event;
MPRINT(_ADJSURV):   if first.time;
MPRINT(_ADJSURV):   if event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=alltime;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   proc phreg data=indata covout outest=best noprint;
MPRINT(_ADJSURV):   model time*event(0)= z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13;
MPRINT(_ADJSURV):   strata strata;
MPRINT(_ADJSURV):   output out=coxout xbeta=zb;
MPRINT(_ADJSURV):   run;

NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The data set WORK.BEST has 14 observations and 18 variables.
NOTE: The data set WORK.COXOUT has 979 observations and 17 variables.
NOTE: PROCEDURE PHREG used (Total process time):
      real time           0.12 seconds
      cpu time            0.06 seconds


MPRINT(_ADJSURV):   proc sort data=coxout;
MPRINT(_ADJSURV):   by strata descending time;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.COXOUT.
NOTE: The data set WORK.COXOUT has 979 observations and 17 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   data best sigma;
MPRINT(_ADJSURV):   set best;
MPRINT(_ADJSURV):   if _type_='PARMS' then output best;
MPRINT(_ADJSURV):   else if _type_='COV' then output sigma;
MPRINT(_ADJSURV):   run;

NOTE: There were 14 observations read from the data set WORK.BEST.
NOTE: The data set WORK.BEST has 1 observations and 18 variables.
NOTE: The data set WORK.SIGMA has 13 observations and 18 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   data riskset1;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=1;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 98 observations read from the data set WORK.COXOUT.
      WHERE strata=1;
NOTE: The data set WORK.RISKSET1 has 35 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=riskset1;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 35 observations read from the data set WORK.RISKSET1.
NOTE: The data set WORK.RISKSET1 has 35 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=1 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount1;
MPRINT(_ADJSURV):   run;

NOTE: There were 41 observations read from the data set WORK.INDATA.
      WHERE (strata=1) and (event=1);
NOTE: The data set WORK.DCOUNT1 has 34 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.08 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset1;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset1 dcount1 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 35 observations read from the data set WORK.RISKSET1.
NOTE: There were 34 observations read from the data set WORK.DCOUNT1.
NOTE: The data set WORK.RISKSET1 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv1 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv1;
NOTE: The data set WORK.SURV1 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.57 seconds
      cpu time            0.54 seconds


MPRINT(_ADJSURV):   data riskset2;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=2;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 148 observations read from the data set WORK.COXOUT.
      WHERE strata=2;
NOTE: The data set WORK.RISKSET2 has 29 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=riskset2;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 29 observations read from the data set WORK.RISKSET2.
NOTE: The data set WORK.RISKSET2 has 29 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=2 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount2;
MPRINT(_ADJSURV):   run;

NOTE: There were 37 observations read from the data set WORK.INDATA.
      WHERE (strata=2) and (event=1);
NOTE: The data set WORK.DCOUNT2 has 28 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.05 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset2;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset2 dcount2 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 29 observations read from the data set WORK.RISKSET2.
NOTE: There were 28 observations read from the data set WORK.DCOUNT2.
NOTE: The data set WORK.RISKSET2 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv2 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv2;
NOTE: The data set WORK.SURV2 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.60 seconds
      cpu time            0.59 seconds


MPRINT(_ADJSURV):   data riskset3;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=3;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 86 observations read from the data set WORK.COXOUT.
      WHERE strata=3;
NOTE: The data set WORK.RISKSET3 has 34 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=riskset3;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 34 observations read from the data set WORK.RISKSET3.
NOTE: The data set WORK.RISKSET3 has 34 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=3 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount3;
MPRINT(_ADJSURV):   run;

NOTE: There were 38 observations read from the data set WORK.INDATA.
      WHERE (strata=3) and (event=1);
NOTE: The data set WORK.DCOUNT3 has 33 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.05 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset3;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset3 dcount3 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 34 observations read from the data set WORK.RISKSET3.
NOTE: There were 33 observations read from the data set WORK.DCOUNT3.
NOTE: The data set WORK.RISKSET3 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv3 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv3;
NOTE: The data set WORK.SURV3 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.61 seconds
      cpu time            0.59 seconds


MPRINT(_ADJSURV):   data riskset4;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=4;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 647 observations read from the data set WORK.COXOUT.
      WHERE strata=4;
NOTE: The data set WORK.RISKSET4 has 128 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=riskset4;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 128 observations read from the data set WORK.RISKSET4.
NOTE: The data set WORK.RISKSET4 has 128 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=4 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount4;
MPRINT(_ADJSURV):   run;

NOTE: There were 258 observations read from the data set WORK.INDATA.
      WHERE (strata=4) and (event=1);
NOTE: The data set WORK.DCOUNT4 has 127 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.07 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset4;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset4 dcount4 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 128 observations read from the data set WORK.RISKSET4.
NOTE: There were 127 observations read from the data set WORK.DCOUNT4.
NOTE: The data set WORK.RISKSET4 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv4 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv4;
NOTE: The data set WORK.SURV4 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.58 seconds
      cpu time            0.50 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov12 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov12;
NOTE: The data set WORK.COV12 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.08 seconds
      cpu time            1.07 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov13 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov13;
NOTE: The data set WORK.COV13 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.08 seconds
      cpu time            1.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov14 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov14;
NOTE: The data set WORK.COV14 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.24 seconds
      cpu time            1.20 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov23 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov23;
NOTE: The data set WORK.COV23 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.16 seconds
      cpu time            1.07 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov24 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov24;
NOTE: The data set WORK.COV24 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.15 seconds
      cpu time            1.14 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov34 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov34;
NOTE: The data set WORK.COV34 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.09 seconds
      cpu time            1.04 seconds


MPRINT(_ADJSURV):   data mout;
MPRINT(_ADJSURV):   merge surv1 (rename=(surv=surv1 se=se1)) surv2 (rename=(surv=surv2 se=se2))
surv3 (rename=(surv=surv3 se=se3)) surv4 (rename=(surv=surv4 se=se4)) cov12 (rename=(se=se12))
cov13 (rename=(se=se13)) cov14 (rename=(se=se14)) cov23 (rename=(se=se23)) cov24
(rename=(se=se24)) cov34 (rename=(se=se34));
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.SURV1.
NOTE: There were 166 observations read from the data set WORK.SURV2.
NOTE: There were 166 observations read from the data set WORK.SURV3.
NOTE: There were 166 observations read from the data set WORK.SURV4.
NOTE: There were 166 observations read from the data set WORK.COV12.
NOTE: There were 166 observations read from the data set WORK.COV13.
NOTE: There were 166 observations read from the data set WORK.COV14.
NOTE: There were 166 observations read from the data set WORK.COV23.
NOTE: There were 166 observations read from the data set WORK.COV24.
NOTE: There were 166 observations read from the data set WORK.COV34.
NOTE: The data set WORK.MOUT has 166 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   data data.coxout;
MPRINT(_ADJSURV):   time=0;
MPRINT(_ADJSURV):   surv1=1;
MPRINT(_ADJSURV):   se1=0;
MPRINT(_ADJSURV):   se12=0;
MPRINT(_ADJSURV):   se13=0;
MPRINT(_ADJSURV):   se14=0;
MPRINT(_ADJSURV):   surv2=1;
MPRINT(_ADJSURV):   se2=0;
MPRINT(_ADJSURV):   se23=0;
MPRINT(_ADJSURV):   se24=0;
MPRINT(_ADJSURV):   surv3=1;
MPRINT(_ADJSURV):   se3=0;
MPRINT(_ADJSURV):   se34=0;
MPRINT(_ADJSURV):   surv4=1;
MPRINT(_ADJSURV):   se4=0;
MPRINT(_ADJSURV):   output;
MPRINT(_ADJSURV):   run;

NOTE: Data file DATA.COXOUT.DATA is in a format that is native to another host, or the file
      encoding does not match the session encoding. Cross Environment Data Access will be used,
      which might require additional CPU resources and might reduce performance.
NOTE: The data set DATA.COXOUT has 1 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   data data.coxout;
MPRINT(_ADJSURV):   set data.coxout mout;
NOTE: Data file DATA.COXOUT.DATA is in a format that is native to another host, or the file
      encoding does not match the session encoding. Cross Environment Data Access will be used,
      which might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: Data file DATA.COXOUT.DATA is in a format that is native to another host, or the file
      encoding does not match the session encoding. Cross Environment Data Access will be used,
      which might require additional CPU resources and might reduce performance.
NOTE: There were 1 observations read from the data set DATA.COXOUT.
NOTE: There were 166 observations read from the data set WORK.MOUT.
NOTE: The data set DATA.COXOUT has 167 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds


&lt;/LI-CODE&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 00:14:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755510#M238426</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-21T00:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Some programing problem about SAS macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755517#M238463</link>
      <description>&lt;P&gt;1.Your log has warnings and error messages. Please pay attention to them.&lt;/P&gt;
&lt;P&gt;2.Run the code in parts, step by step and then convert it to macro.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 00:46:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755517#M238463</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-07-21T00:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Some programming questions about SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755521#M238435</link>
      <description>&lt;P&gt;Thank you Kawakami. I have tried commenting out the 2 lines as you suggested. The warnings and errors did disappear and come a result. However, the result is not as the paper showed. The log is like this:&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M4)
      Licensed to KYOTO UNIVERSITY -SCSK, Site 10209371.
NOTE: This session is executing on the X64_10HOME  platform.



NOTE: Updated analytical products:

      SAS/STAT 14.2
      SAS/ETS 14.2
      SAS/OR 14.2
      SAS/IML 14.2
      SAS/QC 14.2

NOTE: Additional host information:

 X64_10HOME WIN 10.0.19041  Workstation

NOTE: SAS initialization used:
      real time           1.42 seconds
      cpu time            1.04 seconds

1    libname data "C:\Research 2\datacheck\datacheck1";
NOTE: Libref DATA was successfully assigned as follows:
      Engine:        V9
      Physical Name: C:\Research 2\datacheck\datacheck1
2    options mprint;
3    %INCLUDE 'ADJSURV.sas';
711   %_ADJSURV (data=data.cox
712   , time=time
713   , event=event
714   , group=group
715   , x=sex1 age1 comorbidities1 comorbidities2 comorbidities3 comorbidities4 comorbidities5
715 ! comorbidities6 concurrent1 concurrent2 concurrent previous after
716   , model=1
717   , out=data.coxout);
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   proc means data=data.cox noprint;
MPRINT(_ADJSURV):   var group;
MPRINT(_ADJSURV):   output out=maxout max(group)=numgroup;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set DATA.COX.
NOTE: The data set WORK.MAXOUT has 1 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.04 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set maxout;
MPRINT(_ADJSURV):   call symput('numgroup', numgroup);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      1072:162
NOTE: There were 1 observations read from the data set WORK.MAXOUT.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: Writing HTML Body file: sashtml.htm
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   read all var {sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after}
into x;
WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data
         contains characters that are not representable in the new encoding or truncation
         occurred during transcoding.
MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   numcov=ncol(x);
MPRINT(_ADJSURV):   create ncovout from numcov[colname='numcov'];
MPRINT(_ADJSURV):   append from numcov;
MPRINT(_ADJSURV):   close ncovout;
NOTE: The data set WORK.NCOVOUT has 1 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.55 seconds
      cpu time            0.39 seconds


MPRINT(_ADJSURV):   data _null_;
MPRINT(_ADJSURV):   set ncovout;
MPRINT(_ADJSURV):   call symput('numcov', numcov);
MPRINT(_ADJSURV):   run;
NOTE: Numeric values have been converted to character values at the places given by:
      (Line):(Column).
      2:197
NOTE: There were 1 observations read from the data set WORK.NCOVOUT.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use data.cox;
NOTE: Data file DATA.COX.DATA is in a format that is native to another host, or the file encoding
      does not match the session encoding. Cross Environment Data Access will be used, which
      might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   read all var {time} into time;
WARNING: Some character data was lost during transcoding in the dataset DATA.COX. Either the data
         contains characters that are not representable in the new encoding or truncation
         occurred during transcoding.
MPRINT(_ADJSURV):   read all var {event} into event;
MPRINT(_ADJSURV):   read all var {group} into group;
MPRINT(_ADJSURV):   read all var {sex1 age1 comorbidities1 comorbidities2 comorbidities3
comorbidities4 comorbidities5 comorbidities6 concurrent1 concurrent2 concurrent previous after}
into x;
MPRINT(_ADJSURV):   close data.cox;
MPRINT(_ADJSURV):   out=time||event||group||x;
MPRINT(_ADJSURV):   names={'time' 'event' 'strata' "z1" "z2" "z3" "z4" "z5" "z6" "z7" "z8" "z9"
"z10" "z11" "z12" "z13"};
MPRINT(_ADJSURV):   create indata from out[colname=names];
MPRINT(_ADJSURV):   append from out;
MPRINT(_ADJSURV):   close indata;
NOTE: The data set WORK.INDATA has 979 observations and 16 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.07 seconds
      cpu time            0.07 seconds


MPRINT(_ADJSURV):   proc sort data=indata;
MPRINT(_ADJSURV):   by descending time descending event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.INDATA has 979 observations and 16 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   data alltime;
MPRINT(_ADJSURV):   set indata (keep=time event);
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   drop event;
MPRINT(_ADJSURV):   if first.time;
MPRINT(_ADJSURV):   if event;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.INDATA.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc sort data=alltime;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: The data set WORK.ALLTIME has 166 observations and 1 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc phreg data=indata covout outest=best noprint;
MPRINT(_ADJSURV):   model time*event(0)= z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13;
MPRINT(_ADJSURV):   strata strata;
MPRINT(_ADJSURV):   output out=coxout xbeta=zb;
MPRINT(_ADJSURV):   run;

NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: The data set WORK.BEST has 14 observations and 18 variables.
NOTE: The data set WORK.COXOUT has 979 observations and 17 variables.
NOTE: PROCEDURE PHREG used (Total process time):
      real time           0.12 seconds
      cpu time            0.07 seconds


MPRINT(_ADJSURV):   proc sort data=coxout;
MPRINT(_ADJSURV):   by strata descending time;
MPRINT(_ADJSURV):   run;

NOTE: There were 979 observations read from the data set WORK.COXOUT.
NOTE: The data set WORK.COXOUT has 979 observations and 17 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   data best sigma;
MPRINT(_ADJSURV):   set best;
MPRINT(_ADJSURV):   if _type_='PARMS' then output best;
MPRINT(_ADJSURV):   else if _type_='COV' then output sigma;
MPRINT(_ADJSURV):   run;

NOTE: There were 14 observations read from the data set WORK.BEST.
NOTE: The data set WORK.BEST has 1 observations and 18 variables.
NOTE: The data set WORK.SIGMA has 13 observations and 18 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   data riskset1;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=1;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 98 observations read from the data set WORK.COXOUT.
      WHERE strata=1;
NOTE: The data set WORK.RISKSET1 has 35 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc sort data=riskset1;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 35 observations read from the data set WORK.RISKSET1.
NOTE: The data set WORK.RISKSET1 has 35 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=1 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount1;
MPRINT(_ADJSURV):   run;

NOTE: There were 41 observations read from the data set WORK.INDATA.
      WHERE (strata=1) and (event=1);
NOTE: The data set WORK.DCOUNT1 has 34 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset1;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset1 dcount1 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 35 observations read from the data set WORK.RISKSET1.
NOTE: There were 34 observations read from the data set WORK.DCOUNT1.
NOTE: The data set WORK.RISKSET1 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv1 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv1;
NOTE: The data set WORK.SURV1 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.65 seconds
      cpu time            0.62 seconds


MPRINT(_ADJSURV):   data riskset2;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=2;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 148 observations read from the data set WORK.COXOUT.
      WHERE strata=2;
NOTE: The data set WORK.RISKSET2 has 29 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc sort data=riskset2;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 29 observations read from the data set WORK.RISKSET2.
NOTE: The data set WORK.RISKSET2 has 29 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=2 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount2;
MPRINT(_ADJSURV):   run;

NOTE: There were 37 observations read from the data set WORK.INDATA.
      WHERE (strata=2) and (event=1);
NOTE: The data set WORK.DCOUNT2 has 28 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.05 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset2;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset2 dcount2 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 29 observations read from the data set WORK.RISKSET2.
NOTE: There were 28 observations read from the data set WORK.DCOUNT2.
NOTE: The data set WORK.RISKSET2 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv2 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv2;
NOTE: The data set WORK.SURV2 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.59 seconds
      cpu time            0.54 seconds


MPRINT(_ADJSURV):   data riskset3;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=3;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 86 observations read from the data set WORK.COXOUT.
      WHERE strata=3;
NOTE: The data set WORK.RISKSET3 has 34 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc sort data=riskset3;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 34 observations read from the data set WORK.RISKSET3.
NOTE: The data set WORK.RISKSET3 has 34 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=3 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount3;
MPRINT(_ADJSURV):   run;

NOTE: There were 38 observations read from the data set WORK.INDATA.
      WHERE (strata=3) and (event=1);
NOTE: The data set WORK.DCOUNT3 has 33 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset3;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset3 dcount3 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 34 observations read from the data set WORK.RISKSET3.
NOTE: There were 33 observations read from the data set WORK.DCOUNT3.
NOTE: The data set WORK.RISKSET3 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv3 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv3;
NOTE: The data set WORK.SURV3 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.59 seconds
      cpu time            0.56 seconds


MPRINT(_ADJSURV):   data riskset4;
MPRINT(_ADJSURV):   set coxout (keep=time strata z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13 zb);
MPRINT(_ADJSURV):   where strata=4;
MPRINT(_ADJSURV):   by descending time;
MPRINT(_ADJSURV):   keep time s0 s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13;
MPRINT(_ADJSURV):   s0+exp(zb);
MPRINT(_ADJSURV):   s1_1+z1 * exp(zb);
MPRINT(_ADJSURV):   s1_2+z2 * exp(zb);
MPRINT(_ADJSURV):   s1_3+z3 * exp(zb);
MPRINT(_ADJSURV):   s1_4+z4 * exp(zb);
MPRINT(_ADJSURV):   s1_5+z5 * exp(zb);
MPRINT(_ADJSURV):   s1_6+z6 * exp(zb);
MPRINT(_ADJSURV):   s1_7+z7 * exp(zb);
MPRINT(_ADJSURV):   s1_8+z8 * exp(zb);
MPRINT(_ADJSURV):   s1_9+z9 * exp(zb);
MPRINT(_ADJSURV):   s1_10+z10 * exp(zb);
MPRINT(_ADJSURV):   s1_11+z11 * exp(zb);
MPRINT(_ADJSURV):   s1_12+z12 * exp(zb);
MPRINT(_ADJSURV):   s1_13+z13 * exp(zb);
MPRINT(_ADJSURV):   if last.time;
MPRINT(_ADJSURV):   run;

NOTE: There were 647 observations read from the data set WORK.COXOUT.
      WHERE strata=4;
NOTE: The data set WORK.RISKSET4 has 128 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   proc sort data=riskset4;
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: There were 128 observations read from the data set WORK.RISKSET4.
NOTE: The data set WORK.RISKSET4 has 128 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   ODS LISTING CLOSE;
MPRINT(_ADJSURV):   proc freq data=indata;
MPRINT(_ADJSURV):   where strata=4 &amp;amp; event=1;
MPRINT(_ADJSURV):   table time/out=dcount4;
MPRINT(_ADJSURV):   run;

NOTE: There were 258 observations read from the data set WORK.INDATA.
      WHERE (strata=4) and (event=1);
NOTE: The data set WORK.DCOUNT4 has 127 observations and 3 variables.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.07 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   ODS LISTING;
MPRINT(_ADJSURV):   data riskset4;
MPRINT(_ADJSURV):   merge alltime (in=inall) riskset4 dcount4 (keep=time count);
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   drop ts:;
MPRINT(_ADJSURV):   retain ts0 ts1_1 ts1_2 ts1_3 ts1_4 ts1_5 ts1_6 ts1_7 ts1_8 ts1_9 ts1_10
ts1_11 ts1_12 ts1_13 999;
MPRINT(_ADJSURV):   if inall;
MPRINT(_ADJSURV):   if count=. then count=0;
MPRINT(_ADJSURV):   if s0^=. then ts0=s0;
MPRINT(_ADJSURV):   else s0=ts0;
MPRINT(_ADJSURV):   if s1_1^=. then ts1_1=s1_1;
MPRINT(_ADJSURV):   else s1_1=ts1_1;
MPRINT(_ADJSURV):   if s1_2^=. then ts1_2=s1_2;
MPRINT(_ADJSURV):   else s1_2=ts1_2;
MPRINT(_ADJSURV):   if s1_3^=. then ts1_3=s1_3;
MPRINT(_ADJSURV):   else s1_3=ts1_3;
MPRINT(_ADJSURV):   if s1_4^=. then ts1_4=s1_4;
MPRINT(_ADJSURV):   else s1_4=ts1_4;
MPRINT(_ADJSURV):   if s1_5^=. then ts1_5=s1_5;
MPRINT(_ADJSURV):   else s1_5=ts1_5;
MPRINT(_ADJSURV):   if s1_6^=. then ts1_6=s1_6;
MPRINT(_ADJSURV):   else s1_6=ts1_6;
MPRINT(_ADJSURV):   if s1_7^=. then ts1_7=s1_7;
MPRINT(_ADJSURV):   else s1_7=ts1_7;
MPRINT(_ADJSURV):   if s1_8^=. then ts1_8=s1_8;
MPRINT(_ADJSURV):   else s1_8=ts1_8;
MPRINT(_ADJSURV):   if s1_9^=. then ts1_9=s1_9;
MPRINT(_ADJSURV):   else s1_9=ts1_9;
MPRINT(_ADJSURV):   if s1_10^=. then ts1_10=s1_10;
MPRINT(_ADJSURV):   else s1_10=ts1_10;
MPRINT(_ADJSURV):   if s1_11^=. then ts1_11=s1_11;
MPRINT(_ADJSURV):   else s1_11=ts1_11;
MPRINT(_ADJSURV):   if s1_12^=. then ts1_12=s1_12;
MPRINT(_ADJSURV):   else s1_12=ts1_12;
MPRINT(_ADJSURV):   if s1_13^=. then ts1_13=s1_13;
MPRINT(_ADJSURV):   else s1_13=ts1_13;
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.ALLTIME.
NOTE: There were 128 observations read from the data set WORK.RISKSET4.
NOTE: There were 127 observations read from the data set WORK.DCOUNT4.
NOTE: The data set WORK.RISKSET4 has 166 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s0;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s1;
MPRINT(_ADJSURV):   read all var{count} into count;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(s0);
MPRINT(_ADJSURV):   numcov=ncol(s1);
MPRINT(_ADJSURV):   cumuhaz=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp=0;
MPRINT(_ADJSURV):   wtemp=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp=ctemp+count[i]/s0[i];
MPRINT(_ADJSURV):   wtemp=wtemp+count[i]/s0[i]/s0[i];
MPRINT(_ADJSURV):   cumuhaz[i]=ctemp;
MPRINT(_ADJSURV):   w1[i]=wtemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   adjsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   varsurv=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz=j(numtime,1,0);
MPRINT(_ADJSURV):   fh=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv=exp(-cumuhaz)##expbz;
MPRINT(_ADJSURV):   adjsurv=adjsurv+surv;
MPRINT(_ADJSURV):   fexpbz=fexpbz+surv#expbz;
MPRINT(_ADJSURV):   h=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp=htemp + count[j]/s0[j]*(zmat[i,]-s1[j,]/s0[j]);
MPRINT(_ADJSURV):   h[j,]=htemp;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh=fh+surv#h#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   adjsurv=adjsurv/numobs;
MPRINT(_ADJSURV):   term1=(fexpbz##2)#w1;
MPRINT(_ADJSURV):   term2=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term2[i]=fh[i,]*sigma*t(fh[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   varsurv=term1+term2;
MPRINT(_ADJSURV):   varsurv=varsurv/numobs/numobs;
MPRINT(_ADJSURV):   sesurv=varsurv##0.5;
MPRINT(_ADJSURV):   outmat=time||adjsurv||sesurv;
MPRINT(_ADJSURV):   names={'time' 'surv' 'se'};
MPRINT(_ADJSURV):   create surv4 from outmat[colname=names];
MPRINT(_ADJSURV):   append from outmat;
MPRINT(_ADJSURV):   close surv4;
NOTE: The data set WORK.SURV4 has 166 observations and 3 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.63 seconds
      cpu time            0.71 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov12 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov12;
NOTE: The data set WORK.COV12 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.14 seconds
      cpu time            1.12 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov13 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov13;
NOTE: The data set WORK.COV13 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.19 seconds
      cpu time            1.14 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset1;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset1;
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov14 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov14;
NOTE: The data set WORK.COV14 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.19 seconds
      cpu time            1.26 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov23 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov23;
NOTE: The data set WORK.COV23 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.18 seconds
      cpu time            1.23 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset2;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset2;
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov24 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov24;
NOTE: The data set WORK.COV24 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.20 seconds
      cpu time            1.14 seconds


MPRINT(_ADJSURV):   proc iml;
NOTE: IML Ready
MPRINT(_ADJSURV):   use riskset3;
MPRINT(_ADJSURV):   read all var{time} into time;
MPRINT(_ADJSURV):   read all var{s0} into s01;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s11;
MPRINT(_ADJSURV):   read all var{count} into count1;
MPRINT(_ADJSURV):   close riskset3;
MPRINT(_ADJSURV):   use riskset4;
MPRINT(_ADJSURV):   read all var{s0} into s02;
MPRINT(_ADJSURV):   read all var{ s1_1 s1_2 s1_3 s1_4 s1_5 s1_6 s1_7 s1_8 s1_9 s1_10 s1_11 s1_12
s1_13} into s12;
MPRINT(_ADJSURV):   read all var{count} into count2;
MPRINT(_ADJSURV):   close riskset4;
MPRINT(_ADJSURV):   use best;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into b;
MPRINT(_ADJSURV):   close best;
MPRINT(_ADJSURV):   use sigma;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into sigma;
MPRINT(_ADJSURV):   close sigma;
MPRINT(_ADJSURV):   use indata;
MPRINT(_ADJSURV):   read all var{ z1 z2 z3 z4 z5 z6 z7 z8 z9 z10 z11 z12 z13} into zmat;
MPRINT(_ADJSURV):   close indata;
MPRINT(_ADJSURV):   numtime=nrow(time);
MPRINT(_ADJSURV):   numobs=nrow(zmat);
MPRINT(_ADJSURV):   numcov=ncol(s11);
MPRINT(_ADJSURV):   cumuhaz1=j(numtime,1,0);
MPRINT(_ADJSURV):   cumuhaz2=j(numtime,1,0);
MPRINT(_ADJSURV):   w1=j(numtime,1,0);
MPRINT(_ADJSURV):   w2=j(numtime,1,0);
MPRINT(_ADJSURV):   ctemp1=0;
MPRINT(_ADJSURV):   ctemp2=0;
MPRINT(_ADJSURV):   wtemp1=0;
MPRINT(_ADJSURV):   wtemp2=0;
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   ctemp1=ctemp1+count1[i]/s01[i];
MPRINT(_ADJSURV):   ctemp2=ctemp2+count2[i]/s02[i];
MPRINT(_ADJSURV):   wtemp1=wtemp1+count1[i]/s01[i]/s01[i];
MPRINT(_ADJSURV):   wtemp2=wtemp2+count2[i]/s02[i]/s02[i];
MPRINT(_ADJSURV):   cumuhaz1[i]=ctemp1;
MPRINT(_ADJSURV):   cumuhaz2[i]=ctemp2;
MPRINT(_ADJSURV):   w1[i]=wtemp1;
MPRINT(_ADJSURV):   w2[i]=wtemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fexpbz1=j(numtime,1,0);
MPRINT(_ADJSURV):   fexpbz2=j(numtime,1,0);
MPRINT(_ADJSURV):   fh2_fh1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   do i=1 to numobs;
MPRINT(_ADJSURV):   expbz=exp(zmat[i,]*t(b));
MPRINT(_ADJSURV):   surv1=exp(-cumuhaz1)##expbz;
MPRINT(_ADJSURV):   surv2=exp(-cumuhaz2)##expbz;
MPRINT(_ADJSURV):   fexpbz1=fexpbz1+surv1#expbz;
MPRINT(_ADJSURV):   fexpbz2=fexpbz2+surv2#expbz;
MPRINT(_ADJSURV):   h1=j(numtime,numcov,0);
MPRINT(_ADJSURV):   h2=j(numtime,numcov,0);
MPRINT(_ADJSURV):   htemp1=j(1, numcov, 0);
MPRINT(_ADJSURV):   htemp2=j(1, numcov, 0);
MPRINT(_ADJSURV):   do j=1 to numtime;
MPRINT(_ADJSURV):   htemp1=htemp1 + count1[j]/s01[j]*(zmat[i,]-s11[j,]/s01[j]);
MPRINT(_ADJSURV):   htemp2=htemp2 + count2[j]/s02[j]*(zmat[i,]-s12[j,]/s02[j]);
MPRINT(_ADJSURV):   h1[j,]=htemp1;
MPRINT(_ADJSURV):   h2[j,]=htemp2;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   fh2_fh1=fh2_fh1+surv2#h2#expbz-surv1#h1#expbz;
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   term1=(fexpbz1##2)#w1;
MPRINT(_ADJSURV):   term2=(fexpbz2##2)#w2;
MPRINT(_ADJSURV):   term3=j(numtime,1,0);
MPRINT(_ADJSURV):   do i=1 to numtime;
MPRINT(_ADJSURV):   term3[i]=fh2_fh1[i,]*sigma*t(fh2_fh1[i,]);
MPRINT(_ADJSURV):   end;
MPRINT(_ADJSURV):   covar=term1+term2+term3;
MPRINT(_ADJSURV):   covar=covar/numobs/numobs;
MPRINT(_ADJSURV):   cov=covar##0.5;
MPRINT(_ADJSURV):   names={'se'};
MPRINT(_ADJSURV):   create cov34 from cov[colname=names];
MPRINT(_ADJSURV):   append from cov;
MPRINT(_ADJSURV):   close cov34;
NOTE: The data set WORK.COV34 has 166 observations and 1 variables.
MPRINT(_ADJSURV):   run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
MPRINT(_ADJSURV):   quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           1.14 seconds
      cpu time            1.12 seconds


MPRINT(_ADJSURV):   data mout;
MPRINT(_ADJSURV):   merge surv1 (rename=(surv=surv1 se=se1)) surv2 (rename=(surv=surv2 se=se2))
surv3 (rename=(surv=surv3 se=se3)) surv4 (rename=(surv=surv4 se=se4)) cov12 (rename=(se=se12))
cov13 (rename=(se=se13)) cov14 (rename=(se=se14)) cov23 (rename=(se=se23)) cov24
(rename=(se=se24)) cov34 (rename=(se=se34));
MPRINT(_ADJSURV):   run;

NOTE: There were 166 observations read from the data set WORK.SURV1.
NOTE: There were 166 observations read from the data set WORK.SURV2.
NOTE: There were 166 observations read from the data set WORK.SURV3.
NOTE: There were 166 observations read from the data set WORK.SURV4.
NOTE: There were 166 observations read from the data set WORK.COV12.
NOTE: There were 166 observations read from the data set WORK.COV13.
NOTE: There were 166 observations read from the data set WORK.COV14.
NOTE: There were 166 observations read from the data set WORK.COV23.
NOTE: There were 166 observations read from the data set WORK.COV24.
NOTE: There were 166 observations read from the data set WORK.COV34.
NOTE: The data set WORK.MOUT has 166 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   data data.coxout;
MPRINT(_ADJSURV):   time=0;
MPRINT(_ADJSURV):   surv1=1;
MPRINT(_ADJSURV):   se1=0;
MPRINT(_ADJSURV):   se12=0;
MPRINT(_ADJSURV):   se13=0;
MPRINT(_ADJSURV):   se14=0;
MPRINT(_ADJSURV):   surv2=1;
MPRINT(_ADJSURV):   se2=0;
MPRINT(_ADJSURV):   se23=0;
MPRINT(_ADJSURV):   se24=0;
MPRINT(_ADJSURV):   surv3=1;
MPRINT(_ADJSURV):   se3=0;
MPRINT(_ADJSURV):   se34=0;
MPRINT(_ADJSURV):   surv4=1;
MPRINT(_ADJSURV):   se4=0;
MPRINT(_ADJSURV):   output;
MPRINT(_ADJSURV):   run;

NOTE: Data file DATA.COXOUT.DATA is in a format that is native to another host, or the file
      encoding does not match the session encoding. Cross Environment Data Access will be used,
      which might require additional CPU resources and might reduce performance.
NOTE: The data set DATA.COXOUT has 1 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


MPRINT(_ADJSURV):   data data.coxout;
MPRINT(_ADJSURV):   set data.coxout mout;
NOTE: Data file DATA.COXOUT.DATA is in a format that is native to another host, or the file
      encoding does not match the session encoding. Cross Environment Data Access will be used,
      which might require additional CPU resources and might reduce performance.
MPRINT(_ADJSURV):   by time;
MPRINT(_ADJSURV):   run;

NOTE: Data file DATA.COXOUT.DATA is in a format that is native to another host, or the file
      encoding does not match the session encoding. Cross Environment Data Access will be used,
      which might require additional CPU resources and might reduce performance.
NOTE: There were 1 observations read from the data set DATA.COXOUT.
NOTE: There were 166 observations read from the data set WORK.MOUT.
NOTE: The data set DATA.COXOUT has 167 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds


&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 01:03:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Some-programming-questions-about-SAS-macro/m-p/755521#M238435</guid>
      <dc:creator>Mingming1992</dc:creator>
      <dc:date>2021-07-21T01:03:45Z</dc:date>
    </item>
  </channel>
</rss>

