Micro Focus® Object COBOL

Programmer's Guide to File Handling



Micro Focus®

Issue 4a
September 2002


Copyright © 2002 Micro Focus International Limited.
All rights reserved.

Micro Focus International Limited has made every effort to ensure that this book is correct and accurate, but reserves the right to make changes without notice at its sole discretion at any time. The software described in this document is supplied under a license and may be used or copied only in accordance with the terms of such license, and in particular any warranty of fitness of Micro Focus software products for any particular purpose is expressly excluded and in no event will Micro Focus be liable for any consequential loss.

Animator®, COBOL Workbench®, EnterpriseLink®, Mainframe Express®, Micro Focus®, Net Express®, REQL® and Revolve® are registered trademarks, and AAI™, Analyzer™, Application to Application Interface™, AddPack™, AppTrack™, AssetMiner™, CCI™, DataConnect™, Dialog System™, EuroSmart™, FixPack™, LEVEL II COBOL™, License Management Facility™, License Server™, Mainframe Access™, Mainframe Manager™, Micro Focus COBOL™, Object COBOL™, OpenESQL™, Personal COBOL™, Professional COBOL™, Server Express™, SmartFind™, SmartFind Plus™, SmartFix™, SourceConnect™, Toolbox™, VS COBOL™, WebSync™, and Xilerator™ are trademarks of Micro Focus International Limited. All other trademarks are the property of their respective owners.

No part of this publication, with the exception of the software product user documentation contained on a CD-ROM, may be copied, photocopied, reproduced, transmitted, transcribed, or reduced to any electronic medium or machine-readable form without prior written consent of Micro Focus International Limited.

Licensees may duplicate the software product user documentation contained on a CD-ROM, but only to the extent necessary to support the users authorized access to the software under the license agreement. Any reproduction of the documentation, regardless of whether the documentation is reproduced in whole or in part, must be accompanied by this copyright statement in its entirety, without modification.

U.S. GOVERNMENT RESTRICTED RIGHTS. It is acknowledged that the Software and the Documentation were developed at private expense, that no part is in the public domain, and that the Software and Documentation are Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to them. Use, duplication or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause at DFAR 252.227-7013 et. seq. or subparagraphs (c)(1) and (2) of the Commercial Computer Software Restricted Rights at FAR 52.227-19, as applicable. Contractor is Micro Focus International Limited, 9420 Key West Avenue, Rockville, Maryland 20850. Rights are reserved under copyright laws of the United States with respect to unpublished portions of the Software.


About this Book

The Micro Focus Object COBOL Programmer's Guides are complete guides to specific areas of the Micro Focus COBOL systems.

This guide contains everything you need to know to use data files with a Micro Focus COBOL system, from standard COBOL file formats to relational databases.

Audience

You should be familiar with the COBOL language and with your operating system. You should read the Getting Started book for this COBOL system and be familiar with the COBOL development cycle described in the User Guide before reading other books in the book set.

Environments

Micro Focus COBOL systems are available for DOS, Windows, Windows 95, Windows NT, and OS/2 V2.1 or later, and for many varieties of UNIX. Both 32-bit and 16-bit versions are available (16-bit is not available on UNIX).

Some of the books supplied with this COBOL system are generic across all these environments. Other books are specific to your operating system, but might contain some generic chapters. The chapter Welcome! in your Getting Started book explains this in detail.

Conventions

In the books, unless otherwise stated:

Side Headings

In a generic book or chapter, text that does not apply to all supported environments and COBOL systems is marked by a side heading in the left margin. A side heading applies to the paragraph it is next to, unless it is next to the first paragraph in a section, in which case it applies to that whole section.

The following examples of side headings show what they mean:

UNIX:
This text applies to the 32-bit COBOL system on UNIX.

DOS, Windows and OS/2:
This text applies to the 16-bit or 32-bit COBOL system on DOS, Windows, Windows 95, Windows NT, and OS/2 V2.1 or later.

16-bit:
This text applies to the 16-bit COBOL system on DOS, Windows, Windows 95, Windows NT, and OS/2 V2.1 or later.

32-bit:
This text applies to the 32-bit COBOL system on UNIX, Windows 95, Windows NT, and OS/2 V2.1 or later.

32-bit for Windows NT and OS/2:
This text applies to the 32-bit COBOL system on Windows 95, Windows NT, and OS/2 V2.1 or later.

Notation

The notation used in the books is as follows:

Command Lines

The notation used to describe the format of command lines is as follows:

Notes

Key to COBOL System Library Routines

Descriptions for all of the call-by-name routines appear alphabetically. Each description contains the routine name and function and the following entries (as appropriate):

Syntax: Shows the CALL statement you could use to call the routine.

The optional RETURNING clause is also shown. Every routine returns a value showing the result of the operation. Unless otherwise indicated, zero indicates success, nonzero indicates failure. This value is left in the data item specified in the RETURNING clause, in this reference, status-code. If this clause is omitted, the value is left in the special register RETURN-CODE. (If call-convention bit two is set, RETURN-CODE is not changed.)

status-code must be a numeric data item capable of holding positive values from 0 to 65535; for example, PIC X(2) COMP-5.

The name of the routine must be coded in upper case.

Parameters: Describes any parameters shown in the RETURNING and USING clause. A parameter enclosed in brackets, for example, [parameter1] is optional and might not be needed for all forms of the routine.
On Entry: Indicates which of the parameters shown are passed on entry.
On Exit: Indicates which of the parameters shown are returned on exit.

Where bits of one or more bytes are referenced, bit 0 is the least significant (rightmost) bit.

Comments: Provides any additional information necessary for the successful use of the routine.
Related Topics: Lists other related topics.