DEFINE command

From m204wiki
Revision as of 23:09, 10 July 2014 by JAL (talk | contribs)
Jump to navigation Jump to search

Function
Defines a Model 204 entity

The DEFINE command performs the following functions:

CommandSpecifies...
DEFINE DATASET Physical characteristics of a data set, file, or template, or identifies non-Model 204 files.
DEFINE FIELD Field names and attributes.
DEFINE FILE File synonym.
DEFINE LINK Defines a network connection (used for Model 204 intersystem connections).
DEFINE PRINTER Output definition to direct printed output.
DEFINE PROCESS Process for reference by User Language statements, and the attributes of the process (used for Model 204 intersystem connections).
DEFINE PROCESSGROUP Processgroup (used for Model 204 intersystem connections).
DEFINE PUNCH Output definition to direct punched output.
DEFINE REMOTE Remote LU (used for Horizon CNOS connections).
DEFINE SESSIONGROUP Sessiongroup (used for Horizon CNOS connections).
DEFINE STREAM Sequential I/O streams.

General format of the DEFINE command

The syntax of the DEFINE command is as follows:

DEFINE {DATASET | FIELD | FILE | LINK | PRINTER | PROCESS | PROCESSGROUP | PUNCH | REMOTE | SESSIONGROUP | STREAM} name [LIKE previousname] [WITH SCOPE=SYSTEM] [options [options]...]

Where:

name is the Model 204 name of the entity defined. The name in a data set, link, printer, process, processgroup, punch, or stream definition can be up to 8 characters in length. Field names can be up to 255 characters in length.
LIKE gives the entity that you are currently defining the attributes of a previously defined entity or template specified by the phrase LIKE previousname. LIKE is not supported for field definitions.
previousname means the name of the previously defined entity or template.

Used by itself, LIKE copies all the attributes of the entity defined by a previous DEFINE command. When used with WITH, the options listed in the WITH phrase override the attributes of the entity specified by the LIKE phrase.

SCOPE=SYSTEM is required and indicates that the definition is available to all users for the entire run.
options for the particular forms of the DEFINE command are described in sections that follow. Options must be separated by commas or by one or more blanks.

Syntax notes

Certain rules concerning options are checked at a point later than the time of definition. Refer to the following example:

DEFINE PRINTER P1 WITH - SCOPE=SYSTEM ROUTER=VM - ID=PRIIINTER1

In the example, the correct ID specification PRINTER1 is misspelled. However, the DEFINE command runs. An error occurs if an attempt is made subsequently to run a USE P1 command that accesses the incorrect DEFINE PRINTER definition.

The example also shows the use of the hyphen (-) as a continuation character. A continuation character preceded by a space is required at the end of an input line, if the command parameters continue onto the next line.

Usage notes

  • You can create a template and assign it a name with the DEFINE command (except for DEFINE FIELD). The template can contain all the attributes needed to create a new template. You can refer to the template name in a DEFINE command or in an ALLOCATE command where a DEFINE DATASET command previously defined the template. The attributes of a template override those of the previously defined entity.
  • The definition of any entity can be replaced by entering a DEFINE command, the previously defined entity name, and any attributes to be altered. Issuing a DEFINE command with the same name as one presently in use overrides the current template definition. You, therefore, might unintentionally replace an existing entity definition, because Model 204 does not check if the entity name entered is unique.
  • When it processes a DEFINE command, Model 204 ends any current User Language update unit and begins a non-backoutable update unit. If a Model 204 command non-backoutable update unit is in progress, the DEFINE command is included in that update unit.
  • DEFINE commands that contain invalid or mutually exclusive options are rejected by Model 204.