Formatting numeric output in LANSA

Date:Archived
Product/Release:LANSA - All Platforms
Abstract:Usually when printing cheques the value is printed in words and the amount is formatted either as' $100.80', or '****100.80' instead of '0000100.80'. This is quite easy to do with LANSA.
Submitted By:LANSA Technical Support

LANSA for the AS/400 and LANSA for Windows support the concept of Edit Words (similar to the FORMAT$ in some other languages). Relatively complex Edit Words can be developed if the rules are known. These rules are not LANSA's rules. They are IBM® rules, from the AS/400 Programming: Data Description Specification Reference Manual SC21-9620-x.

Some simple examples for a numeric field 7 digits long with 2 decimal places are:-

Edit WordProgram ValueShown As
'bbbbbb*.bb'12345****123.45
'bbbbbbb$.bb'12345bbbb$123.45

Note: In the above example 'b' means blank.

For more information and examples see the AS/400 Programming: Data Description Specification Reference Manual SC21-9620-x.