View previous topic :: View next topic
|
Author |
Message |
shilpa.m7
New User
Joined: 02 Jun 2011 Posts: 4 Location: hyderabad
|
|
|
|
hi, can any one give me a demonstration code on usage of picture clause P |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What does the manual say? What happened when you try to demonstrate it? Can't say as I've ever used it, just seen it in error messaged "...discarded unless picture clase is Pand-then-lots-of-stuff-for-old-UK-pounds-shillings-and-pence-currency."
A voyage of discovery. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
A piece from the Language Reference:
Quote: |
With some exceptions, numeric literals in a VALUE clause must have a value
within the range of values indicated by the PICTURE clause for the item. For
example, for PICTURE 99PPP, the literal must be zero or within the range 1000
through 99000. For PICTURE PPP99, the literal must be within the range 0.00000
through 0.00099.
|
So in the first example, the value you have (0-99) represents the number of Thousands. Fifty thousand would be 50 and then the three P's represent the number of zeros inserted before the decimal place arrives. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
What do you want to accomplish and where are you stuck?
If you have nothing specific you are looking for, suggest you read the information in the COBOL manual (there is a link to IBM Manuals at the top of the page) and then do a bit of experimenting on your system.
If there are any questions / problems, post back here and someone should be able to clarify. |
|
Back to top |
|
|
|