IF pfrom CA '*' OR pto CA '*'.
wildcard = '1'.
prange-sign = 'I'.
prange-option = 'CP'.
prange-low = pfrom.
APPEND prange.
EXIT.
ENDIF.
IF NOT pto IS INITIAL
AND NOT pfrom IS INITIAL.
prange-sign = 'I'.
prange-option = 'BT'.
prange-low = pfrom.
prange-high = pto.
APPEND prange.
ELSEIF NOT pfrom IS INITIAL.
prange-sign = 'I'.
prange-option = 'EQ'.
prange-low = pfrom.
APPEND prange.
ELSEIF NOT pto IS INITIAL.
prange-sign = 'I'.
prange-option = 'BT'.
CLEAR pfrom.
prange-low = pfrom.
prange-high = pto.
APPEND prange.
ENDIF.
wildcard = '1'.
prange-sign = 'I'.
prange-option = 'CP'.
prange-low = pfrom.
APPEND prange.
EXIT.
ENDIF.
IF NOT pto IS INITIAL
AND NOT pfrom IS INITIAL.
prange-sign = 'I'.
prange-option = 'BT'.
prange-low = pfrom.
prange-high = pto.
APPEND prange.
ELSEIF NOT pfrom IS INITIAL.
prange-sign = 'I'.
prange-option = 'EQ'.
prange-low = pfrom.
APPEND prange.
ELSEIF NOT pto IS INITIAL.
prange-sign = 'I'.
prange-option = 'BT'.
CLEAR pfrom.
prange-low = pfrom.
prange-high = pto.
APPEND prange.
ENDIF.