How to create copybooks for customized resource table records

You can build a structure for your customized view by using the SPECIFY VIEW, GET and FETCH commands to move the data into your structure.

For example:
Figure 1. SPECIFY VIEW command to build a structure
*****************************************************
*            SPECIFY VIEW                           *
*****************************************************
     STRING 'POOLNAME,MINITEMLEN,QUELENGTH,NUMITEMS,'
     'RECOVSTATUS,MAXITEMLEN,LASTUSEDINT,'           
     'NAME,TRANSID,LOCATION.'                        
     DELIMITED BY SIZE INTO BUFFERA.                 
     MOVE 96 TO BUFFERL.                             
     EXEC CPSM SPECIFY                               
               VIEW('VTSQSHR')                       
               FIELDS(BUFFERA)                       
               LENGTH(BUFFERL)                       
               OBJECT('TSQSHR')                      
               THREAD(TTKN(1))                       
               RESPONSE(SMRESP)                      
               REASON(SMRESP2)                       
     END-EXEC.                                       
The associated structure will consist of each attribute specified in the SPECIFY VIEW FIELDS keyword and is shown in Figure 2.
Figure 2. Structure of a customized view
 01 VTSQSHR.                                                    
* Shared Temporary Storage Queue                                
   02 POOLNAME       PIC X(0008).                               
* TS Pool Name                                                  
   02 MINITEMLEN     PIC S9(0004) USAGE BINARY.                 
* Smallest item Length in bytes                                 
   02 QUELENGTH      PIC S9(0008) USAGE BINARY.                 
* Total length in bytes . FLENGT                                
   02 NUMITEMS       PIC S9(0004) USAGE BINARY.                 
* Number items in queue                                         
   02 RECOVSTATUS    PIC S9(0008) USAGE BINARY.                 
* Recovery Status                                               
   02 MAXITEMLEN     PIC S9(0004) USAGE BINARY.                 
* Largest item length in bytes                                  
   02 LASTUSEDINT    PIC S9(0008) USAGE BINARY.                 
* Interval since last use                                       
   02 NAME-R         PIC X(0016).                               
* Queue Name                        -- RESERVED WORD --       
   02 TRANSID        PIC X(0004).                               
* Trans that created tsqueue                                    
   02 LOCATION       PIC S9(0008) USAGE BINARY.       
* Queue Location 

Note that the EYU-CICSNAME, EYU-CICSREL, and EYU-RESERVED attributes or any field alignment or padding attributes are not used in this structure.



eyup1nn.html | Timestamp icon Last updated: Sunday, 4 June 2017