Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

problem with open dataset for output

former_member640793
Participant
0 Kudos

i have a problem with transfer a field-type decimal into a file :

" In statement "TRANSFER f TO ...", only character-type data objects are supported at argument position "f". In this case, operand "f" has the non character-type type "P LENGTH 6 DECIMALS 2".

1 ACCEPTED SOLUTION

FredericGirod
Active Contributor

You cannot transfer something else than character type data. Just open a notepad and check the content of a flat file containing amount or quantity. It is a character representation of a number, not a number.

So, just try to use statement like WRITE my_amount TO my_char_amount. and transfert the my_char_amount

4 REPLIES 4

FredericGirod
Active Contributor

You cannot transfer something else than character type data. Just open a notepad and check the content of a flat file containing amount or quantity. It is a character representation of a number, not a number.

So, just try to use statement like WRITE my_amount TO my_char_amount. and transfert the my_char_amount

0 Kudos

A "field-type decimal" may be a number which is neither a currency amount, nor a quantity.

If it's an amount, CURRENCY is to be used, to avoid issues of division by 100 and related issues (if amount is JPY instead of EUR for instance) :

WRITE my_amount CURRENCY currency_key TO my_char_amount.

0 Kudos

thanks, but now when i doing read dataset file into my structure, not work because the field is a number, this is error:

In statement "READ DATASET ... INTO f", only character-type data objects are supported at argument position "f". In the present case, operand "f" has the non character-type type "my_structure". The current program is a Unicode program. In Unicode, type X or structures that do not just contain character-type components are regarded as non-numeric.

0 Kudos

the field is type CURR