Setting the Filter Parameter Value
You can use the following methods to set the value of a filter parameter:
-
Method 3: Set the Parameter Marker with the USEEARLYBINDFILTERS Function
-
Method 4: Set the Filter Parameter Value with the SETFILTERPARAM Function
Method 1: Supply a Literal Value
Supply a literal value—for example, (EMP-EMP-STATUS = 'FT').
This example assumes that a table called FILTER with the prefix FLT is set up with two fields. A is an alpha field of length 3 and S is a signed numeric field.
|
Method 2: Use the Set Filter Value API Routine
Set a value with 890-SET-<Type>-FILTER-VALUE
after calling 890-CREATE-FILTER
. In this case, the FILTER-STRING
statement includes the "?"
parameter marker syntax. For example:
|
Method 3: Set the Parameter Marker with the USEEARLYBINDFILTERS Function
For more information about using USEEARLYBINDFILTERS, see Additional Guidelines for Filters and Sample Filter.
The value of a parameter marker (the ? syntax) can be set before calling 890-CREATE-FILTER if you use the USEEARLYBINDFILTERS function. This function lets the run-time system know that the program will be setting values before the filter is created. This setting remains in effect until you call 890-CREATE-FILTER. 890-CREATE-FILTER changes this setting back to the default behavior.
Call USEEARLYBINDFILTERS and then set a value with 890-SET-<Type>-FILTER-VALUE before calling 890-CREATE-FILTER. For example:
|
Method 4: Set the Filter Parameter Value with the SETFILTERPARAM Function
Bind the parameter to a working storage field with SETFILTERPARAM. For example:
|