890-CREATE-FILTER

Name

890-CREATE-FILTER

Description

Creates the filter, based on the value of the FILTER-STRING variable.

Using the API in a Program

Before calling the API, set the FILTER-STRING variable with a conditional statement.

Use the "?" symbol for any variables to be set at run time.

Input Values

Field Description

FILTER-STRING

Set this parameter using a method described in Setting the Filter Parameter Value, and create the filter using the routine described in 890-CREATE-FILTER.

Return Values

None.

Programming Example

The following code shows a filter that allows a user to enter "to" and "from" values for ARO-DUE-DATE. Because the filter values are set before the call to 890-CREATE-FILTER, the USEEARLYBINDFILTERS function is used.

CALL "USEEARLYBINDFILTERS" USING WS-TRUE.
IF (AR90F1-SEL-DUE-DATE-FROM    > ZEROS)
    STRING "(ARO-DUE-DATE >= ?)" DELIMITED BY SIZE
           INTO FILTER-STRING
           POINTER AR90WS-FILTER-LENGTH
    MOVE AR90F1-SEL-DUE-DATE-FROM    TO DATETIME-FILTER-VALUE
    PERFORM 890-SET-DATETIME-FILTER-VALUE.
IF (AR90F1-SEL-DUE-DATE-TO      > ZEROS)
    STRING " AND (ARO-DUE-DATE <= ?)" DELIMITED BY SIZE
           INTO FILTER-STRING
           POINTER AR90WS-FILTER-LENGTH
    MOVE AR90F1-SEL-DUE-DATE-TO      TO DATETIME-FILTER-VALUE
    PERFORM 890-SET-DATETIME-FILTER-VALUE.
PERFORM 890-CREATE-FILTER.
PERFORM 850-FILTERNLT-AROSET5.