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!

SELECT statement in File control 1

Status
Not open for further replies.

naseems2000

Programmer
Jun 28, 2002
3
IN
SELECT INPUT-FILE ASSIGN TO INPFILE
FILE STATUS IS WS-INPUT-FILE-STATUS
ORGANIZATION SEQUENTIAL
ACCESS SEQUENTIAL.

How do Organisation and access sequential help?
 
Basically, ORGANIZATION describes how the file is built - the file could be indexed or entry sequenced, for example.

ACCESS describes how the program intends to access records within the file. It is possible, for instance, to have an indexed file that is being accessed sequentially.

Run-time performance can be greatly influenced by how these statements are used. For example, an indexed file with ACCESS RANDOM is expected to perform more poorly compared to ACCESS SEQUENTIAL - because the IO is typically more optimized when reading a file sequentially.

I hope this helps.

Dimandja
 
Hi Naseem,

I'd just add this to Dimandja's excellent explanation:

The Organization can only reflect how the file was created. It cannot change the character of the file.

With Indexed Files you have a choice of Sequential Access or Random. Some compilers provide a Dynamic Access that allows the programmer to switch from sequential to Random Access and back again throughout the pgm as (s)he sees fit to do.

There are default setting for Org and Access. You can check the doc. But the point is that it's there even if you don't see it.

Regards, Jack.
 
Depends on how the compiler options are set. On some compilers, Sequential Organization and Sequential Access are the default and need not be included. If you do not like my post feel free to point out your opinion or my errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top