Identifying Fields That Contain Currency Data

How to:

After you have created your currency data source, you must identify the fields in your data sources that represent currency values. To designate a field as a currency-denominated value (a value that represents a number of units in a specific type of currency) add the CURRENCY attribute to one of the following:


Top of page

x
Syntax: How to Identify a Currency Value

Use the following syntax to identify a currency-denominated value.

In a Master File

FIELD = currfield,, FORMAT = numeric_format, ..., CURR = 
{curr_id|codefield} ,$
DEFINE currfield/numeric_format CURR curr_id = expression ;$
DEFINE FILE filename
currfield/numeric_format CURR curr_id = expression ;
END
COMPUTE currfield/numeric_format CURR curr_id = expression ;

In a DEFINE in the Master File

DEFINE currfield/numeric_format CURR curr_id = expression ;$

In a DEFINE FILE command

DEFINE FILE filename
currfield/numeric_format CURR curr_id = expression ;
END

In a COMPUTE command

COMPUTE currfield/numeric_format CURR curr_id = expression ;

where:

currfield

Is the name of the currency-denominated field.

numeric_format

Is a numeric format. Depending on the currency denomination involved, the recommended number of decimal places is either two or zero. Do not use I or F format.

CURR

Indicates that the field value represents a currency-denominated value. CURR is an abbreviation of CURRENCY, which is the full attribute name.

curr_id

Is the three-character currency ID associated with the field. In order to perform currency conversions, this ID must either be the value EUR or match a CURRENCY_ID value in your currency data source.

codefield

Is the name of a field, qualified if necessary, that contains the currency ID associated with currfield. The code field should have format A3 or longer and is interpreted as containing the currency ID value in its first three bytes. For example:

FIELD = PRICE,, FORMAT = P12.2C, ..., CURR = TABLE.FLD1,$
   .
   .
   .
FIELD = FLD1,, FORMAT = A3, ...,$

The field named FLD1 contains the currency ID for the field named PRICE.

filename

Is the name of the file for which this field is defined.

expression

Is a valid expression.



Example: Identifying a Currency-Denominated Field

The following Master File contains the description of a field named PRICE that is denominated in U.S. dollars.

FILE=CURRDATA,SUFFIX=COM,$
FIELD=PRICE, FORMAT=P17.2 , ACTUAL=A5, CURR=USD,$
.
.
.

WebFOCUS