Format Flags
If you are familiar with C programming, the data conversions provided with format flags will be familiar. Essentially, the printf function format definitions for %s, %f, and %d are supported with some limitations.
Remember that most export record data and other internal data is usually text. Therefore, to convert to a numerical format of %f or %d, the form set data must be deformatted internally and then converted into the required format.
The output written to the exported record is formatted as text. Here are some examples:
FIELD = DESC;%d
FIELD = ORIGUSER;%-32.32s
FIELD = APPDATA;%8.2f
These examples use format flags. The first example retrieves the value of the field DESC (the description) then converts that value into an integer (losing any decimal portion it might have had) and outputs it as an integer value. If the data was not a number, the result is zero (0).
The second example writes exactly 32 characters for the value taken from ORIGUSER. If the field value does not contain 32 characters, it is padded with spaces. Note also the use of the dash (-) indicator. This tells the system to left justify the field. If you omit the dash, the system pads the data with spaces on the left, right justifying it.
The last example demonstrates a floating point output with two decimal places. The field value is converted into a floating point number. The system then applies the format you specify and rounds the value if it contained more than two decimal places.
© Copyright 2020, Oracle and/or its affiliates. All rights reserved. Legal notices.