Description
With the reduction in cooperative load module view size limits in Gen 7.6 there has been an increased potential for developers to encounter the limit during a Consistency Check or code generation. This document outlines how an estimate of total view size can be calculated.
Solution
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 you have exceeded the view size limit. 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 Client/Server, GUI. The limits only apply to the size of the entire import and export view section of a Procedure Step. The Gen 7.6 view size limits for C and Cobol applications are:
Procedure Step Type | Import | Export |
Block mode | 31744 | 31744 |
Cooperative client or server | 31400 | 31400 |
GUI client | Unlimited* | Unlimited* |
*This is for GUI only client applications and flows across 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/.NET
Pure Java and .NET (C#) applications 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.
Gen 7.6 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 your compiler documentation).Calculating View Size
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.
Examples
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)
<Please see attached file for image>
Calculating export view size (generated for C)
<Please see attached file for image>
EXPORTS:
Group View out_group (355, implicit, export only)
Entity View out employee (transient)
first_name <--- text attribute of length 20
last_name <--- text attribute of length 20
id <--- numeric attribute of length 12 (no decimal precision)
monthly_salary <--- numeric attribute of length 7 with 2 decimal places (decimal precision)Calculating export view size (generated for C)
<Please see attached file for image>