|
Chapter Contents |
Previous |
Next |
| Language Reference |
prints matrix values
The inputs to the PRINT statement are as follows:
print x[format=5.3];
reset autoname;For example, you can use the statement below to print a matrix called X in format 12.2 with columns labeled AMOUNT and NET PAY, and rows labeled DIV A and DIV B:
x={45.125 50.500,
75.375 90.825};
r={"DIV A" "DIV B"};
c={"AMOUNT" "NET PAY"};
print x[rowname=r colname=c format=12.2];
The output is
X AMOUNT NET PAY
DIV A 45.13 50.50
DIV B 75.38 90.83
To permanently associate the above options with a matrix
name, refer to the description of the MATTRIB statement.
If there is not enough room to print all the matrices across the page, then one or more matrices are printed out in the next group. If there is not enough room to print all the columns of a matrix across the page, then the columns are folded, with the continuation lines identified by a colon(:).
The spacing between adjacent matrices can be controlled by the SPACES= option of the RESET statement. The FW= option of the RESET statement can be used to control the number of print positions used to print each numeric element. For more print-related options, see the description of the RESET statement. The example below shows how to print part of a matrix:
y=1:10;
/* prints first five elements of y*/
print (y[1:5]) [format=5.1];
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.