A program communication block (PCB) is a control block used by IMS to describe results of a DL/I call (DB PCB) or the results of a message retrieval or insertion (I/O PCB) made by your program. A valid PCB is one that has been correctly initialized by IMS and passed to you through your C or C++ program. See also the sample C-IMS and C++-IMS programs in z/OS XL C/C++ Runtime Library Reference.
If you are running a C program under TSO or IMS, be aware of the effects of PLIST(OS), ENV(IMS), and their combinations when specified using the #pragma runopts preprocessor directive. Table 1 shows the combinations of PLIST(OS) and ENV(IMS) and the resulting PCB generated under each of the environments.
| Combination | Running under TSO | Running under IMS |
|---|---|---|
| ENV(IMS) only | Invalid PCB | Valid PCB |
| PLIST(OS) only | Null PCB | Null PCB |
| ENV(IMS) and PLIST(OS) | Invalid PCB | Valid PCB |
For more information on the runtime options ENV and PLIST, see z/OS Language Environment Programming Reference.
If you are running a C or C++ program under TSO or IMS, be aware of the effects of specifying compiler options PLIST(OS), TARGET(IMS), and their combinations. Table 2 shows the combinations of PLIST(OS) and TARGET(IMS) and the resulting PCB generated under each of the environments.
| Combination | Running under TSO | Running under IMS |
|---|---|---|
| TARGET(IMS) only | Invalid PCB | Valid PCB |
| PLIST(OS) only | Null PCB | Null PCB |
| TARGET(IMS) and PLIST(OS) | Invalid PCB | Valid PCB |
For both C and C++, specifying PLIST(OS) under either TSO or IMS results in an argc value of 1 (one), and argv[0] = NULL. For more information on the compiler options TARGET(IMS) and PLIST(OS), see z/OS XL C/C++ User's Guide.