View previous topic :: View next topic
|
Author |
Message |
kolappan
New User
Joined: 26 May 2006 Posts: 5
|
|
|
|
Hi,
for example,
can we write working section as
01 a pic 9(3).9(2) comp. ------Is it possible?
we can write
01 a1 pic 9(3)v9(2) comp.
my question is
move 345.78 to a
move 345.78 to a1
what is the output of a and a1? |
|
Back to top |
|
|
rdr
New User
Joined: 26 May 2006 Posts: 35 Location: india
|
|
|
|
Hi Kolappan,
I am answering to the later part of the question-
Please let me know if i am wrong....
Quote: |
my question is
move 345.78 to a
move 345.78 to a1
what is the output of a and a1? |
Out put is 345.78-a
345.78-a1
Regards,
Rohit. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
A def of a decimal number (regardless of the type - comp, display, comp-3) is separate and distinct from its edited def.
To edit a numeric field you must MOVE it to an edited field or provide a value in the edited def. So there are no COMP (or NUMERIC DISPLAY, for that matter) edited fields, only edited fields.
So, in your example, fld a is invalid and should cause a compiler error. If you recode it as a pic 9(3).9(2) you can move 345.78 to it and it will display as 345.78.
You can also move 345.78 to fld a1 then move field a1 to fld a and fld a will display as 345.78.
Answering your 2nd ques with the new defs:
a1 should contain X'00008712'
If you move it to fld a it should display as 345.78
I haven't tested any of this but it gives you a good foundation to try it for yourself. |
|
Back to top |
|
|
kolappan
New User
Joined: 26 May 2006 Posts: 5
|
|
|
|
Hi Mmwife,
Thanx for your kind reply.
Regards,
Kolappan. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Kolappan,
I hope it's enough to get you started.
I forgot to mention that the editing takes place as a by-product of the data conversion process of function being performed (e.g. MOVE). |
|
Back to top |
|
|
|