The name of each function can be given in either upper or lower case. Some function names can be abbreviated. The minimum required name is given below in upper case; the characters in lower case are optional and are ignored by the program.

- &a,&b
- Reference to a variable (generated by a statement such as ‘&a=age’)
- c-g
- Numbers (codes for the values of variables)
- &x,&y,&z
- Most general type of argument - can be a reference to a variable, the result of a function, or a numeric constant

The term * valid * in the following definitions means that
the value of a variable is not equal to the missing-data code nor
is it beyond the defined range of valid codes.

- Functions Used for DEFINING VARIABLES
- Functions for COLUMN specifications
- Specifications for ROWS and TOTALS
- Functions for HEADERS and FOOTERS
- Functions for INTERACTIVE REPORTS

The functions ‘wnvalid’ and ‘wstderr’ generate the same numbers as ‘nvalid’ and ‘stderr’ if no weight variable has been specified.MEAN(&a) Mean MAXimum(&a) Maximum valid value MINimum(&a) Minimum valid value STDDEV(&a) Standard deviation STDERR(&a) Standard error SUM(&a) Sum of a variable across cases Nvalid(&a) Number of valid cases VARiance(&a) Variance WNvalid(&a) Weighted number of valid cases WSTDERR(&a) Standard error, computed with weighted N

In a ROWVARS type of report, only the function name is given; it applies automatically to every row variable.

The character ‘*’ used as the range of a variable refers to all valid codes. If a weight variable has been specified, the number of cases is weighted.FREQuency(&a,c-d,e,f-g) Number of cases that fall within the given ranges of ‘&a’. BIFREQuency(&a,c-d; &b,e-f,g) Number of cases that fall within the given ranges of BOTH variables. NOTICE THE SEMICOLON, used to separate the ranges of the two variables.

- COLPCTN(&m)
- The column or vertical percent based on the NUMBER OF CASES in a column. The argument ‘&m’ can be either a reference to a variable (produced by a statement such as ‘&m=age’) or the result of a FREQUENCY or BIFREQUENCY command (produced by a series of statements such as ‘&a=age’ and ‘&m=FREQ(&a,18-30)’).
- COLPCTSUM(&a)
- The column or vertical percent based on the SUM OF THE VALUES of the variable given as the argument.
- ROWPCT(&x,&y)
- The row or horizontal percent based on the values of the two arguments. This function divides the first argument by the second argument and multiplies by 100: &x / &y * 100.

ADD(&x,&y,&z,...) Add the arguments SUBtract(&x,&y) Subtract: &x - &y MULTiply(&x,&y,&z,...) Multiply the arguments DIVide(&x,&y) Divide: &x / &y AVerage(&x,&y,&z,...) Average (mean) of the arguments GReat(&x,&y,&z,...) The greatest argument (e.g., great(2,4,6) = 6) LEast(&x,&y,&z,...) The smallest argument (e.g., least(2,4,6) = 2) SQRT(&x) Square root of argument

&cat The category code of the break variable &clabel The label of the category code &name The name of each row variable &label The long label of each row variable

XXXXXX Whole number, no decimal points XXX.XX Number of decimal points specified XX,XXX Comma(s) inserted as needed (The comma can appear anywhere in the format) $X,XXX Dollar sign and comma(s) XXXXX% Percent sign put at the end of the number (XXXX) Parentheses put around the number (The number part of the format can be any of the above)

CCCCCC Centered text LLLLLL Left-justified text RRRRRR Right-justified text

BBBBBB Blank out the field (numeric or text) (used to blank out a field in a row or a total)

&DATE Current date, in form: July 15, 1993 &PAGE Page number within the report &NAME Name of the break variable &LABel Long label of the break variable &FILter Name of filter variable(s) and codes &WEIght Name of the weight variable &DATA Name of ascii data file(s) used as input &DDL Name of DDL file &a Name of variable referred to as ‘&a’ (if &a=age, the string ‘age’ will be substituted)

- &say message
- Display "message" on the screen. If no message is specified, a blank line is produced.
- &prompt
- Use a standard prompt to obtain data (can be used with any keyword or reference to a variable)
- &ask message
- Alternative to ‘&prompt’, if you want to customize the prompt for the user. Display "message," input a line of text, and pass the input to one of the keywords.

sreport | Basic information about SREPORT |

sreport batch | Commands for batch mode of SREPORT |

sreport examples | Examples of SREPORT command files |

DDL | Data Description Language |

CSM, UC Berkeley/ISA

August 25, 2015