V7R1 Qryslt in CLP

1380 pts.
Tags:
AS/400
We are having issues with qryslt in clp on V7R1. The code does this: CHGVAR VAR(&QRYSLT) VALUE('T1ORDR *NE '' ''') CHGVAR VAR(&QRYSLT) VALUE(&QRYSLT *TCAT ' *AND + %CHAR(T1DATE "*ISO") *GE ' *CAT '''' *CAT + &SDATE *CAT '''' *CAT ' *AND %CHAR(T1DATE + "*ISO") *LE ' *CAT '''' *CAT &EDATE *CAT + '''') OPNQRYF FILE((QTEMP/POE79WS)) OPTION(*INP) + QRYSLT(&QRYSLT) KEYFLD((T1DATE) (T1LOAD)) We get this messageon the OPNQRYF statement: CPD3131 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:

Software/Hardware used:
as/400 CLP V7R1

Answer Wiki

Thanks. We'll let you know when a new response is added.

I cannot prove it ran before, but this is what fixed it.

From this:

CHGVAR     VAR(&QRYSLT) VALUE(‘T1ORDR *NE ” ”’)

To this:
CHGVAR     VAR(&QRYSLT) VALUE(‘T1ORDR > 0′)    

 

I think someone else put the *iso in the second chgvar command.  Thanks anyway.

Nick

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    And the code ran in a previous version of the Op Sys?  Odd that it says the error is on code for *GT and you don't use *GT in this query. 
    50,425 pointsBadges:
    report
  • TomLiotta
    It also said "position 8", and that matches my count for the position of *LE. What was the message ID? -- Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Your change makes sense if T1ORDR is a numeric field.   There may be less casting of variables done in OPNQRYF under v7r1 although I doubt that was the intention.   The error listing still baffels us.
    50,425 pointsBadges:
    report
  • TomLiotta
    If the change worked and T1ORDR is numeric, the change does make sense. It certainly doesn't make sense that it worked before the 7.1 upgrade, especially a comparison to a blank. That is, unless the field definition itself also changed around the time of the upgrade.   Interesting that the original was "*NE" and the eventual working version was ">" (i.e., "*GT").   You might slightly simplify the second CHGVAR:   CHGVAR     VAR(&QRYSLT) VALUE( &QRYSLT *TCAT ' *AND +             %CHAR(T1DATE "*ISO") *GE ''' *CAT &SDATE +             *CAT ''' *AND %CHAR(T1DATE "*ISO") *LE +             ''' *CAT &EDATE *CAT '''' )   Tom
    125,585 pointsBadges:
    report
  • NickHutcheson1
    Another programmer had changed the source without documenting or telling me.  So, what I first saw was not the way it was when the error popped.  Argggh!nick
    1,380 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following