SAS Component Language Dictionary |
Category: | Variable |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
rc=VARSTAT(table-id,varlist-1,statistics,varlist-2); |
contains the return code for the operation:
0 | |
0 |
is the identifier that was assigned when the table was opened. If table-id is invalid, the program halts.
specifies one or more numeric columns for which to create the statistics.
specifies one or more statistics, separated by blanks, from the table below. For more information about these statistics, see the SAS/STAT User's Guide.
specifies one or more output variables to contain the values produced by the specified statistics. The number of output variables must equal the number of columns in varlist-1 multiplied by the number of statistics.
Note: These parameters are update parameters. See Input, Output, and Update Parameters for more information.
Details |
If more than one input column is specified with more than one statistic, then each statistic is calculated on all columns before the next statistic is calculated.
Example |
Calculate the maximum, mean, and minimum values for the columns I and X from the table MY.NUMBERS:
tablename='my.numbers'; length imax xmax imean xmean xmin imin 8; /* Declare the results as numeric. */ varname='i x'; numberid=open(tablename); if (numberid=z0) then do; _msg_='Cannot open '||tablename; return; end; statcode=varstat(numberid,varname, 'max mean min',imax,xmax,imean,xmean,imin,xmin); put 'Column X'; put xmax= xmean= xmin=; put 'Column I'; put imax= imean= imin=; rc=close(numberid); return;
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.