View previous topic :: View next topic
|
Author |
Message |
rokes
New User
Joined: 09 Jan 2014 Posts: 7 Location: India
|
|
|
|
Hello,
I am trying to pass a Numeric field to an Alphanumeric field and write in output file. Its getting printed without the decimal point.
For eg. Amount = 175.50
I tried,
Code: |
Amount W 6 N 2
Price-Value W 8 A
Price-Value = Amount
PUT OUTFILE
|
In the output file
it is printed as
I need to print it as it is. i.e,
1. I cannot define the output variable as N because I need to pass the column name via same variable in the output file.
2. I had tried defining two separate variable structure for heading and then the values. But since the structure name is defined as alphanumeric, it still prints without any decimal point.
3. I cannot use the REPORT option because i have other constraints in comparing this output file with other files.
Please provide any help.
Thanks,
Rokesh |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You'll have to explain 1), 2) and 3) with examples. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well first of all, you have to realize that nnnnnnnnnnoooooooooo numeric type field has the decimal point.
it is implied.
if this were true: Mainframe Skills: Rexx/Cobol/Jcl/PL1/Eztrieve/DB2
you would have known that.
since your profile overstates your skills,
I will provide you an answer that actually belongs in the students' forum (as I think you do)
suggest you look for something called an 'edit mask'.
either that or you must redefine price value (needs to be W 9 A
into 3 fields
Code: |
1st): Non-decimal-amount W 6 N 0
2nd): decimal-point W 1 A (value '.' or move a '.' to decimal-point)
3rd): decimal-amount w 2 N 2
|
and then code:
Code: |
Non-decimal-amount = Amount
decimal-point = '.'
decimal-amount = Amount
|
|
|
Back to top |
|
|
|