1
votes

OK. Finally, I get the chance to address this problem properly. I came across this problem on SAS EG.

First, I have the following dataset:

data test;
infile datalines;
input var1 var2;
datalines;
0.01 200
0.02 200
0.03 200
0.04 200
0.05 200
0.06 200
0.07 200
0.08 200
0.09 200
0.10 200
0.11 200
0.12 200
0.13 200
0.14 200
0.15 200
11111111111111111111111111 200
;
run;

When I try to plot var1(x-axis) against var2(y-axis) in a gchart hbar, it works fine:

PROC GCHART DATA=test;
HBAR age / 
    SUMVAR=income missing discrete clipref frame;
run;quit;

The chart is enter image description here

But when I specify goptions reset=all device=gif; The chart becomes:

enter image description here

Clearly, there is an extreme value and all the other bars overlap with each other. Notice that even that I put discrete option in my hbar statement, when I put goptions in, it seems not working.

Obviously, the purpose here is to just put var1 evenly on x-axis, rather than putting them according to their numeric values. So the first chart is what I want. But I need the goptions in order to output the chart to a gif file.

Is there anyone having the similar experience and what would be the solution? Many thanks.

1

1 Answers

2
votes

The easiest solution is to change the type of age from number to character. SAS will not try to space character values relative to their the values as it tries with numeric values.