Hi,
I am trying to plot a lasagne plot adapting a published code. I am not sure how I can fix the error for the following part of the code.
The warning message says: "WARNING: The blockplot statement will not be drawn because one or more of the
required arguments were not supplied." and it is written five times.
Any help is appreciated.
Thank you.
Befikadu
/*create chart definition using GTL*/ proc template; define statgraph blockplot2; begingraph; entrytitle "1921-26 Cohort - Diabetes"; legendItem type=fill name="Yes" / fillattrs=(color=cxaa88bb ) label="Yes" ; legendItem type=fill name="No" / fillattrs=(color=cxaaddcc ) label="No" ; legendItem type=fill name="Deceased" / fillattrs=(color=cx662277 ) label="Deceased " ; layout lattice / columns=1 rowweights=(.10 .75 .10 .05) columndatarange=union; COLUMNAXES; columnaxis / display=none ; endcolumnaxes; blockplot x=survey block=percent2 / class=smkstat includemissingclass=false display=(values label outline) valuehalign=center labelattrs=GraphDataText valueattrs=GraphDataText; barchart x=survey y=percent / group=smkstr orient=vertical display=(fill) index=indexn; blockplot x=survey block=atext / class=alabel includemissingclass=false display=(values) valuehalign=center labelattrs=GraphDataText valueattrs=GraphDataText; discretelegend "Yes" "No" "Deceased" / border=false; endlayout; endgraph; end; run; /* format for smoking status */ proc format; value smk 0='No' 1='Yes' 2='Deceased'; title ; /* create graph */ ods listing close; ods rtf file='old_DB_stat.rtf' style=newchart; proc sgrender data=allsmk template=blockplot2 ; format smkstat smk. ; run; ods rtf close; ods listing;
To answer your question it would help if you could provide the original source, some sample data so we can run the program and/or the log that actually shows the errors.
As posted it would be hard to debug. I'll move your post to the graphics forum as well, sot he relevant people can respond.
And if you could verify your SAS version, that's important in SAS graphics as a lot has changed quickly.
You can find the version via:
proc product_status;run;
Mine for example (SAS UE) shows:
@Befikadu wrote:
Hi,
I am trying to plot a lasagne plot adapting a published code. I am not sure how I can fix the error for the following part of the code.
The warning message says: "WARNING: The blockplot statement will not be drawn because one or more of the
required arguments were not supplied." and it is written five times.
Any help is appreciated.
Thank you.
Befikadu
/*create chart definition using GTL*/ proc template; define statgraph blockplot2; begingraph; entrytitle "1921-26 Cohort - Diabetes"; legendItem type=fill name="Yes" / fillattrs=(color=cxaa88bb ) label="Yes" ; legendItem type=fill name="No" / fillattrs=(color=cxaaddcc ) label="No" ; legendItem type=fill name="Deceased" / fillattrs=(color=cx662277 ) label="Deceased " ; layout lattice / columns=1 rowweights=(.10 .75 .10 .05) columndatarange=union; COLUMNAXES; columnaxis / display=none ; endcolumnaxes; blockplot x=survey block=percent2 / class=smkstat includemissingclass=false display=(values label outline) valuehalign=center labelattrs=GraphDataText valueattrs=GraphDataText; barchart x=survey y=percent / group=smkstr orient=vertical display=(fill) index=indexn; blockplot x=survey block=atext / class=alabel includemissingclass=false display=(values) valuehalign=center labelattrs=GraphDataText valueattrs=GraphDataText; discretelegend "Yes" "No" "Deceased" / border=false; endlayout; endgraph; end; run; /* format for smoking status */ proc format; value smk 0='No' 1='Yes' 2='Deceased'; title ; /* create graph */ ods listing close; ods rtf file='old_DB_stat.rtf' style=newchart; proc sgrender data=allsmk template=blockplot2 ; format smkstat smk. ; run; ods rtf close; ods listing;
This can happen when all the values for the BLOCK variable are missing. Another option is to try using a HEATMAP instead of BlockPlot.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.