× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



If you have the hex value in character format already, it would just be
liblist = 'bb' + liblist;. If you need to do the conversion of your
counter to hex, I think you can create a data structure that has a two
byte numeric field as the first sub field (my head exploded several
hours ago so I'm not going to look up that part) and then another sub
field for the character part. You should be able to pass the data
structure to whatever needs it at that point in the proper format.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Joe D
Sent: Wednesday, January 17, 2007 11:25 PM
To: RPG programming on the AS400 / iSeries
Subject: Programmatically Building List of Values for a CMD

Hi All,

I am using an RPG App to build a list of libraries that will be used by
a CMD that accepts multiple values for Library.  The CMD has defined the
parm as 10A with Min(1) and Max(10).  My program is building the list
just fine.

Maybe I am just losing my mind, but what I am having trouble with is the
first two bytes of the parameter which lists the libraries.  For CMDs
that accept multiple entries on a parameter, the first two bytes hold a
hex value containing the number of values actually entered.

For example in the CMD...
CHKLIBS LIBS('TEST' 'LIVE' 'JDDEV')

...the value actually passed to the calling program would be:
'bbTEST      LIVE       JDDEV      '

bb represents a two-byte representation of 3, the number of 10A values
being passed in this example.

Maybe it is just the lateness of the day, but I am not sure how to get
the counter value I have encoded into a two-byte hex value that can be
concatenated to the front of my library list parameter in free format.

Sorry for such a basic question, but my head is about to explode.

Thanks,
JD

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.