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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete or edit a record from a file?

Status
Not open for further replies.

Goenitz

Technical User
Sep 11, 2002
7
SG
i m a beginner who had wrote codes to write records into a *.dat file and can also read from a file.
So in my menu i wish to create extra options to delete and edit records. Can anyone help me by providing my some sample codes or the logic behind it.

The file record in the file section is:

01 CUSTOMER-REC.
02 CUSTOMER-NAME PIC X(20).
02 STREET-NO PIC X(25).
02 CITY-STATE-ZIP PIC X(25).
02 CREDIT-PUR-AMT PIC 9(6)V99.
02 NO-OF-PAYMENTS PIC 9(2).
 
To delete record: study the DELETE verb.

To edit record: study the REWRITE verb.

If you haven't studied indexed files yet, you need to read about indexed files. 99.9 percent of DELETEs and REWRITEs are applied to indexed files.

Good luck! Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top