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
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
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.