Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISeries User Job different from the one referred in the i5_connect function #213

Open
AlbertoRen opened this issue Jan 30, 2025 · 5 comments

Comments

@AlbertoRen
Copy link

Ciao,
my name is Alberto and i'm from Italy.
I would like to migrate several php applications installed wrote on an ISeries where Aura/Easycom runs,
migrating them to a new Ibm Power with Zendserver installed .
In order to do that, i've installed the last version of Zendserver on IBM Power and modified the necessary scripts including the Toolkit.
In general, Toolkit works correctly but i've just found this problem: please take a look to the following script

$conn = i5_connect("ip address", "PHPUSER", "password");
i5_command("rtvjoba",
array(), array("curlib" => "curl",
"user"=>"user",
"job"=>"job",
"nbr"=>"nbr",
));

connecting with PHPUSER, RTVJOBA command retrieves this data

User : QUSER
job : QSQSRVR
number: 080019

The question is: why QUSER when i'm connecting with PHPUSER ? (...this is a big big problem for me)

ps
the same script, executed on the Iseries with Easycom installed, produces the following result

User : PHPUSER
job: PHPJOB
number: 700275

Thanks in advance for your help !!

@AlbertoRen AlbertoRen changed the title User ISeries User Job different from the one referred in the i5_connect function Jan 30, 2025
@alanseiden
Copy link
Collaborator

@AlbertoRen , use CURUSER instead and it should work the way you expect.
https://www.ibm.com/docs/en/i/7.5?topic=ssw_ibm_i_75/cl/rtvjoba.html

@AlbertoRen
Copy link
Author

Good morning Mr. Seiden, thank you very much for your fast reply, i must add the following.
The different behavior between Zend and Easycom causes the incorrect launch of CL programs, i mean, for instance

(1) connection
$conn = i5_connect("ip address", "PHPUSER", "password");

(2) call my CL program
$prepare = i5_program_prepare("BORDEROCLN", $description);
$return = i5_program_call($prepare, $parmIn, $parmOut);

(3) the job in which the program is executed is
QSQSRVR QUSER 081134

But i need to execute the pgm with PHPUSER (specified in connect function) and not with QUSER (...why QUSER ?...):
i really don't know if there's anything to set in the server or somewhere else.

Thank you for your patient.

Alberto

@alanseiden
Copy link
Collaborator

If you do WRKACTJOB while your program is running, you will see that the Current User is PHPUSER. That's how prestart jobs work, starting with QUSER and then switching to the current user per your authentication.
There is also an option to use a private connection and that will create a new job where USER is the one you want, but it gets more complicated to manage, so I don't recommend it.

@AlbertoRen
Copy link
Author

Good morning Mr. Alan,
sorry if I'm only replying now, I had a bad flu...
Thank you very much for your help, i understood perfectly the scenario and i chose (by force) to adopt QUSER profile
instead "one of mine users" because this is the only way i've found to solve a problem concerning the result of commands like CPYSPLF.
As you know for sure, when a job having USER different from CURRENT USER creates a spool file, this will be assigned to another job (precisely to the system job QPRTJOB).. and this is my case... if i invoke a CLP with the instruction i5_program_call and a user different from QUSER, every spool create by the clp will be "hijacked" to QPRTJOB, and the CPYSPLF in the clp doesn't work anymore because can't find the spool.
If you have any other suggestions they are welcome.
Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants