Calculating Gen view sizes
search cancel

Calculating Gen view sizes

book

Article ID: 54083

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset

Issue/Introduction

This document outlines how an estimate of total Gen action diagram view sizes can be calculated.
With the Common Format Buffer (CFB) limit increasing from the old 31K (31744 bytes) to 16 MB (16775847 bytes) in Gen 8.5 this calculation is not as important in ensuring the view size limits are not exceeded. However the information has been retained for future reference.

For further details please see doc. references :
Designing Action Diagrams > Using Views
Consistency Check Messages > Messages ICCAB01W - ICCDX01E > ICCBR03W, ICCBR04W, ICCBR11W, ICCBR12W, ICCBR16W, ICCBR17W

Resolution


Overview

For Gen non-Java/.NET applications, depending on an application's target environment and type, there are different limits to the size of views and the amount of data that can be passed between Procedure Steps on a flow. In some cases, Consistency Check will report an error if the view size limit has been exceeded. This document will help explain Consistency Check rules as well as code generation limits for view sizes.

 

View Size Limits

Size limits for views vary depending on the application type i.e. Block Mode, Cooperative Servers, GUI Client. The limits only apply to the size of the entire import and export view section of a Procedure Step. The view size limits for C and COBOL applications are:

Procedure Step Platform/Type
Import
Export
Block Mode
31744
31744
Cooperative server
16775847 
16775847 
GUI Client
Unlimited*
Unlimited*


NOTE
: The following Cooperative servers still only support 31400 bytes:

  • NonStop C Servers
  • SNA/ CPI-C  Servers
  • ECI transport (either ECI v1 or ECI v2 using the COMMAREA)
  • WebSphere MQ TDC
  • CICS Sockets Server Listener (TISRVLIS)
  • IMS Servers
  • COBOL Server-to-Server

*Procedure steps can be within the same or different load modules. Effectively this value is only limited by system resources and the group view subscript limit of 32KB. Under a desktop test (not a full QA test) passing an export group view of size ~290 Mb has been successful.

Java (EJB) servers and .NET (C#) servers have no view size limits, but Java/.NET clients that flow to non-Java/.NET servers or non-Java/.NET clients that flow to Java/.NET servers will also be subject to the above limits.

 

Datatypes and byte lengths for different programming languages

Numbers without decimal places:

Length
C datatype
Bytes
COBOL datatype
Bytes
Java/.NET  datatype
Bytes
1-4
short (short int)
21
PIC X(Length)
Length
short
2
5-9
long (long int)
41
 
PIC X(Length)
Length
int
4
>=10
double
81
 
PIC X(Length)
Length
double
8

 

Numbers with decimal places:

Decimal Precision
C datatype
Bytes
COBOL datatype
Bytes
Java  datatype
Bytes
.NET datatype
Bytes
No
double
81
 
PIC X(Length)
Length
double
8
double
8
Yes
DPrec [Length + 3]
Length + 32
 
N/A3
 
N/A2
 
BigDecimal
N/A4
 
decimal
12

 

Others:

Gen datatype
C datatype
Bytes
COBOL datatype
Bytes
Java/.NET  datatype
Bytes
Fixed Text
char
Length + 1
PIC X(Length)
Length
string
Length + 1
Varying Text
char
Length + 1
PIC X(Length+2)
Length + 2
string
Length + 1
Date
long (long int)
41
 
PIC X(8)
8
int
4
Time
long (long int)
41
 
PIC X(6)
6
int
4
Timestamp
char
21
PIC X(20)
20
string
21

NOTE: Length represents the length of the attribute as defined in the Gen data model.

1The size of the various C datatypes is compiler dependent and so these are only typical values (check compiler documentation).
2An attribute defined with Decimal Precision is implemented as a DPrec character array whose size is the length of the attribute plus three (for the sign, decimal point, and null terminator).
3
Decimal Precision does not impact COBOL.
4
The size of a BigDecimal is arbitrary and will depend upon the length and number of decimal places.

Calculating View Sizes

The actual size of the import or export view is greater than the sum of the length of all attributes because of overheads. The following information can be used to help manually calculate view sizes.

  • Add 1 additional byte for each attribute of type `text' required for the null terminator (not applicable to Cobol).
  • Add 1 additional byte for each attribute in the import view.
  • Add 7 additional bytes for each attribute in the export view.
  • Add 5 additional bytes for each repeating group view.
  • Add <max cardinality> additional bytes for each repeating group view.

 

Example

This example shows how the additional bytes should be used in the calculations and represents a scenario where the views size limits for Import & Export views fall well within the limits described above:

IMPORTS:
               Group View in_group (optional, 100, implicit, import only)
                            Entity View in employee (optional, transient)
                                        first_name (optional) <--- text attribute of length 20
                                        last_name (optional) <--- text attribute of length 20

EXPORTS:
               Group View out_group (100, implicit, export only)
                            Entity View out employee (transient)
                                         first_name <--- text attribute of length 20
                                         last_name <--- text attribute of length 20

Calculating import view size (generated for C):

       21 (first_name is text attribute of length 20 -> 20 + 1 for null terminator = 21)
       21 (last_name is text attribute of length 20 -> 20 + 1 for null terminator = 21)
+       2 (1 additional byte for each attribute -> 1 * 2 = 2 )
=====
       44
  x 100 (group view has 100 occurrences)
=====
   4400
=====
+   100 (add <max cardinality> bytes per group view = 100)
=====
   4500
+       5 (5 additional bytes for each group view -> 5 * 1 = 5 )
=====
  4505  Total Bytes


Calculating export view size (generated for C):

       21 (first_name is text attribute of length 20 -> 20 + 1 for null terminator = 21)
       21 (last_name is text attribute of length 20 -> 20 + 1 for null terminator = 21)
+     14 (7 additional bytes for each attribute -> 7 * 2 = 14 )
=====
       56
  x 100 (group view has 100 occurrences)
=====
   5600
=====
+   100 (add <max cardinality> bytes per group view = 100)
=====
   5700
+       5 (5 additional bytes for each group view -> 5 * 1 = 5 )
=====
  5705  Total Bytes