Hi there,
I am trying to pass parameters to QMQRY but get the following error.
CALL PGM(JCCSTREP2) PARM(C165)
'C165' is not a valid Query Management variable.
Error found on STRQMQRY command.
CPF0001 received by JCCSTREP2 at 2800. (C D I R)
the CL pgm that call the query is as follows:
PGM PARM(&JOBX)
DCL VAR(&JOBX) TYPE(*CHAR) LEN(4)
DCL VAR(&JOBA) TYPE(*CHAR) LEN(6)
CHGVAR VAR(&JOBA) VALUE('''' *CAT &JOBX *CAT +
'''')
OVRPRTF FILE(QPQXPRTF) TOFILE(QGPL/JCCSTREP2) +
PAGESIZE(*N 257)
STRQMQRY QMQRY(JCCSTREP2) OUTPUT(*PRINT) +
QMFORM(*QMQRY) SETVAR(('JOB') (&JOBA))
ENDPGM
Can someone help me with the correct syntax...Im goin bananas.Cheers Norm
Software/Hardware used:
ASKED:
February 19, 2009 7:12 AM
UPDATED:
February 23, 2009 11:23 PM
Hi Siva,
Thanks for your response. Im trying to replicate PARM(‘C165′) in my CL hence the ”” *CAT &JOB *CAT””
Which from my understanding is supposed to emulate the statement you have written?
The idea is that the user doesn’t have input apostrophes when they input the parameter value C165.
Is there a way to do this using CL and QMQRY?
Much appreciated
Cheers Norm
Norm,
Try this!!!
STRQMQRY QMQRY(JCCSTREP2) OUTPUT(*PRINT) +
QMFORM(*QMQRY) SETVAR(JOB &JOBA)
Regards,
Siva
gave it go..
here is the code:
PGM PARM(&JOBX)
DCL VAR(&JOBX) TYPE(*CHAR) LEN(4)
DCL VAR(&JOBA) TYPE(*CHAR) LEN(6)
CHGVAR VAR(&JOBA) VALUE(”” *CAT &JOBX *CAT +
””)
OVRPRTF FILE(QPQXPRTF) TOFILE(QGPL/JCCSTREP2) +
PAGESIZE(*N 257)
STRQMQRY QMQRY(JCCSTREP2) OUTPUT(*PRINT) +
QMFORM(*QMQRY) SETVAR(JOB &JOBA)
ENDPGM
here is the Joblog:
CALL PGM(JCCSTREP2) PARM(C165)
2600 – OVRPRTF FILE(QPQXPRTF) TOFILE(QGPL/JCCSTREP2) PAGESIZE(*N 257)
2800 – STRQMQRY QMQRY(JCCSTREP2) OUTPUT(*PRINT) QMFORM(*QMQRY)
SETVAR((JOB) (”’C165”’))
‘C165′ is not a valid Query Management variable.
Error found on STRQMQRY command.
CPF0001 received by JCCSTREP2 at 2800. (C D I R)
Still no luck…
Cheers Norm