Database homecontents start chapter top of pagebottom of pagenext page indexData

Batch Data Input Utilities

There are five batch data input utilities which provide a quick and efficient way to add or update data in the database from external sequential files.

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 :

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.


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.

They all have the same possible five files:

Input data
Contains the input data. The format of the data file is specified in the description of the record schema. A file in this format can be produced from an existing database by the SIR FILE DUMP utility or by the VisualPQL procedure WRITE RECORDS.

Error Listing
A report of any errors.

Error Records
A copy of any data records with errors in the same format as the input file. (This could be re input with an /ACCEPT or other option.)

Summary
Update summary report.

Log
A fixed format that describes any errors. Each record contains the following:
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 "/".

FILES

INPUT
Specifies the input file or data file. Must be specified.

LISTFILE
Specifies the file where error messages are written. If not specified, the current output file is used for error messages.

ERRFILE
Specifies the file where data records with errors are written. If not specified, no error file is produced, however errors messages are produced on the LISTFILE.

LOGFILE
Specifies the log file. A record is written to the log file in fixed format that describes each error.

SUMFILE
Specifies the file where the update summary report is written. If this is not specified the current output file is used. SUMFILE and LISTFILE can be the same file in which case the summary report is written after any error listing.

Keywords - Use these to specify the particular processing option(s) required:

ACCEPT
Specifies that records with erroneous values are accepted and variables with erroneous values are set to undefined. If not specified, records with erroneous values are rejected.

ALL
Specifies that input records with errors are written to the ERRFILE regardless of whether or not they are accepted into the database.

LOGALL
Specifies that input records with errors are written with the log record to the LOGFILE.

NONEW
Specifies that no new cases are created.

NOSEQ
Specifies that no sequence checking is performed regardless of definitions in the schema. Sequence checking determines if each line of the input record matches the specifications in the record schema.

Limits and Settings - Specify the keyword followed by an equals sign, "=" , followed by the value for these limits and settings.

ALIMIT = n
Sets a limit on the number of input records with errors. Terminates the procedure when "n" number of records have been processed with undefined values replacing errors.

BLIP = n
Specifies that an indication of progress is required and the approximate number of records expected on the input file. Progress is shown as a percentage of this number. Statistics of records added are displayed.

LOADING = .n
Specifies how data blocks are split as they become full. "N" is a number between 0.01 and 0.99. When data is reloaded or imported, blocks are filled. 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.

RECTYPE = n | name
Specifies that all the records in this run are of the given type. Rectype may be a record name or number. This is used when the data record does not contain a record type number or to override the number on the input record. Only one RECTYPE= keyword may be specified. If omitted, data records are identified by the record number in the columns specified in the schema.

RLIMIT = n
Specifies that the run stops if "n" number of records are rejected due to errors.
SKIP = n
Specifies that the first "n" lines on the data input file are skipped before starting to process the data. Processing begins at line "n" + 1.

STOP = n
Stops the run after processing "n" lines from the data input file. If the data is in multi-line records, the entire record is always processed.

Example:

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.

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

INPUT
Specifies the input file or data file. Must be specified.

LISTFILE
Specifies the file where error messages are written. If not specified, the current output file is used for error messages.

ERRFILE
Specifies the file where data records with errors are written. If not specified, no error file is produced, however errors messages are produced on the LISTFILE.

LOGFILE
Specifies the log file. A record is written to the log file in fixed format that describes each error.

SUMFILE
Specifies the file where the update summary report is written. If this is not specified the current output file is used. SUMFILE and LISTFILE can be the same file in which case the summary report is written after any error listing.

Keywords - Use these to specify the particular processing option(s) required.

LOGALL
Specifies that input records with errors are written with the log record to the LOGFILE.

EVICTCIR
Specifies that cases are deleted if all records in the case are deleted. This only applies to case structured databases.

Limits and Settings - Specify the keyword followed by an equals sign, "=" , followed by the value for these limits and settings.

BLIP
Specifies that an indication of progress is required and the approximate number of records expected on the input file. Progress is shown as a percentage of this number. Statistics of records added are displayed.

