Skip to main content

FD missing for file filename.  How do I fix this syntax error?

FD missing for file filename.  How do I fix this syntax error?

Hi Kevin. Are you just learning COBOL?

If you are then we do offer a new course that will teach COBOL to you up on our website here

Every SELECT filename statement defined in the File-Control paragraph has to have a matching FD defined in the File Section of the Data Division.

Example:

file-control.

    select test-file assign to "testfile.dat".

data division.
file section.
fd test-file.
01 test-record pic x(80).


Hi Kevin. Are you just learning COBOL?

If you are then we do offer a new course that will teach COBOL to you up on our website here

Every SELECT filename statement defined in the File-Control paragraph has to have a matching FD defined in the File Section of the Data Division.

Example:

file-control.

    select test-file assign to "testfile.dat".

data division.
file section.
fd test-file.
01 test-record pic x(80).

I deleted my post so I'm not sure why it posted anyway.  I programmed COBOL over 20 years ago so I'm a bit rusty.  I did some research and found the answer.  I'll look at the course offering.  Thanks.