![]() | ||
| Database | ![]() ![]() ![]() ![]() | Data |
The normal way to run these interactively is from the Data - File Input menu. These can also be run as commands. The batch data input utilities are :
ADD REC which adds new records
if they do not exist;
EVICT REC which deletes
existing records;
REPLACE REC which replaces
existing records;
UPDATE REC which replaces
selected variables on existing records;
INPUT DATA which adds or
replaces records.
The FILE DUMP utility writes
data from a database to a sequential file in a format that can be used
by the data input utilities.
The FILE LIST utility writes
a report showing the data from a database to a sequential file in a format suitable for
printing.
You can also display and edit data through the SIR2002 SPREADSHEET utility which selects a set of data, displays it in a familiar spreadsheet style manner and allows you to update the data if necessary.
They all have the same possible five files:
FILES
Keywords - Use these to specify the particular processing
option(s) required:
Limits and Settings - Specify the keyword followed by an equals sign, "=" , followed
by the value for these limits and settings.
Example:
There are three groups of parameters. The first group specify files; the next group are keywords which are specified or not; the last group are 5 set limits or other conditions. Separate multiple parameters on a command with a slash "/".
FILES
Keywords - Use these to specify the particular processing option(s) required.
Limits and Settings - Specify the keyword followed by an equals sign, "=" , followed
by the value for these limits and settings.
Example:
There are three groups of parameters. The first group specifies files;
the second group are five keywords which are specified or not; the last
group are 7 set limits or other conditions.
Separate multiple parameters on a command with a slash "/".
FILES
Keywords - Use these to specify the particular processing
option(s) required.
Limits and Settings - Specify the keyword followed by an
equals sign, "=" , followed by the value for these limits and settings.
"N" is a number between 0.01 and 0.99. When data is reloaded or imported, blocks are filled. On susequent update runs, the normal value is 0.5, which means that a full data block is split in half. A value of .99 splits a data block with n records into one data block containing n-1 records and one data block containing 1 record. This is useful if records are added in keyfield order to keep the database file as compact as possible.
Example:
There are three groups of parameters. The first group specifies files;
the group is keywords which are specified or not; the last group are
limits or other conditions. Separate multiple parameters on a command with a slash "/".
FILES
Keywords - Use these to specify the particular
processing option(s) required.
Limits and Settings - Specify the keyword followed by an equals sign, "=" , followed
by the value for these limits and settings.
Example:
Replaces individual variables in existing records.
The keys of input records are matched against those already in the database. If
a match is found, the variables in the existing record are replaced by non-blank
fields in the input. If a match is not found, the input record is rejected with
an error message, or, if the
There are four special parameters for
There are three groups of parameters. The first group specifies files;
the second group consists of eight keywords which are specified or not;
the third group contains eight limits or other conditions.
Separate multiple parameters with a slash "/".
FILES
Keywords - Use these to specify the particular processing
option(s) required.
Limits and Settings - Specify the keyword followed by an equals sign, "=" , followed
by the value for these limits and settings.
Example:
Separate multiple parameters on the command with slashes.
eg (assuming the datemap for birthday is
eg (assuming the datemap for birthday is
In these cases it is best to convert the string to a number for the comparison:
DBA read security is required to use this utility.
eg (assuming the datemap for birthday is
eg (assuming the datemap for birthday is
In these cases it is best to convert the string to a number for the comparison:
For example:
Batch Data Input Specifications
The utilities all have a very similar specification.
ADD REC, READ INPUT DATA and
REPLACE REC have identical specifications.
EVICT REC has fewer options plus one particular keyword.
UPDATE REC has all the standard options
plus four additional parameters.SIR FILE DUMP
utility or by the VisualPQL procedure
WRITE RECORDS.
COL DESCRIPTION
-------------------------------
1-4 record number
5-6 message number
1 record number error
2 variable format error
3 variable/compute error
4 variable/recode error
5 ACCEPT REC failed
6 REJECT REC failed
7 record accepted with errors
8 record rejected
7-14 date of run
15-22 time of run
23-26 ordinal of record on this file
27-30 DBMS error number
31-38 variable name, if variable error
39-42 ACCEPT/REJECT REC num, line num
43-46 field starting column
47-50 field ending column
ADD REC
ADD REC adds new records to the database. The keys of incoming
records are matched against those already in the database. If an input record
matches an existing record, the incoming record is rejected with an error
message.
ADD REC INPUT = filename
[/LISTFILE = filename]
[/ERRFILE = filename]
[/LOGFILE = filename]
[/SUMFILE = filename]
[/ACCEPT]
[/ALL]
[/LOGALL]
[/NONEW]
[/NOSEQ]
[/ALIMIT = n]
[/BLIP = n]
[/LOADING = n]
[/RECTYPE = rectype]
[/RLIMIT = n]
[/SKIP = n]
[/STOP = n]
There are three groups of parameters. The first group specify files;
the next group are 5 keywords which are specified or not; the last group are
7 limits or other conditions. Separate multiple parameters on a command with a slash "/".INPUT
LISTFILE
ERRFILE
LISTFILE.LOGFILE
SUMFILE
SUMFILE and LISTFILE can be the same file in which
case the summary report is written after any error listing.ACCEPT
ALL
ERRFILE regardless of whether or not they are accepted into
the database.LOGALL
LOGFILE.NONEW
NOSEQ
ALIMIT = n
BLIP = n
LOADING = .n
RECTYPE = n | name
RECTYPE= keyword may be specified. If omitted, data
records are identified by the record number in the columns specified in the
schema.RLIMIT = n
SKIP = n
STOP = n
ADD REC INPUT = 'INPUT.DAT' /
ERRFILE = 'ERR.DAT' /
LOGFILE = 'LOG.LST' /
LISTFILE = 'OUT.LST' /
SUMFILE = 'SUM.LST'
ACCEPT / RECTYPE = 1
EVICT REC
EVICT REC INPUT = filename
[/LISTFILE = filename]
[/ERRFILE = filename]
[/LOGFILE = filename]
[/SUMFILE = filename]
[/LOGALL]
[/EVICTCIR]
[/BLIP = n]
[/RECTYPE = rectype]
[/RLIMIT = n]
[/SKIP = n]
[/STOP = n]
Deletes records. The keys of input records are matched against those already in the database. If an input record matches an existing record, the existing record is deleted. If an input record does not match an existing record, an error message is written.INPUT
LISTFILE
ERRFILE
LOGFILE
SUMFILE
SUMFILE and LISTFILE can be the same file in which
case the summary report is written after any error listing.LOGALL
LOGFILE.EVICTCIR
BLIP
RECTYPE
RECTYPE= can be specified. If omitted, data records
are identified by the record number in the columns specified in the schema.RLIMIT
SKIP
STOP
EVICT REC INPUT = 'INPUT.DAT' /
ERRFILE = 'ERR.DAT' /
LOGFILE = 'LOG.LST' /
LISTFILE = 'OUT.LST' /
SUMFILE = 'SUM.LST' /
RECTYPE = 1
READ INPUT DATA
READ INPUT DATA INPUT = filename
[/LISTFILE = filename]
[/ERRFILE = filename]
[/LOGFILE = filename]
[/SUMFILE = filename]
[/ACCEPT]
[/ALL]
[/LOGALL]
[/NONEW]
[/NOSEQ]
[/ALIMIT = n]
[/BLIP = n]
[/LOADING = n]
[/RECTYPE = rectype]
[/RLIMIT = n]
[/SKIP = n]
[/STOP = n]
Adds new records and modifies existing
records. The keys of incoming records are matched against those already in the
database. If an input record matches an existing record, the existing record is
updated; if the keys do not match, a new record is added.INPUT
LISTFILE
ERRFILE
LISTFILE.LOGFILE
SUMFILE
SUMFILE and LISTFILE can be the same file in which
case the summary report is written after any error listing.ACCEPT
ALL
ERRFILE regardless of whether or not they are accepted into
the database.LOGALL
LOGFILE.NONEW
NOSEQ
ALIMIT
BLIP
LOADING
RECTYPE
RECTYPE= keyword may be specified. If omitted, data records are identified by the record number in the columns specified in the schema.RLIMIT
SKIP
STOP
READ INPUT DATA INPUT = 'INPUT.DAT' /
ERRFILE = 'ERR.DAT' /
LOGFILE = 'LOG.LST' /
LISTFILE = 'OUT.LST' /
SUMFILE = 'SUM.LST' /
ACCEPT / RECTYPE = 1
REPLACE REC
REPLACE REC INPUT = filename
[/LISTFILE = filename]
[/ERRFILE = filename]
[/LOGFILE = filename]
[/SUMFILE = filename]
[/ACCEPT]
[/ALL]
[/LOGALL]
[/NONEW]
[/NOSEQ]
[/ALIMIT = n]
[/BLIP = n]
[/LOADING = n]
[/RECTYPE = rectype]
[/RLIMIT = n]
[/SKIP = n]
[/STOP = n]
Replaces existing records. The keys of input
records are matched against those already in the database. If an input record
does not match an existing record, it is rejected with an error message. If a
match is found, the existing record is replaced by the input record.INPUT
LISTFILE
ERRFILE
LISTFILE.LOGFILE
SUMFILE
SUMFILE and LISTFILE can be the same file in which
case the summary report is written after any error listing.ACCEPT
ALL
ERRFILE regardless of whether or not they are accepted into
the database.LOGALL
LOGFILE.NONEW
NOSEQ
ALIMIT
BLIP
LOADING
RECTYPE
RECTYPE= keyword may be specified. If omitted, data
records are identified by the record number in the columns specified in the
schema.RLIMIT
SKIP
STOP
REPLACE REC INPUT = 'INPUT.DAT' /
ERRFILE = 'ERR.DAT' /
LOGFILE = 'LOG.LST' /
LISTFILE = 'OUT.LST' /
SUMFILE = 'SUM.LST' /
ACCEPT / RECTYPE = 1
UPDATE REC
UPDATE REC INPUT = filename
[/LISTFILE = filename]
[/ERRFILE = filename]
[/LOGFILE = filename]
[/SUMFILE = filename]
[/ACCEPT] [/ALIMIT = n]
[/ADD] [/BLIP = n]
[/ALL] [/LOADING = n]
[/COMPUTE] [/MISSCHAR = a]
[/LOGALL] [/RECTYPE = rectype]
[/NOBOOL] [/RLIMIT = n]
[/NONEW] [/SKIP = n]
[/NOSEQ] [/STOP = n]
ADD keyword is specified, a new
record is created.UPDATE RECORD:ADD
COMPUTE
COMPUTE
statements. By default, COMPUTE statements from the Schema are
not re-executed.NOBOOL
ACCEPT REC IF and
REJECT REC IF) are performed. Any temporary variables
referenced in the consistency check must be respecified on the input record to
assure that the intent of the check is satisfied.MISSCHAR
UNDEFINED, include this single special character on the input
record in the leftmost column of the variable. A blank does not indicate a
missing value and may not be used as the special character.
There is no default.INPUT
LISTFILE
ERRFILE
LISTFILE.LOGFILE
SUMFILE
SUMFILE and LISTFILE can be the same file in which
case the summary report is written after any error listing.ACCEPT
ADD
ALL
ERRFILE regardless of whether or not they are accepted into
the database.COMPUTE
COMPUTE specifications in the
schema are re-executed.LOGALL
LOGFILE.NOBOOL
ACCEPT REC IF or REJECT
REC IF specifications in the schema are bypassed.NONEW
NOSEQ
ALIMIT
BLIP
LOADING
MISSCHAR
UNDEFINED. When this character is in the leftmost position of a variable on input, the variable on the database is set to undefined. Specify a single character, do not enclose it in quotes.RECTYPE
RECTYPE= keyword may be specified. If omitted, data
records are identified by the record number in the columns specified in the
schema.RLIMIT
SKIP
STOP
UPDATE REC INPUT = 'INPUT.DAT' /
ERRFILE = 'ERR.DAT' /
LOGFILE = 'LOG.LST' /
LISTFILE = 'OUT.LST' /
SUMFILE = 'SUM.LST' /
ACCEPT /
RECTYPE = 1 /
MISSCHAR = *
SIR FILE DUMP
SIR FILE DUMP [FILENAME = fileid]
RECTYPES = {ALL | rectype (log_expr), ...}
[BOOLEAN = (log_expr)]
[SAMPLE = fraction [,seed]]
[COUNT = total [,increment[,start]]]
[LIST = case id list]
[UNDEFINED = char]
Creates a sequential text file in a form suitable for processing by the batch
data input utilities. DBA read security clearance is needed to use this utility.FILENAME
RECTYPES
ALL specifies all record types are dumped. A logical
expression can be specified to restrict the data records selected. The
expression can reference common variables or variables from the listed record
type and can include PQL functions.BOOLEAN
BOOLEAN is applied after any
SAMPLE, COUNT or LIST.Caution
When comparing dates, times or catvars with strings remember that the variable
is converted to a string using its default format then compared with the string.DDIMMIYYYY):
RECTYPES = EMPLOYEE (BIRTHDAY lt '01 01 1960')/
is a
comparision of strings and the string '02 12 1920' is greater than the
string '01 01 1960'.YYYYIMMIDD):
RECTYPES = EMPLOYEE (BIRTHDAY lt '01 01 1960')/
will compare
strings like '1960 12 31' with '1960/01/31'. The former is less than the later
because the character ' '(blank) has a lower ascii value to the slash.
RECTYPES = EMPLOYEE (BIRTHDAY lt CDATE('1960/01/31','YYYYIMMIDD'))/
SAMPLE
COUNT
SAMPLE or LIST. Total specifies the number
of cases to retrieve. Increment specifies the "skipping factor" for retrieving
cases. Start specifies the first case to select. For example, a start value of 3
begins the processing at the third case.
SIR FILE DUMP FILENAME = 'OUTPUT.DAT'/
RECTYPES = ALL / COUNT = 10
LIST
LIST cannot be used with SAMPLE or
COUNT. For example:
SIR FILE DUMP FILENAME = 'OUTPUT.DAT'/
RECTYPES = ALL / LIST = 1,3,5 thru 10
UNDEFINED
SIR FILE DUMP FILENAME = 'OUTPUT.DAT' /
RECTYPES = 1 (SALARY GT 2000)/
UNDEFINED = *
SIR FILE LIST
SIR FILE LIST FILENAME=filename
[/BOOLEAN= (log-expr)]
[/LIST= caseid list]
[/RECTYPES= rectype [(log-expr)] ...| ALL]
[/ORDER= ALPHA | VARNUM]
[/SAMPLE= fraction [,seed]]
[/COUNT= total [,incr[,start]]]
[/CIR= varlist | NOCIR]
[/VARIABLES = rectype (var-list)]
Writes all or part of the data to a file for subsequent printing. Use the special filenames CONSOL to write to the screen or STDOUT to write to the default output file.
Sample Output:
BOOLEAN
LIST, COUNT or SAMPLE is used, the
BOOLEAN clause is applied after that selection process.
For example:
BOOLEAN = (ID GT 5)
LIST
LIST cannot be used with
SAMPLE or COUNT. For example:
LIST= 1,3,5,7 to 10
RECTYPES
RECTYPES= ALL specifies all record types.
If RECTYPES is omitted from the command,
only the common variables are listed. A logical expression may be defined to
select particular data records within a record type. If the test is TRUE,
the record is listed. The expression may use common or record variables from the
record type. For example:
RECTYPES= 1 (GENDER=2)
Caution
When comparing dates, times or catvars with strings remember that the variable
is converted to a string using its default format then compared with the string.DDIMMIYYYY):
RECTYPES = EMPLOYEE (BIRTHDAY lt '01 01 1960')/
is a
comparision of strings and the string '02 12 1920' is greater than the
string '01 01 1960'.YYYYIMMIDD):
RECTYPES = EMPLOYEE (BIRTHDAY lt '01 01 1960')/
will compare
strings like '1960 12 31' with '1960/01/31'. The former is less than the later
because the character ' '(blank) has a lower ascii value to the slash.
RECTYPES = EMPLOYEE (BIRTHDAY lt CDATE('1960/01/31','YYYYIMMIDD'))/
ORDER
ALPHA) of the variable name or the order the
variables are defined in the record (VARNUM).
VARNUM is the default. For example:
SIR FILE LIST FILENAME=DATA.LIS / ORDER= ALPHA
SAMPLE
SAMPLE cannot be used with COUNT
or LIST. For example:
SIR FILE LIST FILENAME=DATA.LIS / SAMPLE= .5
COUNT
COUNT cannot be used with
SAMPLE or LIST. For example:
SIR FILE LIST FILENAME=DATA.LIS / COUNT= 50,3,3
CIR
CIR
clause is omitted, all common variables are listed. For example:
SIR FILE LIST FILENAME=DATA.LIS / CIR= ID
NOCIR
SIR FILE LIST FILENAME=DATA.LIS / NOCIR
VARIABLES
SIR FILE LIST FILENAME=DATA.LIS / RECTYPE = 2/
VARIABLES = 2 (jobcode,revdate)
SIR FILE LIST 09/27/99 10:39:14 Page 1
*** CASE ID. ID 1
--------------------------------------------------------------
*** RECORD TYPE. 1 (EMPLOYEE)
*** RECORD VARIABLES. NAME John D Jones
GENDER 1
MARSTAT 1 SSN 772-21-1321
BIRTHDAY 01 15 38 EDUC 1
NDEPENDS **************** CURRPOS 5
SALARY 2150 CURRDATE 02 10 82
----------------------------------------------------------
*** RECORD TYPE. 2 (OCCUP )
*** SORT VARIABLES. POSITION 4
*** RECORD VARIABLES. POSITION 4
STARTDAT 02 10 80 STARTSAL 1500
DIVISION
SIR SPREADSHEET
SIR SPREADSHEET
{RECTYPE = recname [BOOLEAN = (log-expr)] | TABLE=tabfile.table}
[INDEXED BY indexname]
[VARIABLES = (var1,var2,... | ALL)]
[LABELS|UPDATE]
Selects data from a single database record type or from a tabfile table and displays it in a graphical form similar to a spreadsheet display. The user can insert, delete or update if allowed, and can print or export the data in a CSV format for input to other packages.
RECTYPE =
BOOLEAN may be specified to select which records to include in the list. The test may use common variables or record variables.TABLE =
INDEXED BY (USING is a synonym)
VARIABLES
ALL is the default.LABELS (VALLAB is a synonym)
UPDATEUPDATE
SIR SPREADSHEET RECTYPE=EMPLOYEE / UPDATE
The record data is displayed as a spreadsheet which looks something like:



