DTRHELP.HLB  —  Functions  FN$SETDEFPROT  Example
       The following example shows how to change the default file
       protection from within your DEC DATATRIEVE process and how to
       restore the old default file protection to its original status
       before exiting DEC DATATRIEVE.

       DTR> PRINT FORMAT FN$SHOWDEFPROT USING X(80)
       SYSTEM:RWED,OWNER:RWED,GROUP:RWED,WORLD:

       DTR> DECLARE OLDPROT PIC X(80).
       DTR> OLDPROT = FN$SHOWDEFPROT
       DTR> PRINT OLDPROT

                                           OLDPROT

       SYSTEM:RWED,OWNER:RWED,GROUP:RWED,WORLD:
       DTR> FN$SETDEFPROT ("S:RWED,O:RWED")
       DTR> PRINT FORMAT FN$SHOWDEFPROT USING X(80)
       SYSTEM:RWED,OWNER:RWED,GROUP:,WORLD:

       DTR> DEFINE DOMAIN H USING H_REC ON H.DAT;
       DTR> DEFINE RECORD H_REC USING
       DFN> 01 H_REC.
       DFN> 03 F1 PIC X(7).
       DFN> 03 F2 PIC X(10). ;
       DTR> DEFINE FILE FOR H;
       DTR> FN$DCL ("DIR/PROT *.DAT")

       Directory DISK:[DALFY.NEWUSER]

       EMPLOYEES.DAT;1      10-FEB-1993 11:06:03.39  (RWED,RWED,RWED,)
       FAMILY.DAT;108       25-MAR-1992 21:44:53.30  (RWED,RWED,RWED,)
       FAMS.DAT;1            6-AUG-1992 15:33:51.24  (RWED,RWED,RWED,)
       H.DAT;1              24-MAR-1993 09:47:39.31  (RWED,RWED,,)

       Total of 4 files.
       DTR> FN$SETDEFPROT (OLDPROT)
       DTR> PRINT FORMAT FN$SHOWDEFPROT USING X(80)

       SYSTEM:RWED,OWNER:RWED,GROUP:RWED,WORLD:

       DTR> EXIT
       $ SHOW PROTECTION
         SYSTEM=RWED, OWNER=RWED, GROUP=RWED, WORLD=NO ACCESS
       $
Close Help