Skip to main content

Problem:

Yo might be getting error 48 on a write to file in subprogram.

Main_Program opens file output and writes header record to the file, no errors.

Main_Program calls Sub_Program.

In the Sub_program when try to write to this file opened in Main_Program get error 48 file status.

Resolution:

Make sure the compiler directive ASSIGN(External) is used for the file.

In both the Main_Program and Sub_Program,  the FD section for the file lets call the file "File_out"  need to add external to the FD. This will prevent the error 48 from occurring.

For example:

FD   File_out  External.

01   File_out_record      PIC X(1000).

Old KB# 3902

#netexpress
#RMCOBOL
#COBOL
#AcuCobol
#ServerExpress