Resources

Home   News   Version 1   Tech Support   Pubs   S2K Site Map



SYSTEM 2000 Quick Reference Guide DEFINE Language Commands



CHANGE component

Changes the number, name, or description (or any combination) of a component.

Syntax

CHANGE old-number TO new-number :

CHANGE old-number TO |new-number * new-name :
                    |old-number

CHANGE old-number TO |new-number * |new-name (new-description) :
                    |old-number    |old-name
old-number
is the number of an existing component, without the C.

new-number
is a new number for a component, without the C. It can be from 1 to 9999, and it cannot duplicate any existing number.

new-name
is a new name for a component using 1 to 250 characters. It cannot duplicate any existing name, and it cannot contain reserved words or characters. See Reserved Words and Characters in Appendices .

old-name
is the name of an existing component.

new-description
defines a new description for a component. Changes to record inclusion are not allowed. You must specify either a new name or the old name when specifying a new description.

Examples

CHANGE 400 TO 500:

CHANGE 0 TO 0*EMPLOYEE:

CH 201 TO 210*SKILLS (CHAR X(24) IN 200 WITH MANY FUTURE
   OCCURRENCES):

CHANGE 2000 TO 2000*FUNA(FUNCTION $((COUNT C600)/*1*)$):

Rules

Back to Top of Page


DELETE

Deletes components and their data from a database definition.

Syntax

DELETE |COMPONENTS        number |[, number] ...   :
       |SCHEMA COMPONENTS        |[THROUGH number]
       |STRINGS
       |FUNCTIONS
number
is the number of an existing component, without the C.

Examples

DELETE COMPONENT 100:

DELETE COMPONENTS 410, 408, 412:

DELETE STRING 4000:

DELETE COMPONENTS 600 THRU 605:

Rules

Back to Top of Page


ENABLE/DISABLE EXECUTION

Allows the scanning of commands while allowing or preventing the execution of those commands.

Syntax

|ENABLE  EXECUTION  :
|DISABLE

Examples

ENABLE EXECUTION:

DISABLE EXECUTION:

Rules

Back to Top of Page


Function Definition

A function stores an arithmetic expression. Specify the component number and name and arithmetic expression, using the syntax below. This type of function is referred to as a stored function.

Syntax

number * name |[DECIMAL] FUNCTION delimiter (expression) delimiter) :
             |[INTEGER]
             |[MONEY]
             |[REAL]
             |[DOUBLE]
             |
number
is a component number from 1 to 9999.

name
is a component name using 1 to 250 characters. It cannot be a reserved word or character or the current system separator. See Reserved Words and Characters in Appendices .

DECIMAL

INTEGER

MONEY

REAL

DOUBLE

DATE
specifies the function type. The default is DECIMAL.

delimiter
is a single special character to be used as the expression delimiter. The delimiter must appear at both ends of the function expression and cannot appear within the expression. It cannot be the current system separator or command terminator. See Special Characters in Appendices .

expression
defines an arithmetic expression containing one or more item names or component numbers, constants, system functions (AVG, COUNT, MAX, MIN, SUM, SIGMA), arithmetic operators (+, -, *, /), other functions or strings, the system string *FTODAY*, parameters, parenthetical arithmetic expressions, or Collect File items called by retrieval commands.

Examples

3004* YRS EMPLOYED (INTEGER FUNCTION
     $ ((END DATE-START DATE)/365.25)$):

3050* DEDUCTION-ADJ (MONEY FUNCTION/(C114 - 5.50)/):

Rules

Back to Top of Page


Item Definition

A schema item represents a class of values. You specify the component number and name, key status, item type, item picture, record membership, and padding, using the following syntax.

Syntax

number * name ([NON-KEY] |CHARACTER [picture] [IN sr-number]
                        |TEXT
                        |UNDEFINED
                        |INTEGER
                        |DECIMAL
                        |MONEY
                        |REAL
                        |DOUBLE
                        |DATE

     [WITH |NO  FUTURE OCCURRENCES]) :
           |FEW
           |SOME
           |MANY
number
is a component number from 1 to 9999.

name
is a component name using 1 to 250 characters. It cannot be a reserved word or character or the current system separator. See Reserved Words and Characters in Appendices .

NON-KEY
specifies non-key processing. The default is KEY.

picture
is the picture for data to be entered.
CHARACTER default is X(7) with a maximum of 250.
TEXT default is X(7) with a maximum of 250.
UNDEFINED default is X(4) with a maximum of 250; no overflow.
INTEGER default is 9(7) with a maximum of 15.
DECIMAL default is 9(6).9(2).
MONEY default is 9(6).9(2) and can be preceded by $.
REAL never needs a specified picture.
DOUBLE never needs a specified picture.
DATE never needs a specified picture.
Note: For DECIMAL and MONEY items, if the picture is of the format 9(n).9(m), then n and m must each be greater than or equal to zero and less than 11. Their sum must be a positive integer less than 16.

sr-number
is the record component number (previously defined) that the new item belongs to. Do not include the C. The default is 0.

NO

FEW

SOME

MANY
specifies future occurrences for padding. The default is NO.

Examples

1* EMPLOYEE NUMBER (INTEGER NUMBER 9999):

2* LAST NAME (CHAR X(20) WITH FEW FUTURE OCCURRENCES):

4* HIRE DATE (DATE):

11* ACCRUED VACATION (NON-KEY DECIMAL NUMBER 999.99):

303* COMMENT (NON-KEY TEXT X(15) IN 300):

124* GROSS PAY (NON-KEY MONEY $9(4).9(2) IN 120):

511* SAMPLE (UNDEF X(12) IN 500):

513* FPS (NON-KEY REAL IN 500):

514* FPD (DOUBLE IN 500):

Rules

Back to Top of Page


MAP

Processes DEFINE commands and places the results in the database definition.

Syntax

MAP [[ordering-clause] where-clause] :
ordering-clause
specifies the order of selected data records. Use only level 0 items. A where-clause is required if an ordering-clause is specified. See Ordering-Clause in QUEST.

where-clause
selects specific data records. The SAME operator cannot be included. See Where-Clause in QUEST.

Examples

MAP:

MAP WHERE HIRE DATE GT 01/15/90:

MAP ORDERED BY LAST NAME WHERE HIRE DATE GT 01/15/90:

Rules

Back to Top of Page


Record Definition

A schema record represents a class of data records. You specify the component number and name and the parent-child relationships between records, using the following syntax.

Syntax

number * name (SCHEMA RECORD [IN sr-number]) :
number
is a component number from 1 to 9999.

name
is a component name using 1 to 250 characters. It cannot be a reserved word or character or the current system separator. See Reserved Words and Characters in Appendices .

sr-number
is the record component number (previously defined) that the new record belongs to. Do not include the C. The default is 0.

Examples

100* POSITION WITHIN COMPANY (RECORD):

110* SALARY WITHIN POSITION (RECORD IN 100):

130* ADDITIONAL INFORMATION (SR IN 100):

Rules

Back to Top of Page


RENUMBER

Renumbers components in a database definition.

Syntax

RENUMBER [STARTING WITH number [INCREMENTING BY n]] :
number
is a positive number from 1 to 9999 to be assigned to the first component in DESCRIBE order after C0. The default is 1.

n
specifies the increment for renumbering. It can be a number from 1 to 9999. You cannot use 0, and the default is 1.

Examples

RENUMBER:

RENUMBER STARTING WITH 100:

RENUMBER STARTING WITH 100 INCREMENTING BY 10:

Rules

Back to Top of Page


STOP AFTER SCAN IF ERRORS OCCUR

Prevents mapping of DEFINE commands if errors occur. You can then edit the commands to correct errors. If no errors are encountered, mapping occurs.

Syntax

STOP AFTER SCAN IF ERRORS OCCUR :

Example

STOP AFTER SCAN IF ERRORS OCCUR:

Rules

Back to Top of Page


String Definition

A string stores a SYSTEM 2000 command, one part of a command, or a series of commands. Specify the component number and name and command stream, using the syntax below. Strings are sometimes referred to as stored strings.

Syntax

number * name (STRING delimiter command-stream delimiter) :
number
is a component number from 1 to 9999.

name
is a component name using 1 to 250 characters. It cannot be a reserved word or character or the current system separator. See Reserved Words and Characters in Appendices .

delimiter
is a single special character to be used as the command stream delimiter. The delimiter must appear at both ends of the command stream and cannot appear within the command stream. It cannot be the current system separator or command terminator. See Special Characters in Appendices .

command-stream
defines a SYSTEM 2000 command stream using 1 to 250 characters. The command stream can consist of partial commands, one command, or several commands. It also can contain parameters, calls to other strings or functions, or system strings (*NOW*, *FTODAY*, *TODAY*, *DATA*).

Examples

1100* EMP-NO (STRING / PRINT C1: /):

1000* LIST OF DATES (STRING $ LIST C1, C4, OB C4
     WH HIRE DATE GT 01/01/91: $):

1050* LATEST POSITION (STRING $ C101 EXISTS AT 1 $):

Rules

Back to Top of Page