Hi,
Is there something wrong to declare a numeric variable as S9(11).9(1) in Cobol? I get compilation error if I try this.
Please help in knowing what is wrong with this?
Variable declaration as S9(11).9(1).
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Variable declaration as S9(11).9(1).
Yes, there is something wrong -- the compiler is telling you that you cannot do that.
The period means your data is numeric-edited, NOT numeric. And the S is allowed for numeric data but not numeric-edited PICTURE clauses. You can use +, -, CR, or DB to denote the sign in a numeric-edited PICTURE, but you cannot use the S.
The period means your data is numeric-edited, NOT numeric. And the S is allowed for numeric data but not numeric-edited PICTURE clauses. You can use +, -, CR, or DB to denote the sign in a numeric-edited PICTURE, but you cannot use the S.
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