TITLE 'Example SAS program to create a simple graph in a PostScript file'; TITLE2 'File is /sas/examples/fig1.sas'; data scores; /* data set */ input name $ 1-3 age 5-6 score 8-10; cards; sam 26 80 joe 22 75 ted 20 68 tim 19 55 bob 30 74 jim 35 66 tom 38 52 ; filename gsasfile 'fig1.ps'; /* Set up the file name for the PostScript output */ /* Graphics options */ goptions reset=all /* reset all graphics options */ gaccess = gsasfile /* set output file to gsasfile */ gsfmode = replace /* replace PostScript file, do not append */ gprolog='25210a'x /* write PostScript prolog (hexadecimal for exclamation point, percent sign, line feed) */ device=PS; /* set output to PS (PostScript) */ axis1 order = (0 to 50 by 10) /* horizontal (x) axis parameters */ label = ('Age') minor = none origin = (20 pct, 15 pct) offset = (0, 0) length = 60 pct; axis2 order = (0 to 100 by 20) /* vertical (y) axis parameters */ label = ('Test Score') minor = none origin = (20 pct, 15 pct) offset = (0, 0) length = 30 pct; proc gplot data=scores; /* plot score on the y axis, age on the x axis */ plot score * age/ haxis = axis1 vaxis = axis2; run; /* If you need assistance with SAS please contact the statistical */ /* consultants at the ITC Research Computing Support Center at */ /* 244 Wilson Hall - 243-8000 M-F 9-5 or */ /* mail res-consult@virginia.edu */