× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: OPNQRYF quru needed
  • From: thomas@xxxxxxxxxxx
  • Date: 14 Jun 2001 20:26:24 -0700

Sam:

You are comparing a zoned numeric field STYLE# with a character literal 
("100"). The same is also being done against L4AMT against ("0"). Drop the two 
(*CAT &DQ)s around the compare values and try it again. By putting the compare 
values inside double-quote marks, you're defining character constants where you 
want numeric constants without quotes.

Since a numeric field value cannot be compared directly to a character 
constant, you receive the error that one of the operands for *GT is incorrect. 
The system doesn't know which one is incorrect, so that's as far as it can tell 
you even though the message could give a bit more info.

Tom Liotta

On Thu, 14 June 2001, "Sam Kanakanui" wrote:

> 
> Hi,
> I have been struggling with an OPNQRYF problem for the better part of a day
> now.  I have included some code excerpts below if anyone  would care to tell
> me what I am doing wrong.  I have put the QRYSLT parm in a variable (which I
> learned from this list) for readability.  Any help would be gratly
> appreciated.
> 
> File layout of fields:
>            Data        Field  Buffer    Buffer        Field    Column
>  Field      Type       Length  Length  Position        Usage    Heading
>  .
>  .
>  STYLE#     ZONED        4  0       4        11        Both     STYLE#
>  L4AMT      ZONED       10  2      10        15        Both     L4AMT
>  .
>  .
>  MIMRGO     CHAR            1       1       260        Both     MIMRGO
>   Coded Character Set Identifier  . . . . . :     37
> 
> The CL code is as follows:
> DCL        VAR(&DQ) TYPE(*CHAR) LEN(1) VALUE('"')
>  DCL        VAR(&BLANKS) TYPE(*CHAR) LEN(1) VALUE(' ')
>  CHGVAR     VAR(&SELECT) VALUE('STYLE# *GT ' *CAT &DQ +
>               *CAT '100' *CAT &DQ *CAT ' *AND MIMRGO +
>               *EQ ' *CAT &DQ *CAT &BLANKS *CAT &DQ *CAT +
>              ' *AND L4AMT *GT ' *CAT &DQ *CAT '0' +
>               *CAT &DQ *CAT ' ')
> 
>  OPNQRYF    FILE((QTEMP/CSFMWEEK)) QRYSLT(&SELECT) +
>               KEYFLD((QTYUOM) (SAMCOD) (STYLE#) +
>               (O#FVAR) (PGROUP) (PATERN))
> 
> The error I get when running this is:
> Message ID . . . . . . :   CPD3131       Severity . . . . . . . :   30
> 
>  Message type . . . . . :   Diagnostic
> 
>  Date sent  . . . . . . :   06/13/01      Time sent  . . . . . . :
> 12:51:44
> 
> 
>  Message . . . . :   Operand for *GT function not valid.
> 
>  Cause . . . . . :   The operator or built-in function *GT, was specified at
> 
>    position 8 in the expression on the QRYSLT parameter.  If the error
> occurred
>    on the MAPFLD parameter, the expression was specified for the definition
> of
>    field *N.  For the %RANGE, %VALUES, and %WLDCRD built-in functions, the
> 
>    error may be caused by the first operand for the *EQ operator that is
> 
>    associated with the built-in function.  Conditions that can cause this
> error
>    include:

-- 

___________________________________________________
The ALL NEW CS2000 from CompuServe
 Better!  Faster! More Powerful!
 250 FREE hours! Sign-on Now!
 http://www.compuserve.com/trycsrv/cs2000/webmail/




+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.