‎2007 Oct 02 2:46 AM
hi all,
i have a doubt in declaring dataset. i have 2 fields with,
PIC S999999V99 SIGN TRAILING SEPARATE,
PIC S999999V99 SIGN TRAILING SEPARATE,
im using ,
OPEN DATASET gv_unixfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
if i use that field,
TAX_1(6) type p DECIMALS 2,
TAX_2(6) type p DECIMALS 2.
The program goes for a DUMP. but if use ,
TAX_1(6) type c,
TAX_2(6) type c.
it's working fine but in the file iam able to see 0.00 but my requirement is i need 00000000+45658950
Can anyone help me in this issue,
Thanks in Advance,
Prem.
‎2007 Oct 02 2:53 AM
Hi
Moving decimal (packed) values to CHAR field always works. Take care that the CHAR field is long enough so that value does not get truncated.
The way back from CHAR to decimal field works if the numbers are in numeric format. You can try with
TRY.
<decimalfield> = <charfield>..
CATCH cx_sy_conversion_no_number CONVT_OVERFLOW.
ENDTRY.
OR use
open dataset fnam for input in legacy text mode code page '1100'.
Sri
‎2007 Oct 02 2:57 AM
While passing the amounts / quantities to file, you need to pass values to Character field. Here you are using Type P whose size is 11. That value you are trying to pass in a character variable of size 6.
Change Character variable size value to 11 and check again.