Application Development and Automation 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: 
Read only

problem with open dataset for output

Former Member
0 Likes
1,485

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
Read only

FredericGirod
Active Contributor
1,378

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
Read only

FredericGirod
Active Contributor
1,379

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

Read only

0 Likes
1,378

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.
Read only

0 Likes
1,378

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.

Read only

0 Likes
1,378

the field is type CURR