I am able to read an external file but how do i retreive the data from the txt file per line?
ex. text file has the following in it:
dog
cat
rat

how do i just display dog and then cat and then rat one by one?

thanks.

Let's see what you've got so far.

Member Avatar for dnmurphy

It will depend on your platform and your version of cobol and how it's designed to handle .txt files.

you need to provide more information. Its also pretty basic stuff that should be in your product documentation.

I'm assuming that you're on an IBM platform. Other platforms may have similar capabilities.

If you want sequential records, Relative Record Number (RRN) is a convenient way to go. I can also retrieve records randomly.
VSAM is also a good choice, perhaps even better for your application.
RRN is super-fast, but this may be irrelevant on today's computers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.