|
Yes, and there is tricks like using hex codes for the apostrophe. For
example:
DCL &APOS *CHAR 1 /* Apostrophe */
...
CHGVAR VAR(&APOS) VALUE(X'7D')
...
CHGVAR VAR(&LIBRARYQ) VALUE(&APOS *TCAT &LIBRARY +
*TCAT &APOS)
Rob Berendt
==================
Remember the Cole!
D.BALE@handleman.
com To: RPG400-L@midrange.com
Sent by: cc:
owner-rpg400-l@mi Subject: Re: Call Query
drange.com
10/24/00 09:25 AM
Please respond to
RPG400-L
Evan,
If I have to use numeric variables in a QRYSLT, I always build the QRYSLT
in a
variable and then specify: QRYSLT(&QRYSLT)
The other trick I learned a long time ago which I still see coders
struggling
with is when a character value needs to be enclosed in quotes, they use
three
single quotes on each end of the value which, to me, is hard to read. I
use
double quotes instead.
QRYSLT( &STATUS *EQ '''A''' )
* vs. *
QRYSLT( &STATUS *EQ "A" )
Dan Bale
IT - AS/400
Handleman Company
248-362-4400 Ext. 4952
-------------------------- Original Message --------------------------
Dan
>Can't say I've seen a lot of list activity asking about substringing
numerics,
>but I will opine here and say that if you have to substring a numeric
>variable, then it shouldn't be a numeric variable.
I think Rob's referring to when you are trying to include numeric
comparison's in a QRYSLT string. I can recall seeing a few of these float
through here and midrange-l.
All that substringing, concatenation and extra quote business seems to
throw a few people. It made more sense to me after I unravelled the
mysteries of passing parameters into QMQRY (now there's a way to get claw
marks on your head).
Perhaps a good idea would be to write a front-end RPG to pass a
pre-formatted string into a CL that would use OPNQRYF to output the data
into a pre-formatted work file. Then it would be a simple matter of
formatting the report using Query.
To improve things even further you could output to a multi-member file and
pass the member into the queries file name prompt. This would allow many
users to run their queries at the same time.
Of course for the front-end RPG you'd have to create a command so that the
numeric variables didn't fail due to not being passed correctly on the
command line.
Let's see - CMD, RPG, CL, Query..... Nah, I think I'll just write a report
in RPG using O-Specs and a do-until loop.......
:)
Cheers
Evan Harris
P.S.I had one of those days too - this has helped
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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.