Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MicroFocus COBOL Sequential file w/o CR/LF

Status
Not open for further replies.

TonyG

Programmer
Nov 6, 2000
79
US
Hello,

Does anybody know how to read a RECORD SEQUENTIAL ASCII file with one record in it that has no CR/LF (hex 0D0A) at the end of it under MSDOS 6.22 on a PC.

Any help would be appreciated.

Thanks
Tony
 
Tony,

In my previous answer, the solution was there: it was a binairy way of reading records.

Use a recordlength of 1 byte in the same way and you can read anything.
 
Hi Crox,

I'm sorry. When i looked at your program, i did'nt understand what was happening. However, since you replied to this message, i looked at it again and will try what you suggest.

Thanks again
Tony
 
Hi Crox,

I tried your suggestion and i am able to open the file, but when i go to read it, i get File Status =10.

Any ideas.

Thanks again
Tony
 


Hi,

filestatus 10 means end-of-file. Did you read byte by byte?

It is so strange that it doesn't work...

Perhaps you should write this particular part in CA-REALIA COBOL.

Perhaps you can place your small read-routine here with your e-mail address....

Perhaps I try this one with my old MicroFocus compiler which I use only for some particular customers... It worked with DBase files with the source you got...

Ahhh! Got an idea!

You can change your input in a DOS way:

create one file with your editor with one empty line.
Say you call it CRLF.ASC

Now you do the following command:

copy /b myfile+crlf.asc newfile

And now try to process the newfile...
It has a carriage return/line feed inside.

 
Hello Crox,

What do you mean by "Did you read byte by byte?" ?

Should i only read one byte at a time ?

Your program doesn't indicate that. It reads a record at a time.

I think i'll try your suggestion to copy with a CR/LF file.

Thanks again,
Tony
 
With byte by byte I mean that you make a record length of one single byte for this situation you have. Try it with the code you were testing. You can put those bytes into one string in working storage... It will not be fast but the job will be done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top