Dictionary Attribute Prompting Facility [ HP SYSTEM DICTIONARY XL SDMAIN ] MPE/iX 5.0 Documentation
HP SYSTEM DICTIONARY XL SDMAIN
Dictionary Attribute Prompting Facility
SDMAIN provides an attribute prompting facility that prompts for
attribute values whenever you issue a CREATE, MODIFY, or REPORT command
without the ATTRIBUTE-LIST parameter. For the CREATE command, all
possible attributes that can have values assigned to them are displayed
for the command in the menu format. For the MODIFY command, all possible
attributes that can be changed are displayed, and for the REPORT command,
all attribute values that can be qualified (to limit what is retrieved)
are displayed.
Attribute prompting does not occur for the CREATE ENTITY or CREATE
RELATIONSHIP command if the entity or relationship being created already
exists in the dictionary. Attribute prompting does not occur for the
MODIFY ENTITY or MODIFY RELATIONSHIP command if the entity or
relationship being modified does not exist. Attribute prompting is not
performed when input is from a file or when you are executing in batch
mode.
Prompting can be turned ON or OFF by using the OPTIONS command. When you
run SDMAIN interactively, prompting is initially ON. While prompting is
ON, the prompt menu is issued only when the ATTRIBUTE-LIST parameter is
omitted from a command that allows it (so ATTRIBUTE-LIST = () disables
prompting for the command without providing any attribute values). When
you do not run SDMAIN interactively, you cannot turn prompting ON.
Attribute prompting consists of a menu of all the attributes you can
choose to provide values for and a prompt for indicating which attributes
you choose. You then enter the numbers of the attributes desired and the
system prompts for values for those attributes. After you enter all the
values, the system appends a string with an equivalent ATTRIBUTE-LIST
clause, to the command entered and executes the command. Each of these
steps is described in detail in the following discussion.
The Menu
The first thing you see when using the attribute prompting facility is
the menu. It consists of a one-line header describing the use of the
attribute values to be entered and a list of attributes, each with a
number. You can choose any combination of attributes for any command.
Number 1 on all menus is the all option which prompts for all of the
displayed attributes. Numbering for the remaining prompts, however, can
vary (and often does) from menu to menu.
A sample menu for creating an entity of entity-type RECORD is displayed
below:
Choose the attribute(s) to be assigned a value
1 all 8 VPLUS-ALIAS 15 ENTRY-TEXT
2 SENSITIVITY 9 STANDARD-ALIAS 16 HEADING-TEXT
3 ID-NUMBER 10 HP SQL-ALIAS 17 PATH-REPORT
4 BYTE-LENGTH 11 DEFAULT 18 HP-CONDITION-VALUE
5 COBOL-ALIAS 12 DESCRIPTION 19 HP SQL-SELECT-COMMAND
6 IMAGE-ALIAS 13 EDIT-MASK
7 PASCAL-ALIAS 14 ENTITY-LONG-NAME
Menu Choices
After the attribute menu is displayed, the prompting facility displays
the menu prompt (>>) and waits to receive a selection of numbers from the
menu. After you enter values for the specified attributes, the menu
prompt is again displayed until you enter either a period (.) or a
[[RETURN]]. The following table shows the valid responses to an attribute
menu prompt:
INPUT ACTION
A number Prompts for a value for the indicated
attribute. EXAMPLE: 2
A list of numbers Prompts for a value for each of the indicated
separated by blanks or attributes. EXAMPLE: 2,3,6
commas
all option On all menus, menu option 1 is the all option.
When you enter 1, the system prompts for values
for each of the attributes in the menu. When
the prompting is completed, this option
proceeds immediately with the execution of the
command instead of returning to the menu
prompt. EXAMPLE: 1.
A range of numbers Prompts for a value for each of the attributes
(including the attributes associated with the
beginning and ending number) within the
specified range. A range is of the form:
beginning number : ending number
where the ending attribute number is greater
than the beginning attribute number. EXAMPLE:
2 : 4
H[ELP] Displays a short description of the syntax of
user input at the menu and attribute prompts.
A blank line or a period Terminates prompting and begins execution of
the command.
Attribute Values
After you choose an attribute, the system prompts for a value for the
attribute and provides the current or default value in parentheses after
the attribute name prompt (for example, SENSITIVITY (PRIVATE)>>). When
using the CREATE command, the default value is displayed in parentheses
the first time you choose that attribute. If you choose that attribute
again before the command is executed, the value you previously entered at
this attribute prompt is displayed in parentheses. When using the MODIFY
command, the value currently assigned in the dictionary is displayed in
parentheses. If you select that attribute again, the value you entered
previously for this attribute prompt is displayed. The value that you
enter must follow the same rules that apply in command mode. Values you
enter during attribute prompting are validated to insure they are legal
for the attribute type. No check is made against the edit value of the
attribute. That check is done during execution of the command.
The following values have special meaning when entered in response to
value prompting:
INPUT ACTION
[[Return]] The attribute is skipped as if it were never
selected. If the attribute has not been previously
selected during this command, the attribute is NOT
included in the ATTRIBUTE-LIST; otherwise, the value
assigned at the previous prompt is used.
.(a period) The value of the current attribute is set as if you
entered a [[Return]] and prompting of the current
range (if one is active) is stopped. If it is a
simple range, no more attributes in that range are
prompted for, and the system moves on to the next
attribute. If the selection is the all option, no
more attributes are prompted for and the command
executes immediately.
/ (a slash) For the CREATE and MODIFY command the attribute is
set to its default value. For the REPORT command the
attribute is set to accept any value. Any value
previously assigned by prompting is deleted. This is
the equivalent of entering attribute= without a value
in the ATTRIBUE-LIST clause of the command.
Executing the Command
After all attribute values have been entered, the system creates an
ATTRIBUTE-LIST clause that corresponds to the information provided. The
system appends this clause to the end of the command so that it is
present if you use REDO to edit or reenter the command. The system then
processes the command.
Example
The following example creates element quantity. It assigns read
sensitivity, an element-type of I, a display-length of 5, a byte-length
of 2, and a count of 10. No value is assigned to the decimal or units
fields even though a prompt is issued for values (the first because a
[[Return]] is entered and the second because a . is entered to stop
prompting for the range 4:13). Note also the multiple lines of prompting
for description. You are prompted for multiple lines as long as quoted
string has been started. Finally, a [[Return]] is entered at the menu
prompt and the command executes to create the element quantity with the
provided attribute values.
>CREATE ENTITY quantity;
>>ENTITY-TYPE = element.
Choose the attribute(s) to be assigned a value
1 all 11 BLANK 21 DESCRIPTION
2 SENSITIVITY 12 JUSTIFY 22 EDIT-MASK
3 ID-NUMBER 13 SYNCHRONIZE 23 ENTITY-LONG-NAME
4 ELEMENT-TYPE 14 COBOL-ALIAS 24 ENTRY-TEXT
5 DISPLAY-LENGTH 15 IMAGE-ALIAS 25 HEADING-TEXT
6 DECIMAL 16 PASCAL-ALIAS 26 PATH-REPORT
7 BYTE-LENGTH 17 VPLUS ALIAS 27 HP-CONDITION-VALUE
8 COUNT 18 STANDARD-ALIAS 28 HP SQL-SELECT-COMMAND
9 UNITS 19 HP SQL-ALIAS
10 SIGN 20 DEFAULT
>>2
SENSITIVITY (PRIVATE)>>read
>>4:13, 21
ELEMENT-TYPE ( )>>I
DISPLAY-LENGTH (0)>>5
DECIMAL (0)>>
BYTE-LENGTH (0)>>2
COUNT (1)>>10
UNITS ( )>>.
DESCRIPTION>>"Quantity is an array holding the quantity ordered by a
DESCRIPTION>>company over the last ten orders. It is used to help
DESCRIPTION>>figure the sales discount allowed on the next sale."
>>
>
MPE/iX 5.0 Documentation