Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get psds informations in c++

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?

like image 912
Arsnow Avatar asked Oct 13 '14 07:10

Arsnow


2 Answers

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);

like image 73
Tim Bronski Avatar answered Jan 02 '23 19:01

Tim Bronski


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.

like image 38
Scott Klement Avatar answered Jan 02 '23 19:01

Scott Klement