Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with some Cobol parsing 1

Status
Not open for further replies.

Mundane

Programmer
Aug 14, 2006
2
NO
I got a specification for a report format I need to understand. It is explained using some Cobol stuff, but I've never read Cobol and noone else around can help me.

Can anyone explain how to parse:
Pic -(10)9,99

How many bytes is it? What is a valid value?
After reading an old Cobol book I thought it was 14 bytes and a valid value was "-1234567890,00", but that doesnt look right...
 
but that doesnt look right
Why ?
Probably a DECIMAL POINT IS COMMA clause in the SPECIAL-NAMES paragraph.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
It is 14 characters long.

It is a numeric edited item that is used for output (as in your report, but not for arithmetic. Since you are in Europe, as PHV suggests you will almost certainly find the DECIMAL POINT IS COMMA in the ENVIRONMENT DIVISION, CONFIGURATION SECTION, SPECIAL-NAMES paragraph. Therefore, the ',' character is the radix point.

The -(10) reserves 10 characters, and specifies leading (nonsignificant leftmost) zero digit suppress, with a floating minus sign for negative numbers. Positive or zero numbers will not display a sign.

The 9 to the left of the radix point specifies that this position will always show a digit, even if it is a nonsignificant leading zero.

The 99 to the right of the radix point specifies that the tenths and hundredths digits will always be displayed.

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top