REMOVE

Syntax

── REMOVE ─┬──────────────────────────────────────────────┬────────────┤
           ├─ SOURCE ─────────────────────────────────────┤
           ├─ OBJECT ─────────────────────────────────────┤
           ├─<remove file list>───────────────────────────┤
           │ ┌◄───────── , ────────┐                      │
           └─┴─<remove from group>─┴─┬────────────────────┤
                                     └─<remove file list>─┘

<remove file list>

──<remove file>─┬─────────────────────┬─┬────────────────────────┬─────┤
                └─ ON ──<family name>─┘ │ ┌◄───────────────────┐ │
                                        └─┴─ , ──<remove file>─┴─┘

<remove file>

──┬────────────────┬─┬─<file name>──────┬──────────────────────────────┤
  ├─ SOURCE ───────┤ └─<directory name>─┘
  └─ OBJECT ─┬─────┤
             └─ $ ─┘

<remove from group>

  ┌◄────── , ─────┐
──┴─<remove file>─┴─ FROM ──<family name>──────────────────────────────┤

Explanation

The REMOVE command removes the work file, files, or directories from disk.

When a file is removed, it is immediately removed from the system directory; therefore, no program can find it. The actual data areas remain available to any program that has the file open at the time of the remove. CANDE saves a copy of the file in the work file area if the file being removed is required for the present work file. In this case, CANDE returns a message stating that the work source has been retrieved. However, this protective action only occurs when the CANDE REMOVE command is used in the current session. If the work file source is removed by a program (or a WFL REMOVE or a CANDE REMOVE in another session), a copy will not be preserved.

If a <family name> construct is specified, the command applies only to the file name or directory name on the volume associated with the family name. For example, REMOVE FILEX ON DISK affects only files found on DISK even though the family specification for the session is FAMILY DISK = USERPACK OTHERWISE OTHERPACK.

If a family name is not specified, the command applies to the file name or directory name found on DISK. If DISK is also the <target family> in the family specification for the session, then the only files affected by the command are those on the <substitute family>. Files on the <alternate family> are not affected.

In a <remove from group> construct, a FROM <family name> clause applies to all the file names or directory names in that <remove from group>. An ON <family name> clause applies only to the immediately preceding <file name>. An ON clause cannot precede a FROM clause in the same command. An ON <family name> clause can be specified only for the first name in a <remove file list> construct.

A work file source is not removed when specified with an ON <family name> or FROM <family name> clause if the family name is other than the substitute family; however, the work file source is removed when the work file is removed or saved.

When specifying a file name or directory name, a user logged on under a nonprivileged usercode cannot enter a usercode specification other than the usercode for the current session.

If the REMOVE command is used to remove a file whose LOCKEDFILE file attribute is set to TRUE, that file is not deleted. CANDE displays the following message to indicate that the file was not removed:

<file name> NOT REMOVED (LOCKEDFILE).

See the ALTER command earlier in this section for more information about changing the LOCKEDFILE attribute. For more information about the LOCKEDFILE file attribute, refer to the File Attributes Programming Reference Manual.

If SOURCE or OBJECT is used as a file name, it must be enclosed in quotation marks to distinguish it from the keywords SOURCE and OBJECT.

The following paragraphs contain an explanation for each syntactic variation of the REMOVE command.

REMOVE

REMOVE SOURCE

REMOVE OBJECT

REMOVE removes the work file and any associated work object file. If REMOVE SOURCE is used, the work source file (source) is removed, but any associated work object file (object) remains available to be executed or saved. If REMOVE OBJECT is used, the work object file is removed, and the work source file remains.

REMOVE <file name>

REMOVE SOURCE <file name>

REMOVE OBJECT <file name>

REMOVE OBJECT $ <file name>

REMOVE <file name> removes any file with the specified file name. Any object file associated with the file name is also removed. The REMOVE SOURCE <file name> form removes the file with the specified file name, but does not remove the object file associated with the file name. The REMOVE OBJECT <file name> form removes only the object file associated with the file name. If a dollar sign ($) follows OBJECT, it indicates that the object file to be removed is stored as the file name, not as OBJECT/<file name>, so only the file with the specified file name is removed.

REMOVE <directory name>

REMOVE SOURCE <directory name>

REMOVE OBJECT <directory name>

REMOVE OBJECT $ <directory name>

REMOVE <directory name> removes all files in the directory with the specified directory name. If the files in the object directory associated with the directory name exist, they are also removed. The REMOVE SOURCE <directory name> form removes the files in the directory with the specified directory name but does not remove the files in the object directory associated with the directory name. The REMOVE OBJECT <directory name> form removes the files of the object directory associated with the directory name. If a dollar sign ($) follows OBJECT, it indicates that the object files to be removed are stored in the directory with the specified directory name, not in the associated object directory, so only the directory with the specified directory name is removed.

Examples

G D/F
#WORKFILE D/F: SEQ, 1 RECORD, SAVED

FIX 100/2/1
#

REMOVE D/=, F/=, TEMP, SOURCE UTIL, Z, OBJECT O/PROG
#WORKSOURCE D/F RETRIEVED
#1 FILE IN (UZER)D/= REMOVED ON USERPACK
#2 FILES IN (UZER)F/= REMOVED ON USERPACK
#1 FILE IN (UZER)OBJECT/F/= REMOVED ON USERPACK
#(UZER)TEMP ON USERPACK REMOVED
#(UZER)UTIL ON USERPACK REMOVED
#(UZER)OBJECT/Z ON USERPACK REMOVED (NO SOURCE)
#(UZER)OBJECT/O/PROG REMOVED ON USERPACK

FILES D
#NO FILE(S) ON USERPACK

WHAT
#WORKFILE D/F: SEQ, 1 RECORD (THRU 100) 
REMOVE
#

REMOVE F, D/= FROM OTHERPACK
#(UZER)F REMOVED ON OTHERPACK
#3 FILES IN (UZER)D/= REMOVED ON PACK