DATA Step, Macro, Functions and more

Macro Value to Proc GChart Legend Order() invoking error?

Occasional Contributor
Posts: 7

Macro Value to Proc GChart Legend Order() invoking error?


I am using the code from SAS Paper 134-2007, Figure 4: Proc GChart to create a demo pie chart for one of our groups to show them their invoice data in SAS, however, when I run the code to generate the pie chart, I get the following error:

ERROR: The ORDER= entry "31.0% INTERACTIVE DATAPRICING AN" is not a legend value.

Here is the %Macro that generates the LegendEntries values;

%macro LegendEntries;

%do i = 1 %to 10;



%mend LegendEntries;

Here is the DataStep that concatenates the results into a value;

data Dashdata.SliceNameWithPercentAndValue;

length NameWithPercentAndValue $ 60;

set Dashdata.MDTOPTEN;

if _N_ eq 1 then set PieTotal;

Percent = (invoice_sum / TotalValue) * 100;

Format Percent Z4.2;

NameWithPercentAndValue = trim(left(put(Percent,Z4.2))) || '%' || ' ' ||

trim(left(vendor_name)) ||' '|| trim(left(put(invoice_sum,DOLLAR17.)));


I have tweaked the existing code from the paper to fit my needs, more the record count from 1 to 6, to, 1 to 10 in the LegendEntries Macro and the Length value to $ 60 for the NameWithPercentAndValue variable.

I have attached a .sas file with all relevant code, any help today would be greatly appreciated as we are trying to garner more clients to use our SAS Dashboard's that we have developed and capturing the Market Data folks would be a huge winfall for us.


Ask a Question
Discussion stats
  • 0 replies
  • 1 in conversation