RECTYPE
Specifies that all the records in this run are of the given type. Rectype may be a record name or number. This is used when the data record does not contain a record type number or to override the number on the input record. Only one RECTYPE= can be specified. If omitted, data records are identified by the record number in the columns specified in the schema.

RLIMIT
Specifies that the run stops if "n" number of records are rejected due to errors.

SKIP
Specifies that the first "n" lines on the data input file are skipped before starting to process the data. Processing begins at line "n" + 1.

STOP
Stops the run after processing "n" lines from the data input file. If the data is in multi-line records, the entire record is always processed.

Example:

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.

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

INPUT
Specifies the input file or data file. Must be specified.

LISTFILE
Specifies the file where error messages are written. If not specified, the current output file is used for error messages.

ERRFILE
Specifies the file where data records with errors are written. If not specified, no error file is produced, however errors messages are produced on the LISTFILE.

LOGFILE
Specifies the log file. A record is written to the log file in fixed format that describes each error.

SUMFILE
Specifies the file where the update summary report is written. If this is not specified the current output file is used. SUMFILE and LISTFILE can be the same file in which case the summary report is written after any error listing.

Keywords - Use these to specify the particular processing option(s) required.

ACCEPT
Specifies that records with erroneous values are accepted and variables with erroneous values are set to undefined. If not specified, records with erroneous values are rejected.

ALL
Specifies that input records with errors are written to the ERRFILE regardless of whether or not they are accepted into the database.

LOGALL
Specifies that input records with errors are written with the log record to the LOGFILE.

NONEW
Specifies that no new cases are created.

NOSEQ
Specifies that no sequence checking is performed regardless of definitions in the schema. Sequence checking determines if each line of the input record matches the specifications in the record schema.

Limits and Settings - Specify the keyword followed by an equals sign, "=" , followed by the value for these limits and settings.

ALIMIT
Sets a limit on the number of input records with errors. Terminates the procedure when "n" number of records have been processed with undefined values replacing errors.

BLIP
Specifies that an indication of progress is required and the approximate number of records expected on the input file. Progress is shown as a percentage of this number. Statistics of records added are displayed.

LOADING
Specifies when data blocks are split as they become full.

"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.

RECTYPE
Specifies that all the records in this run are of the given type. Rectype may be a record name or number. This is used when the data record does not contain a record type number or to override the number on the input record. Only one RECTYPE= keyword may be specified. If omitted, data records are identified by the record number in the columns specified in the schema.

RLIMIT
Specifies that the run stops if "n" number of records are rejected due to errors.

SKIP
Specifies that the first "n" lines on the data input file are skipped before starting to process the data. Processing begins at line "n" + 1.

STOP
Stops the run after processing "n" lines from the data input file. If the data is in multi-line records, the entire record is always processed.

Example:

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.

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

INPUT
Specifies the input file or data file. Must be specified.

LISTFILE
Specifies the file where error messages are written. If not specified, the current output file is used for error messages.

ERRFILE
Specifies the file where data records with errors are written. If not specified, no error file is produced, however errors messages are produced on the LISTFILE.

LOGFILE
Specifies the log file. A record is written to the log file in fixed format that describes each error.

SUMFILE
Specifies the file where the update summary report is written. If this is not specified the current output file is used. SUMFILE and LISTFILE can be the same file in which case the summary report is written after any error listing.

Keywords - Use these to specify the particular processing option(s) required.

ACCEPT
Specifies that records with erroneous values are accepted and variables with erroneous values are set to undefined. If not specified, records with erroneous values are rejected.

ALL
Specifies that input records with errors are written to the ERRFILE regardless of whether or not they are accepted into the database.

LOGALL
Specifies that input records with errors are written with the log record to the LOGFILE.

NONEW
Specifies that no new cases are created.

NOSEQ
Specifies that no sequence checking is performed regardless of definitions in the schema. Sequence checking determines if each line of the input record matches the specifications in the record schema.

Limits and Settings - Specify the keyword followed by an equals sign, "=" , followed by the value for these limits and settings.

ALIMIT
Sets a limit on the number of input records with errors. Terminates the procedure when "n" number of records have been processed with undefined values replacing errors.

BLIP
Specifies that an indication of progress is required and the approximate number of records expected on the input file. Progress is shown as a percentage of this number. Statistics of records added are displayed.

