Thank you Charles. Way simpler than I thought it would be. Still have to convert decimal to hex, but that is easy enough.

John McKee
-----Original message-----
From: Charles Wilt charles.wilt@xxxxxxxxx
Date: Wed, 31 Aug 2011 15:42:15 -0500
To: Midrange Systems Technical Discussion midrange-l@xxxxxxxxxxxx
Subject: Re: AW: Array initialization

inz(x'61')

decimal 91 = hex 61

Charles

On Wed, Aug 31, 2011 at 4:24 PM, John McKee <jmmckee@xxxxxxxxxxxxxx> wrote:

-----Original message-----
From: "Birgitta Hauser" Hauser@xxxxxxxxxxxxxxx
Date: Wed, 31 Aug 2011 00:05:34 -0500
To: "'Midrange Systems Technical Discussion'" midrange-l@xxxxxxxxxxxx
Subject: AW: Array initialization

The following definition is also possible:

D Code128
D                  1A    inz('A')
D                  1A    inz('B')
D                  1A    inz('C')
  etc.
D ArrCode 128      1A    Dim(16) Overlay(Code128)

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von
Tommy.Holden@xxxxxxxxxxxxxxxxxxxxx
Gesendet: Tuesday, 30. August 2011 21:13
An: Midrange Systems Technical Discussion
Betreff: Re: Array initialization

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@midrangecom>
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


Thanks all.  I do appreciate it.

I have eight odd values that need to be added to this table.  They don't have ASCII or EBCDIC representations.  This table is to be used to produce a Code 128 mode B check character, if anybody is wondering.

The last codes are:

 95    DEL
 96   FNC3
 97   FNC2
 98   SHIFT
 99   Code C
100  FNC4
101  Code A
102   FNC1

The left column does not represent hex values.  Easy enough, based on what I remember from COBOL and what you have already told me about dealing with packing numbers, do do in the C-specs.  Is there a way to use inz to set a variable (length 1 character) to one of the left column values, such as 97?

Times like this make me feel like I need to go back to school.  But, this system is being scrapped in a year, for something "better", and my involvement has not been defined.  It would be nice to get this barcode project done - if for no other reason than to have done it.

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 thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.