With the ILE compiler, in RPG, you can use the PSDS to get information about the current user, job name etc..
How do you get the same information in a C++ program, using ILE?
The QUSRJOBI api will get you the info you mentioned. The returned struct jobInfo is defined in header QUSRJOBI.h (QSYSINC.H file) and will return the current job name/user name and job number plus more if called like this:
Qwc_JOBI0600_t jobInfo;
QUSRJOBI(&jobInfo, sizeof(Qwc_JOBI0600_t), "JOBI0600 ", "* ",
" ", &errCode);
There is no direct equivalent to RPG's PSDS in C++.
(For those who are not aware, in the RPG programming language, you can declare a data structure called the "Program Status Data Structure" and it'll be automatically filled in with lots of information about the runtime environment, including the job identifier (like a process id), user name, last error that occurred, and lots of other information.)
If you can tell us specifically which information you're looking for, and what platform you need it on (or whether you need it to be cross-platform) then perhaps we can help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With