RPG IV - V6R1 Enhancements: 1) Increased Length
Page 1 of 1
RPG IV - V6R1 Enhancements: 1) Increased Length
Increased Sizes
The maximum amount of storage that can be occupied by a data structure, array, or standalone field is now 16M. Yes, the maximum size of a character field has increased from 64K to 16M (16,773,104 bytes to be exact).
This is an enhancement that is long overdue. More and more of our programs should be making use of memory, but we have been restricted by the 64K limit in RPG. This enhancement means that a whole lot of dynamic memory management procedures and pointer/user space procedures are about to disappear. It also means that operations such as XML-INTO are now more functional and less cumbersome to use.
(1) D LongFld S a Len(25000000)
(2) D BigDS DS a Len(60000000)
(3) D BigArray1 S a Len(10000000)
D Dim(6)
(4) D BigArray2 S 1a Dim(50000000)
(5) D BigVarying S a Len(25000000) Varying(4)
D DummyPtr S *
/Free
(6) DummyPtr = %Addr(BigVarying : *Data);
Use the LEN keyword to define a large length.
1) Since only seven positions are available to specify the length of a field in the D spec, you use the LEN keyword to specify a length greater than 9,999,999.
2) The LEN keyword may also be applied to a data structure.
3) The LEN keyword may also be applied to an array.
4) Larger variable sizes also mean you can have a larger number of elements in an array as long as the total storage for the array does not exceed 16M. The same applies to multiple-occurrence data structures.
5) Varying-length fields now require 2 or 4 bytes to store the actual length of the field. A size of 2 is assumed if the specified length is between 1 and 65535; otherwise, a size of 4 is assumed. You can specify either VARYING(2) or VARYING(4) for definitions whose length is between 1 and 65535. For definitions whose length is greater than 65535, VARYING(4) is required.
6) The %ADDR BIF has also been enhanced. The optional *DATA parameter may be specified so that %ADDR returns the address of the data portion of a variable-length field.[b]
The maximum amount of storage that can be occupied by a data structure, array, or standalone field is now 16M. Yes, the maximum size of a character field has increased from 64K to 16M (16,773,104 bytes to be exact).
This is an enhancement that is long overdue. More and more of our programs should be making use of memory, but we have been restricted by the 64K limit in RPG. This enhancement means that a whole lot of dynamic memory management procedures and pointer/user space procedures are about to disappear. It also means that operations such as XML-INTO are now more functional and less cumbersome to use.
(1) D LongFld S a Len(25000000)
(2) D BigDS DS a Len(60000000)
(3) D BigArray1 S a Len(10000000)
D Dim(6)
(4) D BigArray2 S 1a Dim(50000000)
(5) D BigVarying S a Len(25000000) Varying(4)
D DummyPtr S *
/Free
(6) DummyPtr = %Addr(BigVarying : *Data);
Use the LEN keyword to define a large length.
1) Since only seven positions are available to specify the length of a field in the D spec, you use the LEN keyword to specify a length greater than 9,999,999.
2) The LEN keyword may also be applied to a data structure.
3) The LEN keyword may also be applied to an array.
4) Larger variable sizes also mean you can have a larger number of elements in an array as long as the total storage for the array does not exceed 16M. The same applies to multiple-occurrence data structures.
5) Varying-length fields now require 2 or 4 bytes to store the actual length of the field. A size of 2 is assumed if the specified length is between 1 and 65535; otherwise, a size of 4 is assumed. You can specify either VARYING(2) or VARYING(4) for definitions whose length is between 1 and 65535. For definitions whose length is greater than 65535, VARYING(4) is required.
6) The %ADDR BIF has also been enhanced. The optional *DATA parameter may be specified so that %ADDR returns the address of the data portion of a variable-length field.[b]
Similar topics
» RPG IV - V6R1 Enhancements: 3) LIKEFILE
» RPG IV - V6R1 Enhancements: 2) Template Datastructure
» RPG IV - V6R1 Enhancements: Template File
» RPG IV - V6R1 Enhancements: 2) Template Datastructure
» RPG IV - V6R1 Enhancements: Template File
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|