gskip Device-independent macro for multiple plots gskip

SAS Macro Programs: gskip

$Version: 1.2 (05 Apr 2006)
Michael Friendly
York University

The gskip macro ( [download] get

Device-independent macro for multiple plots

The GSKIP macro is designed to handle difficulties in producing multiple plots in one SAS job in a device-independent way. This makes it easier to change from one device to another without modifying your program code. For EPS, GIF, CGM and WMF drivers, it assigns a new output filename for the next plot. For FOILS (on continuous forms) it skips the normally blank non-foil separator page. Otherwise, (e.g., for screen output) it has no effect.


The GSKIP macro has one optional positional parameter, but is usually called just as
  proc gplot;
     plot y * x;
after a procedure or macro which produces just one plot. It relies on global macro parameters, DISPLAY, DEVTYP, FIG, GSASFILE, and GSASDIR. These parameters are normally initialized either in the AUTOEXEC.SAS file, or in device-specific macros. For example, for normal graphic output to the Graph Window, assign DISPLAY and DEVTYPE as
  %let devtype=SCREEN;
  %let displa=ON;
For EPS file output, an output filename (GSASFILE) and initial figure number (FIG) should be assigned:
  %let devtype=EPS;
  %let fig=1;
  %let gsasfile=myfig;
GSKIP is normally used after each graphic procedure or macro to advance the FIG counter and open a new graphic output file. For example,
  proc gplot;
     plot y * x;


The value by which the FIG counter is incremented, normally 1 (the default). Use the INC parameter after a plot with a BY statement. For example,
  proc gplot;
     plot y * x; by sex;

Global Parameters

String value, ON or OFF, usually set by the GDISPLA macro. The GISKP macro takes no action if DISPLAY=OFF.
String value, the type of graphic device driver. The values EPS, GIF, CGM and WMF cause FIG to be incremented and a new output filename assigned. If DEVTYPE=FOILS, a blank graphic page is produced. All others are ignored.
A numeric value, the number of the current figure.
String value, the basename of the graphic output file(s). The output files are named according to the macro expression
e.g., myfile1.eps, myfile2.eps, ....
String value, the output directory in which the graphic files are written. If not specified, output goes to the current directory.

See also