COBOL Runtime Error Code – 021 File is a directory (Fatal) -You have tr

In this post, you’ll learn about the COBOL runtime Error Code 021 and the reason why you are receiving it

COBOL Error Code :

021

Reason for this Error in COBOL

File is a directory (Fatal) -You have tried to WRITE to a directory instead of to a file. Alternately, the attributes are not set up correctly to allow you to access a file. That is, it is marked as read-only or you don’t have sufficient rights to open it. -Recode your program so that it writes to a file and not to a directory. You need to either change your file access attributes or recode your program so that it does not violate the existing attributes.