/* hog.sas */ TITLE1 'Hog supply, hog prices and differences'; TITLE2 'Hog Data (1867-1948)'; /* Note that this program requires the macro mkfields.sas to be submitted before this program */ /* Read in the two data sets */ DATA data1; INFILE 'c:\data\hogsuppl.txt'; INPUT supply @@; DATA data2; INFILE 'c:\data\hogprice.txt'; INPUT price @@; /* Merge data sets, generate year and compute differences */ DATA data3; MERGE data1 data2; year=_N_+1866; diff=supply-price; /* Graphical options */ SYMBOL1 V=DOT C=GREEN I=JOIN H=0.5 W=1; AXIS1 LABEL=(ANGLE=90 'h o g s u p p l y'); AXIS2 LABEL=(ANGLE=90 'h o g p r i c e s'); AXIS3 LABEL=(ANGLE=90 'd i f f e r e n c e s'); /* Generate three plots */ GOPTIONS NODISPLAY; PROC GPLOT DATA=data3 GOUT=abb; PLOT supply*year / VAXIS=AXIS1; PLOT price*year / VAXIS=AXIS2; PLOT diff*year / VAXIS=AXIS3 VREF=0; RUN; /* Display them in one output */ GOPTIONS DISPLAY; PROC GREPLAY NOFS IGOUT=abb TC=SASHELP.TEMPLT; TEMPLATE=V3; TREPLAY 1:GPLOT 2:GPLOT1 3:GPLOT2; RUN; DELETE _ALL_; QUIT;