CDS550

Display/Maintain/Print View

Last Revised: 05/13/19

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:
  • View specified is not on file
  • Data Dictionary for view is not on file
  • View contains fields that are no longer present in data dictionary
Y$ Standard task control variable.
Y.COMPCODE$Used for S550.CC$ when S550.CC$ is blank
Y.PASSPARM$Indicates Inquiry Only mode.  No field line numbers will be displayed.
REC$ Passed to CDS550 as the templated data structure to be displayed or maintained.
S550$
S550.CC$ Company Code for Data Dictionary.  Only required when not using the current company Y.COMPCODE$.
S550.FILNAM$ The file name to be used to access the View.  Note that this typically excludes the company code.  Required.
S550.VIEW$ The view code used to access the view.  Typically A for the first logical view of the record, B for the second, etc.  Required.
S550.WINDOW Used to control window for view.
0CDS550 does not use 'WINDOW' and 'POP' mnemonics.  View is displayed beginning at S550.ROW on the window currently active
1CDS550 prints a 'WINDOW' with a full width display, with a yellow border visible only at the top at S550.ROW, and does not 'POP' window upon exit.
2CDS550 prints a 'WINDOW' as in option #1, and 'POP's window upon exit.
S550.COL Normally not assigned by calling program, but can be passed to CDS550 to cause the field names to be displayed at column S550.COL instead of the leftmost position.
S550.ROW
S550.WINDOW=0 Top row of view will be displayed at this display row.
S550.WINDOW>0 Pass as zero to have CDS550 use the highest display row that the view can be displayed on.
Pass as non-zero to have the window displayed at the row specified.
S550.BKG Display screen background
0Do not display screen background with field names for view.
1Display screen background of field names.  This is the default value when S550.WINDOW is passed as 1.
S550.DISP
0 Do not display data fields defined in view for REC$.
1 Display data fields specified in view for REC$.
S550.MAINT Maintain option
ValueIf S550.ENTER$ is blankIf S550.ENTER$ is non-blank
0No maintenance option or prompts
1No maintenance option, i.e., no fields in the view can be changed.  User will be prompted to either: "Enter=Continue" or "D=Delete Record, Enter=Continue" depending on S550.DELETE parameter."Enter=My Text, F4=End" or "D=Delete Record, Enter=My Text, F4=End" depending on S550.DELETE parameter.
2Enter all fields.  Prompts user for each field in view as would be done on a new record.  Note that fields marked in View Maintenance with a Maintenance Option Code of S are skipped.  After all fields have been entered, user may select field# for additional maintenance as with option 3 below.
3Maintain user selected fields.  Prompts user to enter field# to maintain.  Prompt will read: "Enter field# (1-NN), F2=Display, F4=End"Prompt will read: "Enter field# (1-NN), F2=Display, Enter=My Text, F4=End"
S550.ENTER$ Pass as a non-blank value to change the prompt to read "Enter=My Text, F4=End".  This enables the calling application to check whether the user touched Enter or F4.  "My Text" is the text passed in S550.ENTER$.  See chart in MAINT section above.  You can also offer function key options following the Enter.  Simply include the function key followed by the equal symbol, i.e., S550.ENTER$="Process, F5=Rush, F6=Postpone".  If the user touches Enter then CTL=0.  I they touch F5, then CTL=105, and if F6, CTL=106.
S550.F4 This option only applies when S550.MAINT=2.  If passed to CDS550 as 1, then the operator will be permitted to touch the F4 key on the first field which will cause CDS550 to exit.  If the operator exits using F4 at the first field, then CDS550 with set S550.F4 to 4 to inform the calling program that no entries were made.
S550.NO If passed as zero, then no field numbers will be included on the display background, often used for inquiry only views.  If passed as non-zero, then non-inquiry fields will be numbered on the display background beginning with this number.  Typically passed as 1 when the view is to be used for file maintenance.
S550.LEFT$ Fields will be left-justified in view unless LEFT$="N".
S550.MAXTITLE Pass to CDS550 when it is desired to override the column position where the data will be displayed/entered.  Normally this column is computed based on the longest description of the fields included in the view.  Pass S550.MAXTITLE as the size of the longest description previously displayed.
S550.KEYSEGS
0 The view should contain only the fields specified in View Maintenance.
1 The view should include the key segment descriptions in background text only as un-numbered fields, in addition to the fields specified in View Maintenance.  This option is used by File Maintenance so that the display background includes rows for the entry of the key segments.
2+ Same as 1 but indicates that the key segments should be based on KNUM 1 or higher.  Pass S550.KEYSEGS as KNUM+1.
S550.DELETE Pass as 1 when maintaining the view to include 'D to delete' option.  This field is returned as zero by CDS550 under normal maintenance, and set to 1 when the user selects the delete option so that the calling routine can perform the necessary delete logic.
S550.COLENT Set by CDS550 to the column to be used for entering data.
S550.KEYSEGSDISP Set by CDS550 to the number of key segment fields.
S550.GLOBAL$ Pass as N to disable storing the setup information in a global variable.  Each call to CDS550 will access the data dictionary to obtain the setup information.  This would be needed when the screen background or omitted fields in the view change dynamically.
S550.TITLE$ Used to indicate what prints on printer before view is printed.  Only applies when printing view, i.e., Y6$ is passed to CDS550.
blankPrint DD20.TITLE$
NDo not print any title
5Print Y5$
S550.WIDE Set by CDS550 to 1 when the view requires more than 80 columns.  The calling application should pop the 132 column window and return to 80 columns after the last call to CDS550.  IF S550.WIDE THEN PRINT 'POP','SP',
S550.NOTITLE For Graphical Views only, set to 1 to omit the title row.
S550.GUIWIDTHPCT For Graphical Views only, set to table width percentage value. This parameter is only needed when multiple displayViews appears side by side on the page, and you want to make one of the views wider than the other.
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$
0140 LET S550.CC$="CD",S550.FILNAM$="S220.",S550.VIEW$="A",S550.WINDOW=1,S550.ROW=2,S550.BKG=1,S550.DISP=1,S550.MAINT=0

0150 CALL "CDS550",ERR=EOJ,Y$,S220$,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"
0220 LET S550.CC$="CD",S550.FILNAM$="S310",S550.VIEW$="A",S550.ROW=2

0230 LET S550.BKG=1,S550.DISP=5
.
. logic to populate the S310$ data structure
.
0470 CALL "CDS550",ERR=EOJ,Y$,S310$,S550$

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"
0230 DIM S550W$:FATTR(S550$)
0240 LET S550W.CC$="CD",S550W.FILNAM$="S310W.",S550W.VIEW$="A",S550W.ROW=2
0250 LET S550W.BKG=1,S550W.DISP=2,S550W.WINDOW=1,S550W.NO=1,S550W.KEYSEGS=0

.
. logic to populate the S310W$ work file.  Operator selects fax modem using CDS037 which returns S310W$ record.
.
1610 CALL "CDS550",Y$,S310W$,S550W$

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.