CDS550
Display/Maintain/Print View |
CDS550 is a view manager that can be called to display, maintain, or print a standard view. A standard view is a logical grouping of fields contained within a single string template. The view fields are now specified using the Views option within Data Dictionary Maintenance (FMS). A standard view contains one or more fields arranged in a single column. Each row of the view includes the field description, the field values, and any information related to the field such as field verification related fields.
Note that CDS550 manages the display and entry of data. It performs no disc read or write operations other than to access the data dictionary.
During the initial call to CDS550, the data dictionary is read to obtain all information about the view. This data is stored in a global variable that begins with "SMS_S550:" in order to improve performance on subsequent calls to CDS550. This means that a user may need to logout to clear this global variable should changes be made to either the data dictionary,
view fields, or data file itself. See S550.GLOBAL$
parameter to disable storing the setup data in a global variable.
Calling Format:
CALL "CDS550", ERR=XXXX, Y$, REC$, S550$ {, RECMAIN$,
Y5$, Y6$ }
CDS550 Arguments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ERR=XXXX
|
Branch to XXXX for various critical problems such as:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Y$
|
Standard task control variable.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
REC$
|
Passed to CDS550 as the templated data structure to be displayed or maintained. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
S550$
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RECMAIN$
|
Pass to CDS550 to bypass the display/entry of field segments that are already known. CDS550 will derive the values of any key-segment fields with the same field name from
RECMAIN$ instead of prompting the operator. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Y5$
|
Pass to CDS550 only when printing a view. Y5$ is printed
centered below the company name when printing requires starting a new
page. Note that when printing a view, all S550$ fields are not
applicable other than the S550.FILNAM$ and S550.VIEW$ . |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Y6$
|
Pass to CDS550 only when printing a view. This is the standard printer control variable returned from the printer selection routine CDS084. |
View Validation
Note that when exiting CDS550 for maintaining a view, CDS550 will call the
View Validation program specified in View Maintenance. This program can be used to validate the view to provide any record level logic that cannot be used at the field level. For example, after maintaining a view containing an address, the address can be validated which includes multiple fields. If the called routine exits with an error, i.e.,
EXIT 99
, then this signals CDS550 to return to maintenance mode to allow the user to make changes before exiting to the calling program.
Global Variables
CDS550 sets a global variable named SMS_CDS550_FLD
to "0"
when stepping
through fields automatically, or to the field number being entered when the
operator enters a specific field to modify on an existing view. It may
be useful for an external routine to check this global when it is necessary
to know whether the record being maintained is a new or existing record.
CDS550 also sets a global variable named SMS_CDS550_MAINT
which contains
the Maintenance Option field for each numbered field in the View. The nth position in this
global will contain the Maintenance Option Code for the current field as specified in View Maintenance.
The values include blank (entry), S (skip), Q (display only), and B (skip if
non-blank/non-zero). When CDS550 is called with S550.MAINT=2
to 'Enter All Fields',
CDS550 will skip any field with a maintenance option of S, and skip any
field that currently has a non-blank or non-zero value if the Maintenance
Option is B. The Maintenance Option for each field is maintained using
View Maintenance (FMS). The application can alter this global to
change the fields that are entered. For example, the customer name and
address may be skipped during a new entry of a sales order when the customer
is a regular customer, but not skipped for a miscellaneous customer.
In this example, the routine that is used to enter the customer# would
change this global, setting the positions that pertain to the name and
address to blank or S depending on whether the customer# is one used for
not-on-file customers. Call program CDS557 to
change a character in this global string.
When CDS550 is called recursively, there can be a global variable conflict. Program CDS556 should be used to save the current global variables, and later restore them to help prevent global variable problems.
Example taken from Printer Administration (PFM) |
0130 CALL "CDS041","CDS550",S550$
|
This example is used to maintain the spooled printer fields that control whether the print queue should accept jobs, and whether the print queue is enabled or not. The data structure being maintained is actually a temporary work file populated by the current spooled printer status. This example simply prints a window, displays un-numbered fields background and data, then exits. The next part of the application prompts the operator for certain options and 'POP's the window when completed. |
Example taken from Fax Administration (PFM) |
0210 CALL "CDS041",ERR=EOJ,"CDS550",S550$,"YY"
|
This example is used to display the fax scheduler status information. No data is maintained on this view. CDS550 is called simply to display the background and data. The field descriptions are retrieved from the data dictionary so this application simply needs to populate S310$ and call CDS550 to display the view. |
Another Example taken from Fax Administration (PFM) |
0210 CALL "CDS041",ERR=EOJ,"CDS550",S550$,"YY"
. |
This example is used to display and allow the user to maintain certain fields related to a specific fax modem. This view uses a routine that is called by CDS550 at when exiting the view to execute any fax commands necessary to reflect the entries made by the operator. |