Define. DORIC 9.65, INFO-Text software
Oglas
Oglas
DEFINE
DEF
INE syntax cont’d identifier [ password_0 ] [ password_1 ]
[ password_2 ] [password_3 ]
initiates a dialog with INFO in which you create a new data file template.
arguments
identifier represents a legal INFO file name unique to your user area (maximum of 32 characters).
[password_#] is a 1- to 4-character string.
notes
n
If you enter key or array information for an item, it is best to enter the information together on one line, being careful to include all necessary specifications. See Table
DEFINE-2 for specifications. You can also use the ALTER or REDEFINE commands to enter key and array information separately.
n
When you define a data file, be sure that the file name consists of at least one non-numeric character; otherwise, you cannot use the RELATE command with the data file.
n
Defining Arrayed Items
An arrayed item is an item that has multiple values in one record that can be accessed individually using one of the
INFO system items $IDX# as a counter. To define an arrayed item, define an item whose width includes the total length of the multiple value item. The length of the defined area should be an even multiple of the length of the arrayed item.
Once the length of the array has been defined, include the
OCCURS count and INDEX characteristics. The
OCCURS count defines the number of times the array element repeats in each record; the INDEX identifies which $IDX# system item controls access to individual elements in the array.
INFO Reference Manual Commands 133
DEFINE
n
Defining an ISAM Key
An ISAM key item is a data file item that corresponds to an ISAM key field in an ISAM file. You can specify those items to be considered ISAM keys once the datafile has an
EXTERNAL association with an ISAM file. To notify INFO that an item is an ISAM key, respond to the ENTER KEY
LEVEL> prompt. INFO then provides the prompts to lead you through a complete key definition.
For more information about using ISAM key items in
INFO-Text datafiles, see Appendix J, ISAM
Considerations.
discussion
134
With the DEFINE command you create a data file template by specifying the characteristics (such as name, type, size, and so on) of the items that make up the data file.
In the DEFINE command, you can assign passwords that
INFO uses later to restrict access to the data file. If you include a password or passwords, anyone selecting the data file in the future must enter one of the passwords to gain access to those items defined with some level of protection. Each password controls a different level of access to the file. See the section on 'Item protection levels' in this command reference for a description of how you can use INFO to restrict access to specific items in a data file.
Once you initiate the DEFINE dialog, INFO begins a series of prompts for item characteristics, beginning with the first item in the file.
When you finish defining the data file template, enter a
<RETURN> in response to the ITEM NAME> prompt and
INFO returns you to the ENTER COMMAND > level.
You can enter the full definition for an item on one line, without waiting for the individual prompts from INFO for each item characteristic. Separate multiple responses using a comma. To skip an item value (for example, to accept the default number of decimal places), enter two commas together. To assist you, INFO lists the generalized syntax description before the first ITEM
NAME> prompt.
Commands INFO Reference Manual
DEFINE
ITEM NAME,WIDTH[,OUTPUT WIDTH],TYPE[DECIMAL PLACES][PROT.LEVEL]
1
ITEM NAME>
You can enter multiple characteristics on any subsequent line, following the rules above but entering only those characteristics remaining.
When you enter multiple values together, the total line length is restricted to 200 characters maximum, including the commas. If required items remain for which you have not entered a response, INFO prompts for the remaining information; otherwise, it goes on to prompt for the next item in the file.
Not all information is required for all types of items. In some cases, when it is likely that you want a value for an optional characteristic (such as output width), INFO prompts you for that value. In other cases, the only way you can define the characteristic is to enter it with a previous prompted item or to alter the item later with the
ALTER command. The prompts you receive depend on the type of item you are defining. Table DEFINE-1 shows the data types available, with size restrictions and a description for each.
If you enter an error among the multiple responses, INFO displays a message and prompts again for the corrected response. You must re-enter all subsequent responses, as
INFO ignores responses that follow an error.
Each time INFO begins to prompt for a new item definition, it displays a number. This number is the starting position of the next item in the file. For example, before the first item, INFO displays the number 1. If you then define a 20-character item, INFO displays the number 21 before the prompt for the next item.
When you see each prompt, enter a value appropriate to the prompt for the item being defined. If you do not want to enter a value and choose to accept the default instead, respond <RETURN>. You can only do this where a default is assigned; otherwise, INFO reprompts you to enter a value.
INFO Reference Manual Commands 135
DEFINE
ENTER COMMAND >DEFINE EMP-MASTER
ITEM NAME,WIDTH [,OUTPUT WIDTH] ,TYPE [,DECIMAL PLACES][,PROT. LEVEL]
1
ITEM NAME>EMP-NO
ITEM WIDTH>4
ITEM OUTPUT WIDTH><RETURN>
ITEM TYPE>N
DECIMAL PLACES>0
5
ITEM NAME>DEPT,3,I
8
ITEM NAME>DATE-HIRED,8,8,D
16
ITEM NAME>START-SALARY,9,N,2,0
25
ITEM NAME><RETURN>
Table DEFINE-1
Item type
A
B
(Binary)
C
(Character)
INFO item types
Internal width
9-32 bytes
(INFO-Text only)
1-4 bytes
1-8 bytes
(VMS only)
1-4,096 bytes
(1-4091 if concordable)
Description
Contains the name of a file which holds free text in ASCII format.
Number stored as binary integer. No decimal positions are allowed.
Number stored as binary integer. Can have implied decimal point.
Fixed-length character string. Can be concorded if extended datafile.
136 Commands INFO Reference Manual
Table DEFINE-1
Item type
D
(Date)
F
I*
(Integer)
L*
(Lead-fill)
N*
(Number)
O*
(Overpunch on Output)
P*
(Packed)
DEFINE
INFO item types (cont’d)
Internal width Description
8 bytes
4-8 bytes
(Floating)
1-16 bytes
(digits)
1-16 bytes
(digits plus
Number)
1-16 bytes
(digits plus decimal point)
1-16 bytes
(digits)
1-8 bytes
(packed digits)
Date item stored internally as YYYYMMDD. Input and output formats can be user defined. The default format is
MDY/. See the DFMT command for information about date formats.
Number stored in floatingpoint format.
Integer item. No decimal positions are allowed.
Number that will be left-padded on output with the current
LCHAR characters. Can have up to 15 decimal points with the decimal point implied.
Number with decimal places.
Can have up to 16 characters including the decimal point.
Number that will be overpunched over the last digit on output. Can have up to
16 decimal positions with a decimal point implied.
Number stored in packed decimal format with trailing sign
Byte 1 holds one digit. Each subsequent byte holds up to two additional digits. Can have up to 15 decimal positions with the decimal point implied.
INFO Reference Manual Commands 137
DEFINE
Table DEFINE-1
Item type
INFO item types (cont’d)
Internal width Description
T*
(Trailing sign, Zero fill)
V*
1-16 bytes
(digits plus
Zero sign) implied
1-16 bytes
Number stored in external decimal format with trailing sign. Zero- filled on output.
Can have up to 14 decimal positions with fill and an decimal point.
Unsigned number stored in external (Zero Fill) decimal format, zero-filled to the left.
Can have up to 14 decimal positions with an implied decimal point.
* INFO maintains precision to 12 significant positions.
138 Commands INFO Reference Manual
DEFINE
The define dialog
When you enter a DEFINE command, INFO initiates a dialog that includes a combination of the following prompts.You can respond by entering only the specific information described by the prompt, or you can enter further information about that data item.
Make sure that you leave a positional comma when you skip a characteristic of the data item being defined, and that you enter the information in the correct order. The DEFINE dialog prompts are described below.
INFO dialog
ITEM NAME
ITEM WIDTH
ITEM OUTPUT WIDTH
ITEM TYPE
ITEM DECIMAL PLACES
(N, V, F, L, O & T-types only, plus B-types on VMS)
ITEM NAME
ITEM WIDTH
In response to this prompt, enter the 1- to 16- character name for the item. The name can be any combination of characters, except blanks, commas and the current delimiter character. However, the first character of an item name cannot be a number (0-9), hyphen (-), asterisk (*), slash (/), plus sign (+), single quotation mark (‘), or left or right parenthesis.
Do not define an item name that includes a character used as an INFO control character (for instance, a backslash (\) when it is the CCHR setting BACKTAB character). Also, do not use an INFO reserved word as an item name; problems can occur when trying to reference the item name as an
INFO command.
This is also referred to as input width. In response to this prompt, enter the internal storage width in number of characters (bytes) that this item requires. See Table
DEFINE-1 for restrictions on item widths. This specification is required.
ITEM OUTPUT
Enter one of the following responses for this prompt.
WIDTH
The output character width for the items (see Table
DEFINE-1). If this width exceeds that possible for your terminal or printer, INFO wraps the item on output.
INFO Reference Manual Commands 139
DEFINE
<RETURN> to accept system default for output width.
Defaults are 10 to D (date) items; 5 for B (binary) items with input widths of 1 to 5 bytes; 12 for F (floating point) items; and input width for all other items.
ITEM TYPE
For C-type items defined with an ITEM WIDTH greater than
200 character, INFO defaults to 200 characters for the output width. Enter an output width if the item is displayed with commas or other formatting characters or is displayed using fewer characters than the stored width. See the discussion of $COMMA-SWITCH in Appendix D “System
Items” for information about controlling the display of commas for numeric items.
Always specify OUTPUT WIDTH for numeric item types that
INFO stores with an implied decimal. To include the decimal point when such item values are displayed or printed, specify OUTPUT WIDTH as 1 greater than the
INPUT WIDTH.
Enter the item type, as described in Table DEFINE-1. This specification is required.
ITEM DECIMAL
For numeric items with decimal positions only. In
PLACES
response to this prompt, enter the number of decimal positions in the item. For item types F, L, N, and O, (and B types under VMS) the number cannot exceed
OUTPUT WIDTH minus 1. For item types T and V, it cannot exceed OUTPUT WIDTH minus 2. If there are no decimal points, enter zero (0).
This specification is required for F, L, N, O, T and V types and for B types under VMS.
Following the last applicable prompt above (either ITEM
TYPE or ITEM DECIMAL PLACES), you can enter, on the same line as the prompt response, any of the information shown in Table DEFINE-2. You must enter all information that is relevant for the item being defined, in the order shown. INFO never prompts you for this information unless you terminate the previous line with a comma. For example, if you enter item type, protection and then terminate that line with a comma, INFO prompts you for the next characteristic, in this case, ALTERNATE ITEM
NAME>. If you enter the same item type and protection, but do not terminate the line with a comma, you do not receive any further prompts for the item being defined but return to the ITEM NAME> prompt for a new item.
140 Commands INFO Reference Manual
Preuzimanje
Oglas