User Space (*USRSPC)

150 pts.
Tags:
AS/400
As400 User Space
RPGLE Program
Hi, there is an As/400 object called User Space whose object type is *USRSPC and its attribute type is SQLRPTC. This has some SQL scripts. My job is to call this user space from my RPGLE program. Have you ever done such call to User Space? If so, please help me in doing this.
ASKED: May 28, 2013  4:49 AM
UPDATED: May 28, 2013  11:57 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    There are at least three general ways.
    .
    The first two ways use User Space APIs either to retrieve a pointer to the space with the Retrieve Pointer to User Space (QUSPTRUS) API and access space content by pointer offsets or to "read" blocks of bytes by multiple calls to the Retrieve User Space (QUSRTVUS) API while passing in a different byte offset each time.
    .
    A less likely third way is to use common IFS APIs, i.e., open(), read() and close(), to read the space as a streamfile, just like you might read a .TXT file. If you've done sockets programming, you might read the bytes from the space as if it was a socket.
    .
    However, it's not clear at all what the point is. It sounds like you might want to process a SQL script that someone built into a space. This might be done as a way to feed scripts into a dynamic SQL program. Or you might have something very different in mind. The intended usage might influence how you do the access.
    .
    I'd suggest simply declaring a based structure the describes the content, retrieving a pointer to the space and basing the structure on that pointer. From pont, your program effectively has the space content in its program variables.
    .
    Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following