Interpreting a data object in QMF format: an example

You can calculate the length of the header record when you have the length of the data records. In this example, each data record is 23 bytes long. QMF format for data explains that the first 12 bytes contain level and number information. There are 24 bytes for each column of data, and there are three columns. Thus, for this three-column data object, the header is 84 bytes:
(12 + (24 X 3) = 84).

If you export the following data from Q.STAFF:

ID  NAME     COMM
___ ________ ______
 10 SANDERS    -
 20 PERNAL   612.45
 

You would use the following table to calculate the widths of each column:

Table 10. Calculating column widths
Column name Data type Data type width (length in header) Width of column
ID SMALLINT 2 2 + 2 = 4
NAME VARCHAR 9 2 + 2 + 9 = 13
COMM DECIMAL (7,2) 7 (7 + 1)/2 + 2 = 6
    Length of data record: 23

Each header record is the same length as the data records: 23 bytes. Those 84 bytes are spread across four 23-byte header records; the last record is padded with blanks.

Figure 16 shows the header from the report and its hexadecimal representation. The reversed-type numbers indicate notes following the figure.

Figure 16. Sample header records for exported data object in QMF format. 40 is the hexadecimal code for a blank character.
        R  E  L      1  .  0              I  D
  1     D9 C5 D3 40 F1 4B F0 40 0004 0003 C9 C4 40 40 40 40 40 40 40 40 40
        
 1                        
 2  
 3  
 4 
                                        N     N  A M  E
  2     40 40 40 40 40 40 40 01F4 0002  D5 00 D5 C1 D4 C5 40 40 40 40 40 40
                              
 5    
 6  
 7 
                                          Y     C  O  M  M
  3     40 40 40 40 40 40 40 40 01C0 0009 E8 00 C3 D6 D4 D4 40 40 40 40 40
                                              Y
  4     40 40 40 40 40 40 40 40 40 01E4 07 02 E8 00 40 40 40 40 40 40 40

Figure 17 shows the data from the report and the hexadecimal representation of that data. For information about what the byte positions mean, see QMF format for data.

Figure 17. Sample data records for exported data object in QMF format
               10             S  A  N  D  E  R  S
  1   00 00 00 0A 00 00 00 07 E2 C1 D5 C4 C5 D9 E2  00 00 FF FF 00 00 00 40 40
               
 8          
 9                             
 10 
               20             P  E  R  N  A  L
  2   00 00 00 14 00 00 00 06 D7 C5 D9 D5 C1 D3 00 00 00 00 00 00 61 24 5C
 1 REL 1.0
Object format level: 1.0

The object format level tells QMF which version of the object format this object is using. Every time a QMF object format is changed, the level number is changed; object formats are not changed with every new release.

 2 X'0004'
Number of header records: 4
 3 X'0003'
Number of data columns: 3
 4 X'C9 C4'
Column name: ID
 5 X'1F4'
Data type: SMALLINT
 6 X'0002'
Column width: 2
 7 X'D5'
Nulls allowed: N signifies no
 8 X'0A'
Value for first column of first data record: 10
 9 X'07'
Length of name in second column of first data record: 7
 10 X'FFFF'
Indicator information: column contains a null value

If you want more information about the files, data sets, or CICS data queues that are generated when data or table objects are exported, see Specifications for externalized QMF objects.

For an example of the IXF format, see Appendix C. Integrated Exchange Format (IXF).

[ Previous Page | Next Page | Contents | Index ]