Validating Data: ACCEPT

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 procedure. The ACCEPT test is applied immediately after a FIXFORM 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.


Top of page

x
Syntax: How to Validate Data
ACCEPT = list 
ACCEPT = value1 TO value2 
ACCEPT = FIND (field [AS name] IN file)

where:

list
Is a string of acceptable values. The syntax is:
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.

value1 TO value2
Gives the range of acceptable values. For example, ACCEPT = 150 TO 1000.
FIND

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 Reporting Applications manual.



Example: Specifying a List With an Embedded Blank
ACCEPT = SPAIN OR ITALY OR FRANCE OR 'GREAT BRITAIN'

Top of page

x
Reference: Usage Notes for ACCEPT

Note the following rules when using ACCEPT:


WebFOCUS