Why VARCHAR is declared on level 49 only?

Previous topicNext topic

Topic Author
Nitin Gadge
Registered Member
Posts: 20
Joined: Tue Aug 20, 2013 11:32 am

Why VARCHAR is declared on level 49 only?

Post by Nitin Gadge » Sat Jul 16, 2016 12:06 pm


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.

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1379
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

Re: Why VARCHAR is declared on level 49 only?

Post by Robert Sample » Sat Jul 16, 2016 3:13 pm

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.

Previous topicNext topic

Return to “IBM DB2.”