I am facing an issue in Setvariable in QMQRY. My variable has trailing blanks, but while executing the query, those trailing blanks get suppressed. I dont want that to happen.
STRQMQRY QMQRY(mylib/query1) OUTPUT(*OUTFILE) OUTFILE(Qtemp/t1) setvar(STRING1 &str1) (STRING2 &Str2)
In this case
&STR1 = ‘SELECT FIELD05 from mylib/myfile where field01 '
&STR2 = ‘Like ”%efg%” ‘
I face issue with &STR1 where STRQMQRY trim the trailing blanks(one blank after the field01 at the end) when running the actual query and so it results in error.
Query1 has value &STRING1&STRING2
STRQMQRY QMQRY(mylib/query1) OUTPUT(*OUTFILE) OUTFILE(Qtemp/t1) setvar(STRING1 &str1) (STRING2 &Str2)
In this case
&STR1 = ‘SELECT FIELD05 from mylib/myfile where field01 '
&STR2 = ‘Like ”%efg%” ‘
I face issue with &STR1 where STRQMQRY trim the trailing blanks(one blank after the field01 at the end) when running the actual query and so it results in error.
Query1 has value &STRING1&STRING2
Comment