QMQRY not a valid Query Management variable.

25 pts.
Tags:
CL
CL programming
CL variables
QMQRY
STRQMQRY
Variables
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
ASKED: February 19, 2009  7:12 AM
UPDATED: February 23, 2009  11:23 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi Norm,

In your Program JOBX is a variable of type CHAR and it is a parameter too for executing it, then you should pass the parameter value enclosed in a single quotes like here :

CALL PGM(JCCSTREP2) PARM(‘C165′)

Try the above statement.

Regards,
Siva

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • NormFeile
    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
    25 pointsBadges:
    report
  • Sivu
    Norm, Try this!!! STRQMQRY QMQRY(JCCSTREP2) OUTPUT(*PRINT) + QMFORM(*QMQRY) SETVAR(JOB &JOBA) Regards, Siva
    105 pointsBadges:
    report
  • NormFeile
    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
    25 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following