COMMAND output block mapping

These examples illustrate output block mapping for the DBRC command request. You can use the examples to understand how the DSPAPCMD output block header is structured and how the output appears.

The following figure illustrates command output block mapping.

Figure 1. Mapping of command output block
Command output block mapping

Example of storage block mapped by the DSPAPCMD

Each storage block begins with a standard header that is mapped by the DSPAPQHD. The data portion of this output block is mapped by DSPAPCMD, as illustrated in the following example.

DSPAPCMD                                                                        
                                                                                
  OFFSET   OFFSET                                                               
 DECIMAL     HEX  TYPE        LENGTH  NAME (DIM)     DESCRIPTION                
======== ======== ========= ========  ============== ===========================
       0      (0) STRUCTURE       24  DSPAPCMD                                  
       0      (0) SIGNED           4   APCMD_RETCODE DBRC command return code   
       4      (4) SIGNED           4   *             Reserved                   
       8      (8) SIGNED           4   APCMD_CMDLEN  Length of command entered  
      12      (C) SIGNED           4   APCMD_BUFFLEN Length of command output   
      16     (10) UNSIGNED         4   APCMD_CMDOFF  Offset to command buffer   
      20     (14) UNSIGNED         4   APCMD_BUFFOFF Offset to command output   

 OFFSET   OFFSET
DECIMAL     HEX  TYPE        LENGTH  NAME (DIM)     DESCRIPTION
======= ======== ========= ========  ============== ============================
      0      (0) STRUCTURE        *  APCMD_COMMAND  Command as entered

Example of DSPAPCMD output block header

In the following example, the DSPAPCMD output block header contains the status of the request, returns an echo of the command, and any command output. The following example describes the DSECT for the DBRC command output.

                                                                                
    Each output line is mapped by the following structure                       
================================================================================
                                                                                
  OFFSET   OFFSET                                                               
 DECIMAL     HEX  TYPE        LENGTH  NAME (DIM)     				 DESCRIPTION        
======== ======== ========= ========  ============== 				 ===================
       0      (0) STRUCTURE        5  APCMD_OUTPUT_LINES                        
       0      (0) SIGNED           2  APCMD_OUTPUT_LINELEN   Length of line     
       2      (2) SIGNED           2   *             				 Reserved           
       4      (4) CHAR VARY        1  APCMD_OUTPUT_DATA      Output data        
                                                 								                
CONSTANTS                                                                       
                                                                                
  LEN  TYPE           VALUE          NAME            			 	 DESCRIPTION        
=====  =========  =================  =============== 				 ===================
    8  CHARACTER  DSPAPCMD           APCMD_EYECATCHER