|
I am trying to process an SQL state using the STRQMQRY command and passing variables. I'm want to update the field newdat with the value of the variable &ndate where the variable &empno equals the field empno in file cnvdate. The message I keep getting is. Message . . . . : Type a value for variable "ndate" and press Enter. Cause . . . . . : You want Query Management to use variable "ndate", but that variable does not exist in the global variable pool. Recovery . . . : Type a value for "ndate" and press Enter. The variable will be created with the value typed and will exist until the Query Management RUN QUERY command completes. The special value *BLANK can be typed if you want the value for variable "ndate" to be a single blank. The special value *NONE can be typed if you want variable "ndate" to have no value. If you press Enter without typing a value, or you press F3 (Exit) or F12 (Cancel), the RUN QUERY command will be ended. Can anyone tell me what I have wrong with the code below? Thanks CL Code: ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... *************** Beginning of data *********************************** .00 PGM .00 DCL VAR(&NDATE) TYPE(*CHAR) LEN(8) .00 DCLF FILE(BMEADE/WORKDATE) .00 READ: RCVF .00 MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(DONE)) .00 CVTDAT DATE(&NEW) TOVAR(&NDATE) FROMFMT(*JUL) + .00 TOFMT(*YYMD) TOSEP(*NONE) .00 .00 STRQMQRY QMQRY(BMEADE/CNVDATE) SETVAR((NDATE &NDATE) EMPNO &EMPNO)) .00 .00 GOTO READ .00 DONE: ENDPGM ****************** End of data ************************************** SQL : *************** Beginning of data ********** update bmeade/cnvdate set newdat=&ndate where empno = &empno ****************** End of data ************* Bernie
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.