Skip to main content

I have a data file from an outside source that I am trying to read in my Cobol program but it doesn't seem to like the CRLF at the end of each record.

Is there an easy way in the Cobol program to handle this, or do I need to go into a hex editor to remove these characters?

The SELECT statement for the file is:

SELECT SALESFILE ASSIGN TO "..\\..\\..\\SALES.DAT"

ORGANIZATION IS SEQUENTIAL.

Thanks


#Filehandling
#linefeed
#Carriagereturn

I have a data file from an outside source that I am trying to read in my Cobol program but it doesn't seem to like the CRLF at the end of each record.

Is there an easy way in the Cobol program to handle this, or do I need to go into a hex editor to remove these characters?

The SELECT statement for the file is:

SELECT SALESFILE ASSIGN TO "..\\..\\..\\SALES.DAT"

ORGANIZATION IS SEQUENTIAL.

Thanks


#Filehandling
#linefeed
#Carriagereturn

Change SELECT statement to

ORGANIZATION  IS  LINE SEQUENTIAL


I have a data file from an outside source that I am trying to read in my Cobol program but it doesn't seem to like the CRLF at the end of each record.

Is there an easy way in the Cobol program to handle this, or do I need to go into a hex editor to remove these characters?

The SELECT statement for the file is:

SELECT SALESFILE ASSIGN TO "..\\..\\..\\SALES.DAT"

ORGANIZATION IS SEQUENTIAL.

Thanks


#Filehandling
#linefeed
#Carriagereturn

Thank you very much!  I'm new to PC based Cobol, so this helped.