File Zoned Decimal has been changed to Packed Decimal in RPG
Page 1 of 1
File Zoned Decimal has been changed to Packed Decimal in RPG
There are instances when RPG changes a zoned decimal field to packed decimal. How to override this??
The program version F-spec zoned decimal fields will always be presented as packed decimal within the program itself. RPG does this because packed is a better encoding method on the AS/400 for performing arithmetic operations. You can override this by specifying an externally described data structure for the file used in the F-spec. The following example shows how this is done in an RPG IV program:
FMyFile IF E K Disk
D MyFileDs E DS ExtName( MyFile )
This externally described data structure causes RPG to use zoned decimal for all fields defined as zoned decimal in your program.
The program version F-spec zoned decimal fields will always be presented as packed decimal within the program itself. RPG does this because packed is a better encoding method on the AS/400 for performing arithmetic operations. You can override this by specifying an externally described data structure for the file used in the F-spec. The following example shows how this is done in an RPG IV program:
FMyFile IF E K Disk
D MyFileDs E DS ExtName( MyFile )
This externally described data structure causes RPG to use zoned decimal for all fields defined as zoned decimal in your program.
Similar topics
» What are the reasons a logical file may be "dropped" during the File definition load process?
» Define term 'File Type' and list various file types.
» Copy Spool File to PF/Flat file
» Packed field substring
» Physical File & Logical File
» Define term 'File Type' and list various file types.
» Copy Spool File to PF/Flat file
» Packed field substring
» Physical File & Logical File
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum