View previous topic :: View next topic
|
Author |
Message |
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
Which one of the following is the correct way to define a field to contain the value +123.45?
a. 05 W-NUMBER PIC S9(03)V99.
or
b. 05 W-NUMBER PIC +999.99. |
|
Back to top |
|
|
Ramya A
Active User
Joined: 26 Jul 2004 Posts: 104
|
|
|
|
Hi
There is no correct way and wrong way for defining those variables...there are actually different ways out of which you have to choose the one you need depending on the PURPOSE.
Eg:
If you are using the variable only for display/reporting purpose, then second method would suite.
If the variable will be involved in calculations, then first method should be used.
Regards,
Ramya |
|
Back to top |
|
|
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
Ramya Arun wrote: |
Hi
There is no correct way and wrong way for defining those variables...there are actually different ways out of which you have to choose the one you need depending on the PURPOSE.
Eg:
If you are using the variable only for display/reporting purpose, then second method would suite.
If the variable will be involved in calculations, then first method should be used.
Regards,
Ramya |
It's a question from Brainbench test, there are 5 choices for it. I am confused with the 2 choices I mentioned here. |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
According to me from the below choices
a. 05 W-NUMBER PIC S9(03)V99.
or
b. 05 W-NUMBER PIC +999.99.
choice B will do. check it. let me know. |
|
Back to top |
|
|
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
khamarutheen wrote: |
hi frnd,
According to me from the below choices
a. 05 W-NUMBER PIC S9(03)V99.
or
b. 05 W-NUMBER PIC +999.99.
choice B will do. check it. let me know. |
How to check it on Brainbench...I don't know, khamarutheen. |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
i doesn't mean to check out with brainbench. i mean that to check out with ur cobol compiler. k. any way u have a practise test in that. try out with that. it gives u only few questions and also with solution. try out. Regarding ur choice now i m confused lot. bcz +999.99 is a wrong declaration. its a receiving pic clause not specification. so choice a will do i think so but at the same time if V99 is specified it will take as 12345 not as 123.45 .. so this is the confusion. plz b patient. let any one say the right solution. i too waiting for that. |
|
Back to top |
|
|
sungang77
New User
Joined: 03 Nov 2005 Posts: 46 Location: Shanghai, China
|
|
|
|
khamarutheen wrote: |
hi frnd,
i doesn't mean to check out with brainbench. i mean that to check out with ur cobol compiler. k. any way u have a practise test in that. try out with that. it gives u only few questions and also with solution. try out. Regarding ur choice now i m confused lot. bcz +999.99 is a wrong declaration. its a receiving pic clause not specification. so choice a will do i think so but at the same time if V99 is specified it will take as 12345 not as 123.45 .. so this is the confusion. plz b patient. let any one say the right solution. i too waiting for that. |
Hi khamarutheen,
I am sorry to tell you I haven't COBOL compiler now. I can only send to my friend to test it. Wait for me. |
|
Back to top |
|
|
|