View previous topic :: View next topic
|
Author |
Message |
vcjadhav Warnings : 1 New User
Joined: 27 May 2008 Posts: 19 Location: India
|
|
|
|
What does PP stand for in the above declaration? |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
See topic 5, table 10 in the Enterprise Language Reference Manual. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
FYI - "the Enterprise Language Reference Manual" is available via the "IBM Manuals" link at the top of the page. |
|
Back to top |
|
|
vcjadhav Warnings : 1 New User
Joined: 27 May 2008 Posts: 19 Location: India
|
|
|
|
I have checked the above link but the material was not much clear to explain my doubt. I think giving an example would help.
For eg. If I define a variable PIC 9(04)PP and move the value 1234 in it and try displaying the same value the value then the data that gets displayed is 0012.
However if I have 2 fields one var-1 PIC 9(04) and var-2 PIC 9(04)PP then if I move 1234 in var-1 and 1234 in var-2 and then do the following things:
display var-1 (it displays 1234)
display var-2 (it displays 0012)
add both variables i.ae., var-1 + var-2 (it displays 2434)
I would like to know whats the significance of using PP ? and why does it behave differently while displaying the data and while using it for calculations. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
P in a PICTURE is a scaling factor -- having two of them means the value of the variable is expressed in hundreds. When you move 1234 to the field, the 34 is discarded since only the hundreds and more significant digits will be kept. So when you display the value, you see 12 (i.e., 12 hundred). Adding the two variables together, 1234 + 1200 = 2434, so the system is showing the expected behavior. There is no difference in behavior; there's a problem in how you see the behavior but COBOL is consistent and follows the manual in this case. |
|
Back to top |
|
|
|