Page 1 of 1

Why VARCHAR is declared on level 49 only?

Posted: Sat Jul 16, 2016 12:06 pm
by Nitin Gadge
Hi,

In ouy team we copy the existing DCLGEN from prod to create new DCLGEN. As per a new requirement I have to add a new column in the existing table. I noticed that a level number 49 is used to declare the VARCHR and it's mandatory for declaring the Varchar columns.
 
I have searched a lot but I could not really get the reason and logic behind it that why the varchar columns must be declared on
level number 49? What can be the reason? If someon of you can guide me on this it would be grat help.

Re: Why VARCHAR is declared on level 49 only?

Posted: Sat Jul 16, 2016 3:13 pm
by Robert Sample
the short answer is because that is the way it works.  You cannot always find out why something is the way it is; you just have to live with it.
My personal thought is that 49 is the lowest COBOL level allowed for a variable and nobody wanted to allow a VARCHAR variable to be a group.