Thanks Scott

I never would have figured that one out, In all my years myself and my
fellow programmers wherever I worked have always "USER". It never
occurred to me to look for another user variable.

Thanks for your help (again)

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




pctech-request@xxxxxxxxxxxx
Sent by: pctech-bounces@xxxxxxxxxxxx
08/01/2009 12:01 PM
Please respond to
pctech@xxxxxxxxxxxx


To
pctech@xxxxxxxxxxxx
cc

Subject
PcTech Digest, Vol 7, Issue 149






Send PcTech mailing list submissions to
pctech@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.midrange.com/mailman/listinfo/pctech
or, via email, send a message with subject or body 'help' to
pctech-request@xxxxxxxxxxxx

You can reach the person managing the list at
pctech-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of PcTech digest..."


*** NOTE: When replying to this digest message, PLEASE remove all text
unrelated to your reply and change the subject line so it is meaningful.

Today's Topics:

1. Re: QUSER Problem (DLee@xxxxxxxx)
2. Re: QUSER Problem (Scott Klement)
3. Re: QUSER Problem (David Gibbs)
4. Guidelines for PCTECH mailing list (mailman@xxxxxxxxxxxx)


----------------------------------------------------------------------

message: 1
date: Fri, 31 Jul 2009 15:35:47 -0500
from: DLee@xxxxxxxx
subject: Re: [PCTECH] QUSER Problem

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

------------------------------

message: 2
date: Fri, 31 Jul 2009 16:43:15 -0500
from: Scott Klement <pctech@xxxxxxxxxxxxxxxx>
subject: Re: [PCTECH] QUSER Problem

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





------------------------------

message: 3
date: Fri, 31 Jul 2009 22:31:01 -0500
from: David Gibbs <david@xxxxxxxxxxxx>
subject: Re: [PCTECH] QUSER Problem

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.

This is the PCTECH list ... iSeries questions are off topic on this list.

This question probably belongs on MIDRANGE-L (
http://lists.midrange.com/listinfo/midrange-l).

david



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