Troubleshooting
Problem
Receiving a msgQWM1913 even though are are using the SETVAR parameter of STRQMQRY.
Symptom
You have set up your Query Management to have variables to make your SQL statement reusable but you are getting a msgQWM1913 even though you are passing that variable in via the SETVAR parameter.
Resolving The Problem
Message QWM1913 is received even though values are being passed using the SETVAR parameter of the STRQMQRY command. Why?
The error message can be resolved by properly using variable substitution.
The most common problem is that the variable names in the SQL statement are not in uppercase.
Example that works:
Query Management statement: SELECT * FROM &LIB.&FILE WHERE COL1 = &IN1
- three variables: &LIB, &FILE, &IN1
STRQMQRY QMQRY(-yourQM-)
SETVAR((LIB -yourlib-) (IN1 2) (FILE -yourtable-)
-- notice that it is &LIB and &FILE, etc. The entire variable name is in uppercase.
Example that does not work:
Query Management statement: SELECT * FROM &lib.&file WHERE COL1 = &IN1
- three variables: &lib, &file, &IN1
-- notice that it is &lib and &file, etc. The entire variable name is in lowercase
STRQMQRY QMQRY(-yourQM-)
SETVAR((LIB -yourlib-) (IN1 2) (FILE -yourtable-)
This will still prompt you (msgQWM1913) for &lib and &file
Historical Number
11575622
Was this topic helpful?
Document Information
Modified date:
18 December 2019
UID
nas8N1018397