|
Perhaps this will work for you?
dcode128 ds qualified
d filler 16a Inz('ABCDEFGHIJK12345')
D code128Table 1a Dim(16) overlay(filler)
From: "John McKee" <jmmckee@xxxxxxxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Date: 08/30/2011 01:59 PM
Subject: Array initialization
Sent by: midrange-l-bounces@xxxxxxxxxxxx
Maybe this should be on RPG list. Just seems so stupid.
In COBOL, I could do something like this:
01 CODE128.
05 FILLER PIC X(10) VALUE 'ABCDEFGHIJ'.
05 FILLER PIC X(1) VALUE 'K'.
05 FILLER PIC X(5) VALUE '12345').
01 CODE128TABLE REDEFINES CODE128.
05 CODE128-CHARACTER PIC X OCCURS 16 TIMES.
How do I do this in RPG IV? Specifically, in my example above, I will
need to put binary patters in some places, and printable characters in
others. I know that a DS can be used to do this. I am just stuck on how
to set the values in the DS. I thought the keyword was inz. But, even if
correct, that can't be used in a DS. What I would >like< to do is use
printed characters as much as possible and resort to the hex value only
when needed.
I would have just tossed it in as a compile time table, except for some
patters that are not printable characters. Could also do a brute force
initialization in C-specs - but if that could be avoided.....
John McKee
--
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, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
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, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
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.