Comments on: Delete a record from COBOL/400 filehttp://itknowledgeexchange.techtarget.com/itanswers/cobol400-7/
Sun, 02 Aug 2015 08:47:57 +0000hourly1By: tomliottahttp://itknowledgeexchange.techtarget.com/itanswers/cobol400-7/#comment-95167
Thu, 11 Aug 2011 06:54:19 +0000#comment-95167Since the file pointer cannot be placed at a particular record the application is not allowing me to delete a record.

The question is not making total sense.

If you want to position to a particular record and then DELETE it, why is the file defined with ACCESS as SEQUENTIAL? Change the ACCESS to RANDOM or DYNAMIC. And if you want to DELETE, change from ORGANIZATION as SEQUENTIAL to RELATIVE or INDEXED.

What exactly do you want to do?

Tom

]]>By: richk1151http://itknowledgeexchange.techtarget.com/itanswers/cobol400-7/#comment-95160
Thu, 11 Aug 2011 00:02:19 +0000#comment-95160You can declare the file as RELATIVE in your Cobol program. As long as you know the RRN you can set your relative key to that record, read it then delete it.
]]>By: mvrkrishnahttp://itknowledgeexchange.techtarget.com/itanswers/cobol400-7/#comment-95128
Wed, 10 Aug 2011 02:25:48 +0000#comment-95128If the file has ACCESS is SEQUENTIAL, we cannot use the START keyword for placing the file pointer, ACCESS will happen as per the RRN.

Since the file pointer cannot be placed at a particular record the application is not allowing me to delete a record.

]]>By: tomliottahttp://itknowledgeexchange.techtarget.com/itanswers/cobol400-7/#comment-95082
Mon, 08 Aug 2011 20:43:49 +0000#comment-95082Also, note that the OPEN must be coded I-O rather than just INPUT.