z/OS MVS Programming: Writing Transaction Programs for APPC/MVS
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example Call to Error_Extract (Synchronous)

z/OS MVS Programming: Writing Transaction Programs for APPC/MVS
SA23-1397-00

Figure 1 shows how to call Error_Extract to return error information for a synchronous call to a conversation service:

Figure 1. Example Use of Error_Extract Service, Synchronous
/*******************************************************************/
/*  Call the APPC/MVS LU6.2 Send_Data service.  Specify a          */
/*  Notify_type of None to request synchronous processing.         */
/*******************************************************************/

      CALL ATBSEND(Conversation_id,
                   Send_type,
                   Send_length,
                   Access_token,
                   Buffer,
                   Request_to_send_received,
                   Notify_type,               /* Value of "None"   */
                   Return_code);

/*******************************************************************/
/*  Check the return code that APPC/MVS returns to the caller.     */
/*  If an error occurred on the call (indicated by an error return */
/*  code from APPC/MVS), call the Error_Extract service to         */
/*  obtain a service reason code and error message; write the      */
/*  error message to the output stream.                            */
/*******************************************************************/

      IF Return_code ^= atb_ok THEN
        BEGIN
          CALL ATBEES3(Conversation_id,
                       Service_Name,
                       Service_Reason_Code,
                       Message_Text_Length,
                       Message_Text,
                       Error_Log_Product_Set_ID_Length,
                       Error_Log_Product_Set_ID,
                       Error_Log_Information_Length,
                       Error_Log_Information,
                       Reason_Code,
                       Return_Code);
IF (Return_Code = 0) THEN
            BEGIN
              /*****************************************************/
              /* If the call to Error_Extract is successful,       */
              /* write the message text returned by Error_Extract  */
              /* to the output stream.  In this example, only      */
              /* messages with a length of 126 characters or less  */
              /* are displayed (126 is the maximum message length  */
              /* that DISPLAY can handle.)  You might want to      */
              /* display more of the message text with multiple    */
              /* DISPLAY statements.                               */
              /*****************************************************/
              IF Message_Text_Length <= 126 THEN
                DISPLAY (Message_Text) ;

              /*****************************************************/
              /* If the partner TP provided a product set ID,      */
              /* write it to the output stream.  In this example,  */
              /* we display only the software product name from    */
              /* the subvector that contains the product set ID.   */
              /* Your TP can extract parts of the product          */
              /* set ID as desired. See 'Sending a Product Set ID  */
              /* to a Partner System' in this section for infor-   */
              /* mation about how to extract parts of the ID.      */
              /*****************************************************/
              IF Error_Log_Product_Set_ID_Length > 0 THEN
                CALL Extract_Software_Product_Name (Error_Log_Product_set_ID,
                                                    Product_name_length,
                                                    Product_name) ;
              /*****************************************************/
              /* Write the software product name to the output     */
              /* stream.  This example program displays only       */
              /* product names with a length of 126 characters or  */
              /* less. Your TP can use multiple DISPLAY            */
              /* statements to display product names with more     */
              /* than 126 characters.                              */
              /*****************************************************/
                IF Product_name_length <= 126 THEN
                  DISPLAY (Product_name) ;
              /*****************************************************/
              /* If the partner TP or system provided error log    */
              /* data, write it to the output stream. This example */
              /* displays only product names with 126 characters   */
              /* or less.  Your TP can use multiple                */
              /* DISPLAY statements to display product names with  */
              /* more than 126 characters.                         */
              /*****************************************************/
              IF Error_Log_Information_Length > 0 THEN
                IF Error_Log_Information_Length <= 126 THEN
                  DISPLAY (Error_Log_Information) ;
            END;
          ELSE
            DISPLAY ('APPC/MVS Error Extract Service failed') ;
        END;

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014