I am using a variable to store my query select statement for a OPNQRYF operation defined as QSEL *char len(500).
To add a statement I use
CHGVAR %SST(&QSEL &INDEX 10) VALUE(&month
CHGVAR &INDEX VALUE(&INDEX + 11)
inside a DOUNTIL statement to multiple dates.
I.e
(&month='03') *or (&month='04')*or ...
The operation does fine when the difference between months is 1 but when the difference is more than 1 I receive a "Range of Subscript value or Character String Error" message. The difference between months can be > 1 because the user will be the one to enter the date.
&INDEX *DEC LEN(3 0) VALUE(001)
To add a statement I use
CHGVAR %SST(&QSEL &INDEX 10) VALUE(&month
CHGVAR &INDEX VALUE(&INDEX + 11)
inside a DOUNTIL statement to multiple dates.
I.e
(&month='03') *or (&month='04')*or ...
The operation does fine when the difference between months is 1 but when the difference is more than 1 I receive a "Range of Subscript value or Character String Error" message. The difference between months can be > 1 because the user will be the one to enter the date.
&INDEX *DEC LEN(3 0) VALUE(001)