1,380 pts.
 V7R1 Qryslt in CLP
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
ASKED: September 4, 2012  2:43 PM

Answer Wiki:
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
Last Wiki Answer Submitted:  September 4, 2012  4:56 pm  by  NickHutcheson1   1,380 pts.
All Answer Wiki Contributors:  NickHutcheson1   1,380 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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. 

 44,200 pts.

 

It also said “position 8″, and that matches my count for the position of *LE. What was the message ID? — Tom

 108,330 pts.

 

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.

 44,200 pts.

 

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

 108,330 pts.

 

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