How does the developer calculate view sizes in Gen 7.6 to ensure that the views do not exceed the allowed limits?
search cancel

How does the developer calculate view sizes in Gen 7.6 to ensure that the views do not exceed the allowed limits?

book

Article ID: 54083

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset Gen - Host Encyclopedia Gen - Run Time Distributed

Issue/Introduction

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).
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 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.

  • 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.

Examples

  1. This example shows how the additional bytes should be uses 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)

    <Please see attached file for image>

    Figure 1

    Calculating export view size (generated for C)

    <Please see attached file for image>

    Figure 2

  2. This example shows a total export view size that will conform to the Block Mode limit but will exceed the Cooperative limit and will therefore give the following Consistency Check and generation error:
    ICCBR17S The total export view length will exceed the supported maximum length of 31400 bytes if generating C code for cooperative servers.

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>

Figure 3

Environment

Release: KGNCRK05500-7.6-Gen-CLS Runtime Kit-for Unisys
Component:

Attachments

1558714028228000054083_sktwi1f5rjvs16tan.gif get_app
1558714026195000054083_sktwi1f5rjvs16tam.gif get_app
1558714024373000054083_sktwi1f5rjvs16tal.gif get_app