×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

NetCOBOL Delete Action

NetCOBOL Delete Action

NetCOBOL Delete Action

(OP)
The NetCOBOL Win11.0 Language Reference guide shows that a RECORD can be deleted in NetCobol (Delete a record at 6.4.11 in the guide)

However, I do not see documentation on how to delete a file in a Cobol program in the NetCOBOL environment.
In practical coding, execution and observation, I have been able to delete a RECORD
HOWEVER
I have not been able to delete a file in my Cobol program as one might do in other flavors of Cobol

Eg. Delete filename

The resulting status code is a 49 (A DELETE or REWRITE operation has been tried on a file that is not opened I-O.)

Just to be sure the file was opened as I-O, I put the following couple of lines of code before the delete statement:
Open i-o mymast.
Close mymast.
Delete mymast.

STILL got the 49 error code

I would be interested in knowing how to code in NetCobol so that I could delete the file. Your help would be very much appreciated.

Here is how the file is defined.

FILE-CONTROL.
SELECT mymast-file ASSIGN TO "mymast,EXFH"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS cm-mynumb
FILE STATUS IS mymast-status

FILE SECTION.
FD mymast-file
RECORD IS VARYING IN SIZE FROM 16 TO 1024 CHARACTERS.
01 mymast-record.
03 cm-mynumb PIC X(4).
03 cm-myzipc PIC X(9).
03 cm-myloc PIC X(2).
03 cm-myrtng PIC X(1).
03 cm-myname PIC X(47).
03 cm-myaddr PIC X(47).
03 cm-mycity PIC X(47).



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close