How to: Reference: |
ACCEPT is an optional attribute that you can use to validate data as it is entered into a field from a MODIFY or FSCAN procedure. The ACCEPT test is applied immediately after a FIXFORM CRTFORM, PROMPT, FIXFORM, or FREEFORM is processed after which subsequent COMPUTE statements can manipulate the value. By including ACCEPT in a field declaration, you can define a list or range of acceptable field values. In relational terms, you are defining the domain.
Note: Suffix VSAM and FIX data sources may use the ACCEPT attribute to specify multiple RECTYPE values, which are discussed in Describing a Sequential, VSAM, or ISAM Data Source.
ACCEPT = list ACCEPT = value1 TO value2 ACCEPT = FIND (field [AS name] IN file)
where:
value1 OR value2 OR value3...
For example, ACCEPT = RED OR WHITE OR BLUE. You can also use a blank as an item separator. If the list of acceptable values runs longer than one line, continue it on the next. The list is terminated by a comma.
Verifies the incoming data against the values in another indexed field. This option is available only for FOCUS data sources. For more information, see Describing a FOCUS Data Source.
Any value in the ACCEPT that contains an embedded blank (for example, Great Britain) must be enclosed within single quotation marks.
If the ACCEPT attribute is included in a field declaration and the SET command parameter ACCBLN has a value of OFF, blank ( ) and zero (0) values are accepted only if they are explicitly coded into the ACCEPT. SET ACCBLN is described in the Developing Applications manual.
ACCEPT = SPAIN OR ITALY OR FRANCE OR 'GREAT BRITAIN'
Note the following rules when using ACCEPT:
Information Builders |