×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




NDATE needs to be in uppercase in the SQL statement, or put apostrophes
around the lowercase name in STRQMQRY

At 11:14 AM 4/23/02 -0400, you wrote:
>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
>
>_______________________________________________
>This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
>To post a message email: MIDRANGE-L@midrange.com
>To subscribe, unsubscribe, or change list options,
>visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
>or email: MIDRANGE-L-request@midrange.com
>Before posting, please take a moment to review the archives
>at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.