To execute IDAMS programs,
the user prepares a special file called the "Setup" file which controls
the execution of the programs. This file contains IDAMS commands and
control statements necessary for execution such as: reference to
program to be executed, the names of files, the options to be selected
for the program and variable transformation instructions, e.g. These commands, which start
with a "$", separate the different kind of information being provided
for an IDAMS program execution. Available commands are: 3.1  Contents and Purpose
$RUN program name
$FILES
file specifications
$SETUP
program control statements
$RECODE
Recode statements
3.2  IDAMS Commands
| $RUN program | (name of program to be executed) |
| $FILES [RESET] | (signals start of file specifications) |
| $RECODE | (signals start of Recode statements) |
| $SETUP | (signals start of program control statements) |
| $DICT | (signals start of dictionary) |
| $DATA | (signals start of data) |
| $MATRIX | (signals start of a matrix) |
| (turns printing on and off) | |
| $COMMENT [text] | (comments) |
| $CHECK [n] | (checking if previous step terminated well). |
The first line in a Setup file must always be a $RUN command
identifying the IDAMS program to be executed. Other commands relating
to this program execution (followed by associated control statements
or data) can be placed in any order. These are then followed by the
$RUN command for the next program (if any) to be executed and so on.
The individual IDAMS commands are described below in alphabetical
order.
$CHECK [n]. If this command is present, the program will not be executed if the immediately preceding program terminated with a condition code greater than n. If the command is present, but no value is supplied, the value of n defaults to 1.
$DATA. The $DATA command signals that the data follow.
$MATRIX. The $MATRIX command signals that a matrix or set of matrices follows.
The names of the files to be used are given following the $FILES command and take the following format:
DATAIN = A:ECON.DAT RECL=92
PRINT = RSLTS.LST
FT02 = ECON.MAT
DICTIN = \\nec0102\commondata\econ.dic
For additional explanation, see section "Customization
of the Environment for an Application" in the "User Interface" chapter.
Example A. Perform multiple executions of an analysis program,
e.g. ONEWAY using the same data but with, for instance, different
filters.
IDAMS program control
statements (which follow the $SETUP command) are used to specify the
parameters for a particular execution. There are three standard control
statements used by all programs:
Purpose. A filter statement
is used to select a subset of data cases. It is expressed in terms
of variables and the values assumed by those variables. For example,
if variable V5 indicates "sex of respondent" in a survey and code
1 represents female, then "INCLUDE V5=1" is a filter statement which
specifies female respondents as the desired subset of cases. The
main filter selects cases from an input Data file and applies throughout
a program execution. These filters are available with all IDAMS programs
which input a dictionary (except BUILD and SORMER). Some programs
allow for additional subsetting. Such "local" filtering applies only
to a specific program action, e.g. one frequency table. Examples.
Rules for coding.
Purpose. A label statement
is used to title the results of a program execution. Some IDAMS programs
print this label once at the start of the results, while others use
it to title each page. Examples.
Rules for coding.
Purpose. All IDAMS
programs have been designed in a fairly general way, allowing the
user to select among several options. These options and values are
generated by parameters and are supplied on program control statements,
such as "parameters", "regression specifications", "table specifications",
etc. Parameters are specified by the user in a standard keyword format
with an English word or abbreviation being used to identify an option.
Examples. Presentation of
keyword parameters in the program write-ups. All write-ups have
a standard notation in the sections which describe the program parameters
which are available. The basic notation is as follows:
INFILE=IN /xxxx
A user might specify: INFILE=IN2
WEIGHT=variable
number
WEIGHT=V39
MAXCASES=n
MAXCASES=100
PRINT=(OUTDICT /OUTCDICT/NOOUTDICT,DATA)
A user
might specify: PRINT=(OUTC,DATA)
SAMPLE /POPULATION
Rules for coding.
Rules for specifying keywords
For example:
Details of most common parameters not described fully in each
program write-up.
BADDATA=STOP /SKIP/MD1/MD2
MAXCASES=n
MDVALUES=BOTH /MD1/MD2/NONE
INFILE=IN /xxxx
WEIGHT=variable number
VARS=(variable
list)
Rules for specifying variable lists
Examples: The IDAMS Recode facility
permits the temporary recoding of data during execution of IDAMS programs.
Results from such recoding operations (together with variables transferred
from the input file) can also be saved in permanent files using the
TRANS program. Recoding is invoked by the $RECODE command. This
command and the associated Recode statements are placed after the
$RUN command for the program with which the Recode facility is to
be used. For example:
3.4  Examples of Use of $ Commands and File Specifications
$RUN ONEWAY
$FILES
DICTIN = CHEESE.DIC
DATAIN = CHEESE.DAT
$SETUP
Filter 1
Other control statements for ONEWAY
$RUN ONEWAY
$SETUP
Filter 2
Other control statements for ONEWAY
Example B. Execute TABLES and ONEWAY, using the
same Dictionary and Data files for each and using the same Recode;
do not list the Recode statements.
$RUN TABLES
$FILES
DICTIN = ABC.DIC
DATAIN = ABC.DAT RECL=232
$SETUP
Control statements for TABLES
$RECODE
$PRINT
Recode statements
$RUN ONEWAY
$SETUP
Control statements for ONEWAY
$RECODE
$COMMENT THE RECODE STATEMENTS INPUT FOR TABLES WILL BE REUSED FOR ONEWAY
Example C. Execute TABLES using IDAMS Recode,
dictionary in the setup, data on diskette. Print the input dictionary.
$RUN TABLES
$FILES
DATAIN = A:MYDATA
$RECODE
Recode statements
$SETUP
Control statements for TABLES
$DICT
$PRINT
Dictionary
Example D. Use the output from a data management
program as input to analysis programs without retaining the output
file, e.g. execute TRANS followed by TABLES using the output data
from TRANS by specifying parameter INFILE=OUT. TABLES is not to be
executed if the TRANS has control statement errors.
$RUN TRANS
$FILES
DICTIN = MYDIC4
DATAIN = MYDAT4
$SETUP
Control statements for TRANS
$RECODE
Recode statements
$RUN TABLES
$CHECK
$SETUP
Control statements for TABLES including parameter INFILE=OUT
3.5  Program Control Statements
3.5.1  General Description
Additional program control statements required by individual programs
are described in the program write-up.
3.5.2  General Coding Rules
3.5.3  Filters
1. INCLUDE V2=1-5 AND V7=23,27,35 AND V8=1,2,3,6
2. EXCLUDE V10=2-3,6,8-9 AND V30=<5 OR V91=25
3. INCLUDE V50='FRAN','UK','MORO','INDI'
Placement. If a main filter is used, it is always
the first program control statement. Each program write-up indicates
whether "local" filters may also be used.
Note. The first statement following a $SETUP command is recognized
as a main filter if it starts with INCLUDE or EXCLUDE. If the first
non-blank characters are anything else, the statement is assumed to
be a label.
3.5.4  Labels
1. TABLES ON 1998 ELECTION DATA - JULY, 2000
2. PRINTING OF CORRECTED A34 SURVEY DATA
Placement. A label statement is required
by all IDAMS programs. The label is either the first or (if a filter
is used), the second program control statement. If no special labeling
is desired, it is still necessary to include a blank line.
3.5.5  Parameters
1. WRITE=CORR WEIGHT=V3, PRINT=(DICT, PAIR)
(PEARSON - parameters)
2. DEPV=V5 METHOD=STEP VARS=(R3-R9,V30) WRITE=RESID
(REGRESSN - regression parameters)
3. ROWV=(V3,V9,V10) COLV=(V4,V11,V19) CELLS=(FREQ,ROWPCT) STATS=(CHI,TAUA)
(TABLES - table description)
Placement. The main parameter statement is
required by all IDAMS programs and it must follow the label statement.
If all defaults are chosen, a line with a single asterisk must be
supplied. Each program write-up indicates the type and content of
any other parameter lists that are required and indicates their position
relative to other program control statements.
Types of keywords. There are 5 types of keywords used for
specifying parameters.
All keywords except the last type are followed by an equals sign.
The character, numeric, and keyword values that follow the equals
sign are called the "associated values".
VARS=(variable list)
A user might specify:
VARS=(32,1,10)
IDLOC=(s1,e1,s2,e2, ...)
A user might specify:
IDLOC=(1,3,7,9)
PRINT=NOOUTDICT
Rules for specifying associated values
Rules for specifying lists of keywords
R=(V2,3,5)
PRIN=(DICT,DATA,STAT)
MAXC=5
TRAN=(V5,V10-V25,V32)
IDLOC=(1,3,7,8)
FNAME='FRED', TRAN=3 KAISER
FNAME='FRED' -
TRAN=3 -
KAISER
OUTFILE=OUT /yyyy
VARS=(V1-V6, V9, V16, V20-V102, V18, V11, V209)
OUTVARS=(R104, V7, V10-V12, R100-R103, -
V16, V1)
CONVARS=V10
3.6  Recode Statements
$RUN program $RUN ONEWAY
$FILES $FILES
File definitions DICTIN=MYDIC
DATAIN=MYDAT
$RECODE $RECODE
Recode statements R10 = BRAC(V3,0-10=1,11-20=2)
R11 = SUM(V7,V8)
NAME R10 'EDUC LEVEL', R11'TOTAL INCOME'
$SETUP $SETUP
Program control statements INCOME BY EDUC,SEX
BADDATA=SKIP
CONVARS=(R10,V2) DEPVAR=R11
A complete description of the Recode facility is provided
in the "Recode Facility" chapter.