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



Your code is wrong. It should look like this:

RTVJOBA CURUSER(&USERID)

The "USER" parameter is the user component of the jobid. So if the jobid is 123456/QUSER/FOO then USER will be QUSER. Server jobs (and these days, lots of other jobs) will be started before they know what the userid is. So the job name will reflect the user who started the job, rather than the currently active user profile.

Therefore, you need RTVJOBA CURUSER() to get the current user, and not RTVJOBA USER() which gets the user component of the job id.

-SK


DLee@xxxxxxxx wrote:
I'm developing an application to retreive iSeries data thru a stored procedure and return a result set back to the c# program that called the stored procedure.

I have debug set to program SETCLRLIB on the iSeries which is called to set the correct library list based on the company code, and userid.

When I call the C# program I get a signon screen where I sign in as user CRPRDQUA, and my password.
CRPRDQUA is the testing user signon, any thing else is considered a production signon, so you can see that QUSER coming in there could be
a real problem for me.

When the c# program executes, it calls a stored procedure, which calls program SETCLRLIB to set the library list.

I'm expecting the userid I retreive in the below program to be CRPRDQUA, and it turns out to be QUSER. I'm guessing QUSER is something picked up thru the network. Being a iSeries programmer, I don't normally deal with remote environments, so it boggles me when I signon on as CRPRDQUA and later see QUSER.

Can someone explain how I can get my correct signon passed to my program, so I can determine the correct userid, so I can correctly set the library list.

Below is program SETCLRLIB

Appreciate your help.

PGM PARM(&COCD) (with company code and user id I can determine a library list) DCL VAR(&COCD) TYPE(*CHAR) LEN(2) DCL VAR(&TSTFLG) TYPE(*CHAR) LEN(2) DCL VAR(&USERID) TYPE(*CHAR) LEN(10) RTVJOBA USER(&USERID) *-----------------------------------------------------------------*/ * If testing from SQL SCRIPT user defaults to QUSER */ *-----------------------------------------------------------------*/ IF COND(&USERID *EQ 'QUSER') THEN(DO) I added this code while testing, but
CHGVAR VAR(&USERID) VALUE('CRPRDQUA') this will eventually be taken out once ENDDO the quser issue is resolved *-----------------------------------------------------------------*/ * Clear library list */ *-----------------------------------------------------------------*/ IF COND(&USERID *NE 'CRPRDQUA') THEN(DO) CHGLIBL LIBL(*NONE) CURLIB(CRPRDLIB) This would actually be the correct logic ENDDO from here down. IF COND(&USERID *EQ 'CRPRDQUA') THEN(DO) CHGLIBL LIBL(*NONE) CURLIB(CRPRDLIBTS) ENDDO *-----------------------------------------------------------------*/ * SET UP LIBRARY LIST PROGRAM */ *-----------------------------------------------------------------*/ CALL PGM(SETCMP1) PARM(&COCD) *-----------------------------------------------------------------*/ CHGCURLIB CURLIB(*CRTDFT) DSPLIBL OUTPUT(*PRINT) *-----------------------------------------------------------------*/ ENDPGM
Sincerely,

Darrell Lee
Programmer/Analyst

SWBC
9311 San Pedro Ave., Suite 600
San Antonio, TX 78216
(210) 321-7127 - Direct

Visit our website at www.swbc.com




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.