Using s9(03).9(02) in cobol?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Sushil
Registered Member
Posts: 23
Joined: Sat Nov 23, 2013 2:56 am

Using s9(03).9(02) in cobol?

Post by Sushil »

Hi,

In COBOL, why there is restriction on using something like s9(03).9(02)? Why the complier dos not accept it? Can someone please advise.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Using s9(03).9(02) in cobol?

Post by Robert Sample »

PIC S9(03).9(02) mixes picture symbols in an invalid way. PIC S means the variable has a sign so the values can be negative or positive, while the decimal point means the picture is a numeric edited picture; with numeric edited pictures if you include a sign it needs to be explicitly occupying a position or more (+, -, CR for example). In the Enterprise COBOL V6.1 Language Reference manual, page 207 has a table listing which PICTURE symbols can be combined with the others.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”