Page 2 of 2

Re: Read a physical file that doesn't have a logical file?

PostPosted: Sat Jul 14, 2012 11:33 pm
by dick scherrer
Hello,

Which COBOL are you using? There are several available for Win-based systems and *nix.

As far as i know, all of them support the SORT verb. In your COBOL documentation, look for the info about SORT. A SORT statement requires an SD (instead of an FD) and the statement starts like:
SORT SORT-FILE ON ASCENDING. . . .

I've used this on all of the main platforms in use today. While we are mostly a mainframe forum, we may be able to help with COBOL language specific questions. Platform specifics, maybe not as much,

If you are using MicroFocus COBOL, there are sites that host MicroFocus questions - i don't have any links as none of my clients is currently using COBOL on LUW systems.

Re: Read a physical file that doesn't have a logical file?

PostPosted: Sat Jul 14, 2012 11:37 pm
by dick scherrer
Add on:

As far as logical versus physical files, the way i think of them is that a logical file is what the program works with while the physical file is the actual data on whatever media it resides.

In COBOL the SELECT / ASSIGN connects the logical to the physical.

Probably an over simplification but i find it handy. . .

Re: Read a physical file that doesn't have a logical file?

PostPosted: Sun Jul 15, 2012 9:11 pm
by dexik
Cool, I will try the SORT verb.

Thank you guys, you're awesome.

NB. Apparently I had a permission to copy the physical file. I copied it to my library and compiled the logical file no problem.

Re: Read a physical file that doesn't have a logical file?

PostPosted: Mon Jul 16, 2012 2:33 am
by dick scherrer
Hello,

Good luck using SORT - someone will be here if there are questns. One suggestion - do not code the USING/GIVING form as this typically wastes resources. As an expirement, USING / GIVING might be ok, but usually there is sort pre-processing and/or post-processing so coding INPUT PROCEDURE and/or OUTPUT PROCEDURE performs better.

I copied it to my library and compiled the logical file no problem.
If a physical file was copied from one place to another place, it is a new physical file - Not a logical file. I believe there is still confusion between them. . .