PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

File Zoned Decimal has been changed to Packed Decimal in RPG

View previous topic View next topic Go down

File Zoned Decimal has been changed to Packed Decimal in RPG

Post  maran on Thu Feb 09, 2012 6:45 pm

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.

Posts : 442
Join date : 2009-07-24

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum