|
I guess it depends on what you want to happen when the character is
"incremented". If you just want to add one to the EBCDIC value of the
letter, you can do that easily by overlaying the character in a data
structure.
D ds
D char 1a
D ebcval 3u 0 overlay(char)
CHAR = 'A';
EBCVAL += 1;
After this code runs, CHAR would contain 'B'. (Because the EBCDIC value
for A is 193. Add 1, you get 194. The EBCDIC value for B is 194)
However, if you add 1 to 'I', you will NOT get 'J', since I is 201 and J
is 209 in EBCDIC, they aren't contiguous. And this is why folks are apt
to use an array for this sort of thing.
Robert Munday wrote:
Greetings from sunny Florida (where it has thunderstormed every day for thepast five weeks).
value?
Without using arrays (I can do that), is there a way to increment a character
two-character suffix to a field which increments `AA`, `AB`, `AC` etc.
CHAR = 'A';
CHAR += 1;
does not work, but is there something similar which would? I am adding a
--
This is the RPG programming on the AS400 / iSeries (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.