genpat | genpat |
The GENPAT macro generates one or more PATTERN statements for a list
of colors, specified either in the COLORS=
macro argument, or in a
DATA=
data set, using the values of the COLORS=
variable.
The GENPAT macro is defined with keyword parameters. The arguments may be listed within parentheses in any order, separated by commas. For example:
%genpat(n=3);
Produces:
PATTERN1 fill=solid color=BLACK repeat=1; PATTERN2 fill=solid color=RED repeat=1; PATTERN3 fill=solid color=GREEN repeat=1;
DATA=
data set is specified, you may use N=NOBS
to mean the
number of observations in that data set. [Default: N=1
]
START=1
]
DATA=
parameter is specified, COLORS=
gives a
list of SAS/Graph color names or color specifications
(e.g., RGB colors (CXrrggbb), HLS colors (Hhhhllss)
[Default: COLORS=BLACK RED GREEN BLUE BROWN ORANGE PURPLE YELLOW
]
FILL=SOLID
]
REPEAT=1
]
COLORS=
parameter.
*-- 21 rainbow colors; %let rainbow= CXFF0000 CXFF4600 CXFF8B00 CXFFD100 CXE8FF00 CXA2FF00 CX5DFF00 CX17FF00 CX00FF2E CX00FF74 CX00FFB9 CX00FFFF CX00B9FF CX0074FF CX002EFF CX1700FF CX5D00FF CXA200FF CXE800FF CXFF00D1 CXFF008B CXFF0046;
%genpat(n=21, colors=&rainbow);
*-- The same, with an input data set; data rainbow; input color $ @@; datalines; CXFF0000 CXFF4600 CXFF8B00 CXFFD100 CXE8FF00 CXA2FF00 CX5DFF00 CX17FF00 CX00FF2E CX00FF74 CX00FFB9 CX00FFFF CX00B9FF CX0074FF CX002EFF CX1700FF CX5D00FF CXA200FF CXE800FF CXFF00D1 CXFF008B CXFF0046 ; %genpat(n=nobs, data=rainbow, colors=color);
%include macros(genpat); *-- or include in an autocall library; %genpat();