Scott, yes you are correct, the code is from you and I did find it in the
archives!  I did also credit the source of the code is a previous post.  I
did figure out that the data structure was part of the "list" format used by
many IBM commands.  I've got my problems all straightened out and even
learned a few new things along the way.  Thanks for your responses today and
6 years ago!!!

Carl J. Galgano
EDI Consulting Services, Inc.
600 Kennesaw Avenue, Suite 400
Marietta, GA  30060
(770) 422-2995 - voice
(419) 730-8212 - fax
AS400 EDI, Networking, E-Commerce and Communications Consulting and
Premium Ice Cream Brands shipped Overnight

Visit our website to subscribe to our FREE AS/400 Timesharing Service

-----Original Message-----
From: Scott Klement [mailto:klemscot@xxxxxxxxxxxx] 
Sent: Monday, March 22, 2004 7:25 PM
To: Midrange Systems Technical Discussion
Subject: RE: Record size limitation in RPG - MQ Series/User Spaces

Hi Carl,

>  D p_UsrSpc        S               *
>  D dsLH            DS                   BASED(p_UsrSpc)
>  D   dsLHFill1                  103A
>  D   dsLHStatus                   1A
>  D   dsLHFill2                   12A
>  D   dsLHHdrOff                  10I 0
>  D   dsLHHdrSiz                  10I 0
>  D   dsLHLstOff                  10I 0
>  D   dsLHLstSiz                  10I 0
>  D   dsLHEntCnt                  10I 0
>  D   dsLHEntSiz                  10I 0
> For some strange reason, dsLHFill1 contains the 1st 103 characters of 
> my data.  I am passing the value of dsLHLstOff as the pointer to my 
> buffer data.  This program is using a 3.7 ILE compiler.  I know I am 
> close, but unsure what to do next.  I thought the value of dsLHLstSiz 
> would contain the length of my user space, but it does not.

That code looks familiar! :)  (I wrote that code 6 years ago.. you must've
found it in the archives)

That data structure is returned by many of IBM's APIs... the APIs that they
call "List APIs" return data in that format.

However, in your case, you're populating the user space yourself rather than
asking IBM's list APIs to populate it.  So, it won't be in that format
(unless you specifically write it that way.)

A user space is merely a big flat space.  If you have a user space that's
4mb in size, it's like having a file with a single record that's 4mb long,
and with no external definition.   You can put absolutely any data that
you want into the user space -- there's no predefined format whatsoever.

In this case, you've got a pointer to the start of your user space.  Any
variable that's based on that pointer will occupy the same memory as the
start of your user space.  You can store any data you like in that area, and
when you view that variable it'll be populated with the underlying bytes
that are in the user space.

And that's what you've done here... you've loaded your message into the user
space, and then used that dsLH data structure to view that data. What you'll
see in that structure is the bytes that happen to be in that part of the

Does that make sense?

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2022 by 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.