Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strqmqry /passing variables

Status
Not open for further replies.

Pekka

Technical User
Mar 19, 2002
107
FI
Hello there,
this is not exatly db2 issue but if somebody is familiar with As/400 query manager and could help.
Here is the simple example of the query:
SELECT * FROM libl39/cipname0 A WHERE cuno=&cuno
Here is the cl:
PGM PARM(&CUNO)
DCL (&CUNO) (*CHAR) LEN(7)
CHGVAR VAR(&CUN) VALUE(&CUNO)
STRQMQRY QMQRY(DSP_PF) SETVAR((CUNO &CUNO))

Problemo:
Why doesn't this cl pass the parameter to query but is allways prompting the variable cuno?
 
Try build the entire string:

Your QMQRY looks like

SELECT * FROM MYLIB/EMPLOYEE WHERE EFEMNO &QEMNO

your CLP looks like

PGM PARM(&EMNO)
DCL VAR(&EMNO) TYPE(*CHAR) LEN(5)
DCL VAR(&STRING) TYPE(*CHAR) LEN(10)

CHGVAR VAR(&STRING) VALUE('=' *BCAT &EMNO )
STRQMQRY QMQRY(MYLIB/TEST) OUTPUT(*) SETVAR((QEMNO &STRING))

ENDPGM
 
Try removing the table qualifier ("A") from your filename. The system may think cuno is a variable as opposed to the column name (A.cuno).

VTJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top