|
-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Kurt Anderson
Envoyé : vendredi 27 mars 2009 16:25
À : 'RPG programming on the IBM i / System i'
Objet : RE: SQL find hexadecimal values in a given range
d test c
x'000102030405060708090A0B0C0D0E0F10-
d
1112131415161718191A1B1C1D1E1F202122-
d
232425262728292A2B2C2D2E2F3031323334-
d 35363738393A3B3C3D3E3FFF'
My Websphere verifier is ok with it.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of David FOXWELL
Sent: Friday, March 27, 2009 10:00 AM
To: RPG programming on the IBM i / System i
Subject: RE: SQL find hexadecimal values in a given range
Can someone help me out here :
I want to declare the constant
x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D
1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C
3D3E3FFF'
But I can't seem to get the syntax right for it to occupy
several lines of source. Without the 'X' I can do it.
-----Message d'origine-----conversion,
De : midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de Vern Hamberg
Envoyé : jeudi 26 mars 2009 17:28 À : Midrange Systems Technical
Discussion Objet : Re: SQL find hexadecimal values in a given range
David
I really don't think SQL is the tool for this - if this is about
replacing non-displayable characters. You would be better off using
the %xlate function, I think. It is useful for simple case
but you could set up 2 constantsremember that
- the first would be something like
x'000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D
1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C
3D3E3FFF'
and the other would be all blanks and the same length -
the above value is in HEX, so it is 2 hex digits for each"character"
or byte - you need the same number of blanks as there arebytes above.
Then use %xlate - I don't have the exact syntax right in myhead - get
the ILE RPG manual. %xlate will do the read through theentire string
and do the replace for you.please take
I do hope there is an easier way!!
HTH
Vern
David FOXWELL wrote:
This will show the first position and all rows containingthe value hex 40.
WHERE locate(
SELECT locate( X'40', myfield, 1), myfield FROM myfile
X'40', myfield)>0--
How can I find hex values less that 40?
Thanks
This is the Midrange Systems Technical Discussion
(MIDRANGE-L) mailing list To post a message email:
MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list
options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
a moment to review the archives at--
http://archive.midrange.com/midrange-l.
This is the RPG programming on the IBM i / System i
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.