jeudi 19 avril 2018

SAS, if statement within plot statement

I want to add the if statement to my plot to change titles in different scenarios. I know my code in the first sgplot won't work. Do we have something similar to this?

%let group = A B C;

/*something I want but didn't work*/
proc sgplot data=input_data ;
series x=num_accounts y=income;
if  length(&group.)=2 then 
title "VAR1=5 and VAR2=4";
else if length(&group.)=1 then
title "VAR1=5";
run;

/*plot without if statement */
proc sgplot data=input_data ;
series x=num_accounts y=income;
title "VAR1=5";
run;     

Aucun commentaire:

Enregistrer un commentaire