Skip to content

PRINT VIEW

FUNCTION

PRINT VIEW is used to display a view from Dictionary-IV on the terminal.

SYNTAX

PRINT VIEW view-name [USING file-access]
[KEY INTO string-data-name/variable]
[SELECT WHEN Thoroughbred Basic conditional]
[WINDOW window-options]
file-access:
KEY [SORT numeric-value] range |
RECORD NUMBER [SORT numeric-value] range
range:
RANGE IS
ALL |
FROM from-record TO to-record
from-record:
value | FIRST
to record:
value | LAST
Thoroughbred Basic conditional
Refer to the Thoroughbred Basic Language Reference
window-options:
[LINE IS numeric-value]
[COLUMN IS numeric-value]
[NUMBER LINES ARE numeric-value]
[CHARACTERS PER-LINE ARE numeric-value]
[BORDER TYPE IS border-code-string]
[HEADING IS heading-code-string
[FUNCTION IS function-code-string]
border-code-string:
R Reverse Video
C Character
N None
G Graphics
heading-code-string:
Y Display Heading
N Do Not Display Heading
function-code-string:
C Display, Scroll, Exit/Clear
D Display, Scroll, Exit
d Display, Exit
E Erase Window
view-name
the name of a view defined in Dictionary-IV.
numeric-value
a data name, variable, constant, or expression that results in an integer.
value
a data name, variable, constant, or expression that results in an integer or string value.
string-data-name/variable
a string data name or variable name.

NOTES

  • For more information on views see the Dictionary-IV Developer Guide.

  • A view must be declared with a VN statement and opened before it can be printed. The link must also be opened before the view can be printed.

  • To enable the PRINT VIEW command to treat a format with preset keys as a multi-format file, the key fields with preset values must have the security indicator set to 3,0. If the security indicator is not set to 3,0 the preset values are ignored.

  • The view range defaults to the entire file and is displayed from the beginning, unless the KEY INTO option is specified.

  • The RANGE clause is used to specify a controlling range for the view, which overrides the default. If the SORT option is specified, the RANGE clause is optional.

  • Vertical scrolling is limited to the specified range.

  • If the KEY INTO option is specified, the view is printed starting with the KEY INTO value, and the operator is able to scroll up to the beginning of the range and down to the end of the range. If the KEY INTO value is outside of the specified range, or if the KEY INTO value is null, the view is printed starting with the beginning of the range.

  • The KEY INTO option assigns the selected key to the specified string-data-name or variable. The selected key is the key on which the cursor is positioned when the operator exits the view.

  • The KEY INTO option always returns the primary key value.

  • The SELECT WHEN option can be used with an individual record or a range of records to select a record for processing based upon a logical condition. The syntax is:

    PRINT VIEW view-name
    SELECT WHEN conditional

    The conditional follows Thoroughbred Basic IF syntax but without specifying a THEN or ELSE. The data elements used in the SELECT WHEN clause must be defined in the file in which the SELECT WHEN is executed.

    The logical condition is two or more values, consisting of constants, data names, variables, functions, or expressions that interact with relational or logical operators to form either a true or false result. The record is accessed and the test performed. If the specified condition is true, the record is selected for processing. If no SELECT WHEN is specified, all records are selected.

    For more information on logical conditions see the section on Logical
    Conditionals in this manual.

  • If a record is busy when the view is printed, a record busy message is displayed and the remaining records are listed.

  • FUNCTION IS “C” is the default function-code-string. It displays the window, enables the operator to scroll through the file, and clears the window on exit.

  • FUNCTION IS “D” displays the window, enables the operator to scroll through the file, and leaves the window displayed on exit.

  • FUNCTION IS “d” displays the window and returns control to the script without allowing any scrolling. It is a good idea to specify a key range when using the “d” option. If you don’t specify a key range, the view will only display the fields that will fit in the window starting at the beginning of the file.

  • FUNCTION IS “E” erases the view window created by the “D” or “d” function.

  • The default values for the window options are:

    line = 4
    border type = N column = 0 function = C #lines = from view heading = Y character = 79

• The keyboard functions and keys active when a view is printed are:

F10 goto
character single character goto - press character to move to matching record
Fx * All other function keys exit the view
Return returns the current key value when the KEY INTO clause is specified and exits the view.
Down-arrow cursor moves down 1 line, or when at border, scrolls down 1/2 view
Up-arrow cursor moves up 1 line, or when at border, scrolls up 1/2 view
PgUp scrolls up whole view
PgDn scrolls down whole view
Home 1. Top of window
2. Beginning of range
3. End of range
  • The value of the key used to terminate the PRINT VIEW command is returned to the TERM-KEY variable.

EXAMPLES

PRINT VIEW 4SCUST USING KEY SORT 1 RANGE IS ALL
KEY INTO 4SCUST.CUST-CODE
SELECT WHEN 4SCUST.CREDIT-LIMIT > 1000
WINDOW LINE 15
COLUMN 20
NUMBER LINES 3
CHARACTERS 40
BORDER TYPE "R"
FUNCTION "C"
HEADING "N"

SEE ALSO

OPEN VIEW, VN

From the Script-IV Language Reference, version 8.9.1. Open this page in the PDF