clutton
clutton

Reputation: 640

Using qsys2.qcmdexc but switching user

I have an internal website where I am trying to user some existing RPG/CL code from an iSeries server. I would like to occasionally run iSeries jobs on behalf of a logged in user. The connection to the iSeries I am using however is running under a user name like "appuser" specifically setup for the application (that has ODBC read only access) over the SQL connection. The problem that I run into is that much of the security/logging that happens on the iSeries uses the job user to stamp records all over the place and that user is the name of the application rather than the user logged into it.

I can get commands to work using qsys2.qcmdexc but I need a way to switch the user to the appropriate "real user" from the iSeries (I have their username in the web application). The only idea I have come up with is to have a CL program that does a submit job of the command string and pass the real user in as the user.

Are there any better options to change the user for a job so I can run things interactively as them on via the SQL connection? Or is my best bet to do the submit job?

Upvotes: 2

Views: 677

Answers (1)

bvstone
bvstone

Reputation: 607

Here's an article by Shannon O'Donnel with a program that can swap a user profile. I've used it with success:

http://www.itjungle.com/mpo/mpo071703-story02.html

Upvotes: 3

Related Questions