Edit patterns

The edit masks are not particularly useful for unsigned numeric data such as telephone numbers, dates, time-of-day, identification numbers, and so on. Instead, you can use edit patterns to change the way these types of numeric values are displayed in your report. E'pattern' is used to specify an edit pattern. You use a 9 in the pattern where you want a digit (0-9) from the numeric value to appear, and any other characters anywhere you want them to appear.

If you have an 8-byte ZD date in the form mmddyyyy in positions 21-28, you can display it as mm/dd/yyyy using ON(21,8,ZD,E'99/99/9999'). An 8-byte value of 03122004 is displayed as 03/12/2004.

If you have a 10-byte ZD telephone number in the form aaapppnnnn in positions 31-40, you can display it as (aaa)-ppp-nnnn using ON(31,10,ZD, E'(999)-999-9999'). A 10-byte value of 0123456789 is displayed as (012)-345-6789.