Determine if RANGES is appropriate given the data. Generate VALUES or RANGES text for use in YAXIS/XAXIS statements of SGPLOT.
This SAS® 9.4 brought some wonderful new graphics options. One of the most exciting is the addition of the RANGE option for SGPLOT. As the name suggests, specifying ranges for a broken axis is controlled by the user. The only question left is where to set the breaks and if a break is actually needed. That is what this macro is designed to do. The macro analyzes the specified input parameter to determine if the RANGES option is appropriate given the gaps found in the data. If no gap is large enough a macro variable containing text for VALUES option is output as well as lower limit, upper limit, and by values for the graph. If there is at least one gap that meets criteria a macro variable containing text for the RANGES option is output along with the lower and upper values in each range. The overall minimum and overall maximum are also output as macro variables. With the macro’s dynamic nature it can be incorporated into larger graphics macro programs easily while making specific recommendations for each individual parameter. A complete and intuitive graph is produced with every macro call.