CDS555

Enter/Display/Decode/Validate Data Dictionary Field

Last Revised: 10/05/14

This routine can be used by an application to allow the operator to enter a data field based on parameters that are stored in the Data Dictionary.  It is especially useful for string verified entries where the list of valid choices are stored in the Data Dictionary instead of within the application programs.  CDS555 can also be used to display the data and related verification fields, as well as to return the related text for a verified field for printing to a printer or other output device.

CDS555 can also validate data without any display or entry for a single field or all fields in a templated string. This option will also modify the data performing left or right justification and conversion to upper case when specified in the data dictionary.

Calling Format:

CALL "CDS555", COL, ROW, CCFILFLD$, REC$, { DISPF4$, REL$, VAL$ }

CDS555 Arguments
COL In Display column for entry or display
ROW In Display row for entry or display
CCFILFLD$ In Data Dictionary File and Field Reference
Company CodeOptional, but assumed to be present when the number of characters to the left of the period is 5 or more.

Can be XX, defaults to XX.

Data Dictionary NameRequired 
PeriodRequired for Entry & Display Mode
Optional for Validation Mode
Validate all fields if not specified
Field Name
$OptionalIgnored
[nnn]OptionalIf not provided, defaults to [1] for Entry/Display mode, and validates each element of repeating field in validate mode.
Examples
CM01.NAME
XXIM01.ITEMNO
PO40.SHPBILLCD$
DSCW20.WEBLINK$[3]
CM01
REC$ In/Out Data Structure
DISPF4$ In
blank or not passed Entry Mode - Operator will be prompted to enter data field specified
Q Query/Display Mode - data will be displayed, not entered.  Related data will also be displayed if applicable. Pass COL and ROW as zero to obtain related field in REL$ but not display.
q Similar to Q option but REL$ will include cursor positioning expression for data, data field, cursor positioning expression for related fields, and related fields.
+ Include F4=End option in prompt.
V (upper case) Validate the field or entire record if no field is specified
v (lower case) Same a upper case V, but do not call T type routine for additional custom validation.
REL$ Out

Assigned by CDS555 as the related fields for string and file verified entries.  This is useful on reports where you want to decode the data field.

DISPF4$ value REL$ will contain
Q Related field(s) only
q Cursor positioning expression for data, data field, cursor positioning expression for related fields, and related fields.
VAL$ Out

In validation mode, VAL$ contains validation results. If all fields validate, VAL$ will null, otherwise VAL$ will contain a list of validation messages. Multiple messages will be separated by the new-line ($0A$) character.

Examples:

Field Type Validation Message Note
All Data does not match template Error retrieving field from data
  not in simple verification list  
  not in verification list  
  not on file <FILENAME>  
Numeric does not fit in mask  
  more than nn digits N mask types, i.e., N9.3
  more than ff fractional places
  smaller than min of nnnn  
  larger than max of nnnn  
String non-printable characters  
  shorter than min of nnnn  
  longer than max of nnnn  
Date invalid date  
  date is before mm/dd/yy  
  data is after mm/dd/yy  
T-Type <external routine generated message> Set X100.OUT$ in T-Type routine
Example
1010 CALL "CDS555",10,5,"XXPO40.SHPBILLCD$",PO40$
1020 CALL "CDS555",10,6,"DSPO40.SHPBILLCD$",PO40$,"Q"
1030 CALL "CDS555",0,0,"PO40.SHPBILLCD",PO40$,"Q",REL$
1040 CALL "CDS555",COL,ROW,"DSCW20.WEBLINK$[3]",CW20$,"Q"
1050 CALL "CDS555",3,ROW,"CDDD21.MODE",DD21$,"+"
Line 1010 is a normal entry of the DSPO40.SHPBILLCD$ field with entered value returned in PO40$.
Line 1020 displays the data and the related text associated with the code, but does not do any data entry.
Line 1030 returns the related text in REL$ with no display nor entry.
Line 1040 displays CW20.WEBLINK$[3] @(COL,ROW)
Line 1050 will prompt operator to enter field MODE and include an F4 option.