Thank you very much @Ksharp, you helped me so much. After I change my code as below, it worked . What do you think? Does it seem dynamic and proper? I think I won't face any errors in future, If I use this code?
Ods Escapechar='~';
Options Missing=' ';
Proc Report Data=Spr2_&Suffix. Nowd SpanRows Style(Column)=[BorderColor=Black BorderWidth=1px]
Style(Header)=Header [BorderColor=Black BorderWidth=1px];
Column ("Spearman Correlation Coefficients, N = &Nobs
~n Prob > |r| under H0: Rho=0" Variable &ModelVar. Dummy);
Define Variable /Order ' ' Style(Column)=Header{VJust=C FontWeight=Bold Color=#112277} ;
%MakeDefine;
Define Dummy / Computed NoPrint;
Compute Dummy;
N+1;
If Mod(N,2)=1 Then Do;
%If &Count. GT 0 %Then %Do;
%Do j = 1 %to &Count.;
%Let Var&j = %Scan(&ModelVar.,&j,%str( ));
%Put Var&j= &&Var&j;
Call Define("&&Var&j","Style","Style={BackGround=CorrSec.}");
%End;
%End;
End;
Else Do;
%If &Count. GT 0 %Then %Do;
%Do j = 1 %to &Count.;
%Let Var&j = %Scan(&ModelVar.,&j,%str( ));
%Put Var&j= &&Var&j;
Call Define("&&Var&j","Format","PValue.");
%End;
%End;
End;
EndComp;
Run;
Thank you
... View more