LOADING
Specifies how data blocks are split as they become full. "N" is a number between 0.01 and 0.99. When data is reloaded or imported, blocks are filled. 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 data as compact as possible.

RECTYPE
Specifies that all the records in this run are of the given type. Rectype may be a record name or number. This is used when the data record does not contain a record type number or to override the number on the input record. Only one RECTYPE= keyword may be specified. If omitted, data records are identified by the record number in the columns specified in the schema.

RLIMIT
Specifies that the run stops if "n" number of records are rejected due to errors.

SKIP
Specifies that the first "n" lines on the data input file are skipped before starting to process the data. Processing begins at line "n" + 1.

STOP
Stops the run after processing "n" lines from the data input file. If the data is in multi-line records, the entire record is always processed.

Example:

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]

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 ADD keyword is specified, a new record is created.

There are four special parameters for UPDATE RECORD:

ADD
Specify to add new records. By default, input records must match existing records in the database.

COMPUTE
Specify to re-execute schema COMPUTE statements. By default, COMPUTE statements from the Schema are not re-executed.

NOBOOL
Specify to stop the re-execution of consistency checks from the Schema. By default, consistency checks (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
Specify a single, special character to indicate that an existing variable is set to undefined. In order to set an existing value to 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.

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

INPUT
Specifies the input file. Must be specified.

LISTFILE
Specifies the file where error messages are written. If not specified, the current output file is used for error messages.

ERRFILE
Specifies the file where data records with errors are written. If not specified, no error file is produced, however errors messages are produced on the LISTFILE.

LOGFILE
Specifies the log file. A record is written to the log file in fixed format that describes each error.

SUMFILE
Specifies the file where the update summary report is written. If this is not specified the current output file is used. SUMFILE and LISTFILE can be the same file in which case the summary report is written after any error listing.

Keywords - Use these to specify the particular processing option(s) required.

ACCEPT
Specifies that records with erroneous values are accepted and variables with erroneous values are set to undefined. If not specified, records with erroneous values are rejected.

ADD
Specifies that input records which do not match existing records are added to the database. Schema defined consistency checks and compute specifications are applied to the added records.

ALL
Specifies that input records with errors are written to the ERRFILE regardless of whether or not they are accepted into the database.

COMPUTE
Specifies that any COMPUTE specifications in the schema are re-executed.

LOGALL
Specifies that input records with errors are written with the log record to the LOGFILE.

NOBOOL
Specifies that any ACCEPT REC IF or REJECT REC IF specifications in the schema are bypassed.

NONEW
Specifies that no new cases are created.

NOSEQ
Specifies that no sequence checking is performed regardless of definitions in the schema. Sequence checking determines if each line of the input record matches the specifications in the record schema.

Limits and Settings - Specify the keyword followed by an equals sign, "=" , followed by the value for these limits and settings.

ALIMIT
Sets a limit on the number of input records with errors. Terminates the procedure when "n" number of records have been processed with undefined values replacing errors.

BLIP
Specifies that an indication of progress is required and the approximate number of records expected on the input file. Progress is shown as a percentage of this number. Statistics of records added are displayed.

LOADING
Specifies how data blocks are split as they become full. "N" is a number between 0.01 and 0.99. When data is reloaded or imported, blocks are filled. 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.

MISSCHAR
Specifies a character to indicate that the field is set to 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
Specifies that all the records in this run are of the given type. Rectype may be a record name or number. This is used when the data record does not contain a record type number or to override the number on the input record. Only one RECTYPE= keyword may be specified. If omitted, data records are identified by the record number in the columns specified in the schema.

RLIMIT
Specifies that the run stops if "n" number of records are rejected due to errors.

SKIP
Specifies that the first "n" lines on the data input file are skipped before starting to process the data. Processing begins at line "n" + 1.

STOP
Stops the run after processing "n" lines from the data input file. If the data is in multi-line records, the entire record is always processed.

Example:

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.

Separate multiple parameters on the command with slashes.

FILENAME
Specifies the name of the output file. If this clause is not specified, the output is written to the default output file (normally the scrolled output buffer in interactive sessions).

RECTYPES
Specifies the record types to dump. This clause is required. The keyword 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
Defines a logical condition applied to common variables. This clause only applies to case structured databases. If the logical condition is true, records for that case are dumped. 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.

eg (assuming the datemap for birthday is 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'.

eg (assuming the datemap for birthday is 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.

In these cases it is best to convert the string to a number for the comparison:
RECTYPES = EMPLOYEE (BIRTHDAY lt CDATE('1960/01/31','YYYYIMMIDD'))/

SAMPLE
Outputs data from a random sample of cases from the database. This clause only applies to case structured databases. Fraction specifies the sample size for selection. Seed specifies the starting seed for the random number generator. If seed is not specified, the default is used.

COUNT
Outputs data from a specified number of cases from the database. This clause only applies to case structured databases and cannot be used with 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
Retrieves the specified cases for case structured databases. Enclose case identifiers that are character strings in quotes. 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
Specifies the character used to fill fields on output which are undefined on the database. Blanks are the default. For example:
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.

DBA read security is required to use this utility.

BOOLEAN
Specifies which cases to include in the list. If the test fails, no records for that case are listed. The test may only use common variables. If LIST, COUNT or SAMPLE is used, the BOOLEAN clause is applied after that selection process. For example:
BOOLEAN = (ID GT 5)
LIST
Specifies which case ids to select. Separate entries with blanks or commas. Use the "TO" format to specify a range. Enclose case ids that are strings in quotes. LIST cannot be used with SAMPLE or COUNT. For example:
LIST= 1,3,5,7 to 10
RECTYPES
Specifies the record types to select. 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.

eg (assuming the datemap for birthday is 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'.

eg (assuming the datemap for birthday is 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.

In these cases it is best to convert the string to a number for the comparison:
RECTYPES = EMPLOYEE (BIRTHDAY lt CDATE('1960/01/31','YYYYIMMIDD'))/

ORDER
Specifies the sequence of the listing of variables. This can be alphabetic 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
Retrieves a random sample of cases from case-structured databases. Fraction specifies the sample size for selection. Seed specifies the starting seed for the random number generator. If seed is not specified, one is assigned by default. SAMPLE cannot be used with COUNT or LIST. For example:
SIR FILE LIST FILENAME=DATA.LIS / SAMPLE= .5
COUNT
Retrieves a subset of cases from the database. Total specifies the number of cases to retrieve. Incr is the increment to apply to locate the next case to process. The default is 1 and processes every case. An increment of 2 processes every other case, 3 every third case, etc. Start specifies the ordinal of the first case to process. For example, a start value of 3 and an Incr of 3 starts the processing with the third case, skips cases 4 and 5 and processes 6. COUNT cannot be used with SAMPLE or LIST. For example:
SIR FILE LIST FILENAME=DATA.LIS / COUNT= 50,3,3
CIR
Specifies the common variables to list. If the CIR clause is omitted, all common variables are listed. For example:
SIR FILE LIST FILENAME=DATA.LIS / CIR= ID
NOCIR
Suppresses output of CIR variables. For example:
SIR FILE LIST FILENAME=DATA.LIS /  NOCIR
VARIABLES
Specifies the variables to list for a record type. All variables are listed for selected record types as the default. For example:
SIR FILE LIST FILENAME=DATA.LIS / RECTYPE = 2/
    VARIABLES = 2 (jobcode,revdate)
Sample Output:
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 =
Specifies the record name or number to display. BOOLEAN may be specified to select which records to include in the list. The test may use common variables or record variables.

TABLE =
Specifies the tabfile name and table name to display.

INDEXED BY (USING is a synonym)
Specifies that the record or table is accessed via the named index. When using an index with a record, all the variables used in the index must be included in the displayed variables.

VARIABLES
Specifies the variables to list. ALL is the default.

LABELS (VALLAB is a synonym)
Specifies that value labels are displayed where these exist as opposed to actual values. This precludes UPDATE

UPDATE
Specifies that updates to the database or table are allowed. This allows the user to add, delete or modify the data in the record or table. For update, the selected variables must included all key fields.

For example:

SIR SPREADSHEET RECTYPE=EMPLOYEE / UPDATE
The record data is displayed as a spreadsheet which looks something like:

homecontents start chapter top of pagebottom of pagenext page index