|
I am converting some Query/400 queries to AS/400 Query Management queries as a way to learn Query Management and I need some help. Running on an S20 with V4R2M0 and current on ptf's. I am having trouble getting a STRQMQRY query/form with variables to work within a CL program. There is a sample in the DB2 for AS/400 Query Management Programming book using numeric & character variables but my variable is a date field defined as *ISO Type L in the DDS. I have a "from" and "thru" date I am entering to pick out the date range of transactions I want to print. When I create the variables in the CL program, I get the error message "QWM2701 - STRQMQRY has failed". I "D" the message and look at the variables & they look okay. Seeing as how the field being compared to is an *ISO date field & the variables are defined as TYPE(*CHAR) LEN( 8), is that my problem or does it have nothing to do with that. I even defined the variables as LEN(10) and that didn't help. Starting to get desperate in trying to understand my problem. Running the query interactively & entering the variables as 19990601 & 19990630 gives me the error "Comparison operator >= operands not compatible". Running the query interactively & entering the variables as '19990601' & '19990630' gives me the error "Syntax of date, time, or timestamp value not valid". Running the query interactively & entering the variables as '1999-06-01' & '1999-06-30' and it works just fine. So I CHGVAR in the CL program to get to this format and it still fails. The book talks about extra quotes being needed but doesn't tell you why so I keep running the CL and Dumping the variables when it fails but I still can't get it to work.<NAVBG> FEU displays the data as '1999-06-03' or whatever date is in the record. I have two other queries similar to this except there the date fields are defined as numeric and the variables are created like '19990601' & '19990630' and they work correctly. I have spent several hours trying to figure this out & I am no closer now than when I started, just more frustrated. Any idea as to what I need to correct to get this to work? TIA Dilbert's Words Of Wisdom: "I love deadlines. I especially like the whooshing sound they make as they go flying by." Dennis Munro Badger Mining Corporation dmunro@badgerminingcorp.com <mailto:dmunro@badgerminingcorp.com> +--- | 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 mailing list archive is Copyright 1997-2025 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.