Validating Data: ACCEPT

How to:

Reference:

ACCEPT is an optional attribute that you can use to validate data as it is entered into a parameter prompt screen.

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.

The ACCEPT attribute supports the following types of operations:

Syntax: How to Validate Data

ACCEPT = list 
ACCEPT = value1 TO value2
ACCEPT = FIND (field [AS name] IN file)
ACCEPT=SYNONYM(lookup_field AS display_field IN lookup_synonym)
ACCEPT=FOCEXEC(lookup_field AS display_field IN lookup_focexec)

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 in MODIFY procedures for FOCUS data sources. For more information, see Describing a FOCUS Data Source.

SYNONYM

Looks up values in another data source and retrieves a corresponding display value. The lookup field values must exist in both data sources, although they do not need to have matching field names. You supply the name of the synonym, the lookup field name and the display field name.

FOCEXEC

Retrieves lookup and corresponding display values by running a FOCEXEC. Each row must return a lookup field value and its corresponding display field value anywhere in the row, in any order. You supply the name of the FOCEXEC, the lookup field name, and the display field name.

lookup_field

Is the field in the lookup_synonym or returned by the lookup_focexec whose value will be used in the filter (WHERE dialogue) or by the amper autoprompt facility that will be compared with the field that has the ACCEPT attribute.

display_field

Is the field in the lookup_synonym or returned by the lookup_focexec, whose value will be displayed for selection in the filter dialogue or amper autoprompt drop-down list.

lookup_synonym

Is the name of the synonym that describes the lookup data.

lookup_focexec

Is the name of the FOCEXEC that returns the lookup and display field values, in any order. This FOCEXEC can return other field values as well.

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'

Reference: Usage Notes for ACCEPT

Note the following rules when using ACCEPT:

  • Alias. ACCEPT does not have an alias.
  • Changes. You can change the information in an ACCEPT attribute at any time.
  • Virtual fields. You cannot use the ACCEPT attribute to validate virtual fields created with the DEFINE attribute.
  • HOLD files. If you wish to propagate the ACCEPT attribute into the Master File of a HOLD file, use the SET HOLDATTR command. HOLD files are discussed in the Creating Reports With TIBCO WebFOCUS® Language manual.
  • ACCEPT=FIND is used only in MODIFY procedures. It is useful for providing one central validation list to be used by several procedures. The FIND function is useful when the list of values is large or undergoes frequent change.