tags:

views:

445

answers:

2

Sample output:

Prod id: XXXXXX

Prod desc:

Prod qty

Prod price

Do you want to delete this record?

By just entering the ID I can access the information about it and ask me if am I going to delete the record.

Can anyone help me? I am a bit new in Cobol. I am using 1985 cobol and running it in Windows Vista OS.

+1  A: 

If you're wanting to delete the current record from , you want something like this:

DELETE file
     ON INVALID KEY 
          what to do 
     NOT ON INVALID KEY
          what to do
END-DELETE

To delete the file itself you want to be in JCL or the local equivalent (e.g. the os).

MarkusQ
+1  A: 

If the file is opened sequentially then execute a DELETE statement after having READ that record into the program.

If the file is opened random or dynamic then use the DELETE statement with the RELATIVE KEY or RECORD KEY set to the record to be deleted (no need to read the record before the delete).

In both cases the mininum coding for the statement would be:

DELETE file-name.

Paul Morgan