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 space. Does that make sense?
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.