cinline-assemblymainframezosmvs

Using WTO to write multi-line message via __asm__ in C language


I have successfully written out single line WTO messages using __asm__ from a C language program, thus:-

typedef struct WTO_Parm
{
  short    int  len;          /* Total length of structure */
  short    int  mcsflags;
  unsigned char message[126];
} WTOPARM;
:
pWtoParm = (WTOPARM *)__malloc31(sizeof(WTOPARM));
:
__asm__(" WTO   MF=(E,(%[text]))\n"
        :
        :[text] "r"(pWtoParm)
        :"r0","r1","r14","r15");

What I'm struggling with is how to write a Multi-line WTO in the same fashion.

The description of WTO - Write to operator says:-

I have been able to retrieve the message identification number used to connect WTO messages, on return from a successful WTO, with the following invocation:-

__asm__(" WTO   MF=(E,(%[text]))\n"
        " ST 1,%[wtoconn]\n"
        :[wtoconn] "=m"(ConnID)
        :[text] "r"(pWtoParm)
        :"r0","r1","r14","r15");

But I have not been able to pass the ConnID back in and have WTO make use of it. I have tried register 0 and CONNECT= (even though the above bulleted list suggests neither will work) but it seems to be ignored. I have tried putting in a ConnID with a hard-coded number (1234) and still didn't get any error back in R15, also suggesting that it is being ignored as I should have got RC=08.

I am sure that problem state programs can write multi-line WTOs but perhaps not by using CONNECT. What are the alternative ways to write a multi-line WTO and can anyone confirm that problem state programs can or cannot use CONNECT/register 0.


Solution

  • Since your program is not an authorized one, you ought to read the WTO description in the non-authorized version of the manuals. See z/OS MVS Programming: Assembler Services Guide, and z/OS MVS Programming: Assembler Services Reference IAR-XCT

    CONNECT=, LINKAGE=, etc. are parameters for authorized programs, only.

    Unauthorzied programs can only write multi-line WTOs of up to 10 lines with a single call to WTO. No CONNECT.