One approach is to write CONTRAST statements using orthogonal polynomial coefficients. The following statements test for linear, quadratic, and cubic trends when doses are equally spaced with 4 levels.

proc glm;
class dose;
model y=dose;
contrast 'linear' dose -3 -1 1 3;
contrast 'quadratic' dose 1 -1 -1 1;
contrast 'cubic' dose -1 3 -3 1;
run;

If your treatments are unequally spaced, you can use the ORPOL function in PROC IML to obtain the appropriate coefficients for the CONTRAST statement. In the following example, dose levels are 0, 2.5, 6, and 12 and you want to test for linear and quadratic trends. Specify the value 2 as the second argument in the ORPOL function to obtain polynomials up to degree 2 (quadratic).

proc iml;
doseL={0 2.5 6 12};
contrL=orpol(doseL, 2);
print contrL;
quit;

Below are the results from the ORPOL function.

contrL
0.5 -0.568787 0.5461334
0.5 -0.29133 -0.252786
0.5 0.0971099 -0.692023
0.5 0.7630063 0.3986752

Based on the results you can write the following CONTRAST statement to test for the linear and quadratic trend for dose.

proc glm;
class dose;
model y=dose;
contrast 'linear' dose -0.568787 -0.29133 0.0971099 0.7630063;
contrast 'quadratic' dose 0.5461334 -0.252786 -0.692023 0.3986752;
run;

Note that the ORPOL function is useful for obtaining the coefficients for the CONTRAST statement regardless of whether the treatments are equally spaced or not.

Alternatively, you could treat the variable of interest as a continuous variable and specify higher-order effects in the MODEL statement.The tests for these higher-order effects indicate whether the higher-order trend is significant.

proc glm;
model Y=dose dose*dose dose*dose*dose;
run;
quit;

If you are doing a repeated measures analysis, the POLYNOMIAL transformation option in the REPEATED statement provides tests for trends. In the following statements, the first REPEATED statement assumes equally spaced time points. The second REPEATED statement allows you to specify the spacing of the time points for unequally spaced data.

PROC GLM;
CLASS DRUG DOSE;
MODEL Y1 Y2 Y3 Y4 = DRUG DOSE DRUG*DOSE;
REPEATED TIME POLYNOMIAL / SUMMARY;
REPEATED TIME 4 (0 3 5 12) POLYNOMIAL / SUMMARY;
RUN;

#### Operating System and Release Information

*****
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.