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




Does anybody has a sample program that write data to user space?  I've
written several apps to retrieve data from it but has never try to write
data to it.

I use pointers to access user spaces. To read them, you base a pointer on the appropriate spot in the user space, and read the data from a variable. To write, you change the value of that variable.

Aside from the pointer logic (which is the same whether you're reading or writing) the only difference is whether you make a change to the variable or not. Since you already know how to assign values to variables, you may not need sample code?


Did a bit research and it seems like QUSCHGUS is the only api that allow
me to change the data in user space.

Well, you can change it via a pointer, so I guess indirectly, the QUSPTRUS API lets you change data in a user space.

You sound surprised that there aren't more APIs that let you change a user space, and I'm not sure that I understand why. How many APIs do you need? Is there something you can't do with the existing one? There's also only one API that lets you read a user space (QUSRTVUS), why would writing be different?


If that is the case, how does the user space header get formatted? How can QUSCHGUS api guarantee each entry in the user space are the same length

User spaces have no notions of "entries" or "lengths". A user space is like one big huge data area. The difference is that a data area can only be 2000 bytes long, whereas a user space can be 16 million bytes long. Otherwise, they're very similar.

A user space has no built-in notion of "headers" or "entries" or "lengths". It's one big long mass of data.

Your program can choose to write blocks of data that have particular lengths. And you can choose to write a block of data that describes the other blocks that you might call a "header". The user space doesn't know that they're there, however. To the user space, it's all just a big mass of bytes. It has no clue what those bytes mean -- that's up to the program(s) to worry about.

Are you trying to create a user space that's interpreted by an API or something that needs a header? If so, make a BASED data structure that contains all of the header fields. Then, get a pointer to the user soace, and base the data structure on it. Finally, fill in the fields of the data structure (using a series of EVAL statements) so that the header contains the right data. Presto, you have a header! Though, again, I question why you'd want to do that, unless you're comminicating with some IBM software that requires it.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.