On 06 Feb 2013 12:31, Raul A. Jager W. wrote:
I have a file that I want to make "read only".
I know that CRTPF has a parameter to forbid updates and deletes, and
the file can be only be written.

But of course that could not be legitimately called "read-only", because the Allow Insert would still remain as one of the valid\allowed capabilities. Also IIRC, the CLRPFM is still allowed for a member even with ALWDLT(*NO).

DSPFD shows the attribute, now my question is if I can set the read
only in an existing file?

None that I am aware of. There is however the option to: Move the existing file, then create a new file with that same name [using CRTPF ALWDLT(*NO) ALWUPD(*NO)] that will be the replacement for the old file. Either create the members and copy or restore the data, restore the members with the data, or copy the members and the data. Be sure to establish the correct ownership and use the request to GRTOBJAUT REFOBJ(renamed_file) to set the authorities on the new file that replaces the old file. The effective instructions for use of restoring the members\data:
http://archive.midrange.com/midrange-l/201301/msg01198.html

Note that Triggers are another means to control the I/O, and Triggers are the only effective means to control what could be called ALWINS or ALWWRT [displayed as ¿Allow Insert or Allow Write? in DSPFD] to fully prohibit the write capability; that and the Allow Read capability are AFaIK still restricted to only "system" interfaces. Similarly I believe for the Clear Physical File Member, a delete trigger is required to prevent that [reset dataspace; i.e. not delete row] method from effectively deleting all rows regardless of a disallow delete capability.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.