DATA lotsize1; /* Creates dataset called 'lotsize1' */ /* All SAS statements end in a semicolon */ /* Blank lines and spaces are ignored */ INPUT size hours; /* Creates variables */ DATALINES; /* This keyword tells SAS that data will follow */ 80 399 30 121 50 221 90 376 70 361 60 224 120 546 80 352 100 353 50 157 40 160 70 252 90 389 20 113 110 435 100 420 30 212 50 268 90 377 110 421 30 273 90 468 40 244 80 342 70 323 ; /* End of input */ PROC MEANS DATA=lotsize1; /* A SAS procedure */ VAR size hours; RUN; /* End of PROC step */ PROC CORR DATA=lotsize1; /* Another SAS procedure */ VAR hours size; RUN; /* End of PROC step */ PROC REG DATA=lotsize1; MODEL hours = size; RUN; DATA lotsize2; /* Creates another dataset */ SET lotsize1; X=size; /* New variables are created */ Y=hours; Xc = X-70.0; Yc = Y-312.28; /* Multiple operations in one line */ Xcsq = Xc*Xc; Ycsq = Yc*Yc; XcYc = Xc*Yc; RUN; PROC PRINT DATA=lotsize2; VAR X Y Xc Yc Xcsq Ycsq XcYc; SUM X Y Xc Yc Xcsq Ycsq XcYc; RUN; QUIT;