Is it the OR that is causing the "problem"? Seems like you can "embed"
the extra this or that with parenthesis...I think.
Maybe....
*AND (ESSTUS +
*EQ "' *CAT 'P' *CAT '" *OR ESSTUS +
*EQ "' *CAT 'B' *CAT '" '))
Bentley Pearson
Vice President - Information Services
Southland National Insurance Corporation
1812 University Blvd
Tuscaloosa, Al
35403
205 345 7410
bpearson@xxxxxxxxxxxxxxxxxxxxx
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Robert Ostrowski
Sent: Friday, August 21, 2009 10:49 AM
To: midrange-L@xxxxxxxxxxxx
Subject: OPNQRYF question
I can't figure out why this won't work...
Before I changed the OPNQRYF:
QSYS/OPNQRYF FILE((*CURLIB/ESTFIL)) QRYSLT('ESDIV *EQ "' +
*CAT &DIV *CAT '" *AND ESBTYP *EQ '' '' +
*AND ESSLMN *GE ' *CAT &SLMN1 *CAT ' *AND +
ESSLMN *LE ' *CAT &SLMN2 *CAT ' *AND +
ESDDTE *GE ' *CAT &FROM1 *CAT ' *AND +
ESDDTE *LE ' *CAT &TO1 *CAT ' *AND ESSTUS +
*EQ "' *CAT &STAT *CAT '" ') +
KEYFLD((ESDIV *ASCEND) (ESSLMN) (ESDDTE +
*DESCEND) (ESEST#))
After my change:
QSYS/IF COND((&STAT *EQ 'P') *OR (&STAT *EQ 'B')) THEN(DO)
QSYS/OPNQRYF FILE((*CURLIB/ESTFIL)) QRYSLT('ESDIV *EQ "' +
*CAT &DIV *CAT '" *AND ESBTYP *EQ '' '' +
*AND ESSLMN *GE ' *CAT &SLMN1 *CAT ' *AND +
ESSLMN *LE ' *CAT &SLMN2 *CAT ' *AND +
ESDDTE *GE ' *CAT &FROM1 *CAT ' *AND +
ESDDTE *LE ' *CAT &TO1 *CAT ' *AND ESSTUS +
*EQ "' *CAT 'P' *CAT '" *OR ESSTUS +
*EQ "' *CAT 'B' *CAT '" ') +
KEYFLD((ESDIV *ASCEND) (ESSLMN) (ESDDTE +
*DESCEND) (ESEST#))
ENDDO
If the &STAT variable is P or B, they want to see on the report where
the ESSTUS field
Is P (Pending) or B (Bidding).
If I end up getting EVERYTHING in the file when there should only be a
few records.
Bob Ostrowski | Senior Programmer/Analyst
TRAINOR GLASS COMPANY | National - IT
11901 S. Austin Ave. | Alsip, IL 60803
T 708.293.4218 | F 708.293.6218
bob.ostrowski@xxxxxxxxxxxxxxxx
<mailto:firstname.lastname@xxxxxxxxxxxxxxxx> | www.trainorglass.com
<
http://www.trainorglass.com>
Project Management On-Line <
http://webapps.trainorglass.com/> | View
your project's progress and communicate with your project manager
As an Amazon Associate we earn from qualifying purchases.