Hi, Al:

It often helps to insert a line similar to the following, just prior to issuing the OPNQRYF statement:

SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA(&SELECT) +
TOPGMQ(*PRV (*)) MSGTYPE(*DIAG)

That way, you can see in the job log exactly what the selection criteria actually looked like.

You can also add this statement:

SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA(&SELECT) +
TOPGMQ(*EXT) MSGTYPE(*STATUS)

Then, you will see it on the message line when run interactively.

HTH,

Mark S. Waterbury

> Al Mac Wheel wrote:
My OPNQRYF statement is failing on CPF9899
"Missing Operator in Expression in QRYSLT parameter"

I am hoping that it jumps out to someone knowlegeable with this stuff, where MEKLUTZ has el typo, overlooked something obvious, or something missing from the syntax.

I don't use Open Query File often enough to be skilled at it.
I am on V5R1.

I copied this code from another CL that works, then I changed name of file, names of parameters, fields, tests, etc. to what was wanted, and in the process, probably missed some nuances with syntax. Key fields are transcribed from RARL94 DDS.

OVRDBF FILE(RARL94) SHARE(*YES)

CHGVAR VAR(&RI) VALUE('RI') /* Al not yet know +
other than RANGE lingo */

/* stuff in string of concatentations needs to be alpha format */
/* so change date from numeric YYYYMMDD to alpha equivalent */

CHGVAR VAR(&DATE1) VALUE(&P1DAT1)
CHGVAR VAR(&DATE2) VALUE(&P2DAT2)

/* we use 1st 3 characters for profit center */
/* but actual field in BPCS is 10 characters */

CHGVAR VAR(&SEVEN) VALUE(' ') /* 7 spaces */
CHGVAR VAR(&PRF1) VALUE(&P3PRF1 *CAT &SEVEN)

CHGVAR VAR(&SEVEN) VALUE('9999999') /* 7 nines */
CHGVAR VAR(&PRF2) VALUE(&P4PRF2 *CAT &SEVEN)

CHGVAR VAR(&SELECT) VALUE('RDATE = %RANGE(' *CAT +
&DATE1 *BCAT &DATE2 *CAT ')')

CHGVAR VAR(&SELECT) VALUE(&SELECT *BCAT '*AND RPRF +
= %RANGE(' *CAT &PRF1 *BCAT &PRF2 *CAT ')')

CHGVAR VAR(&SELECT) VALUE(&SELECT *BCAT '*AND RRID +
= %RANGE(' *CAT &RI *BCAT &RI *CAT ')')

OPNQRYF FILE((RARL94)) QRYSLT(&SELECT) +
KEYFLD((RDATE) (RCOMP) (RPRF) (RCUST) +
(ARODPX) (RINVC) (ARODTP) (ARODYR))
-
Al Macintyre



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-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.