File Management

WFL provides several statements for managing files. These include the following:

  • COPY statement

  • ADD statement

  • CHANGE statement

  • REMOVE statement

  • SECURITY statement

File Management Statements

The COPY statement copies files on disk or tape. The new copy of a file can be created with a different usercode or file name, and the file can be copied to other disk or tape units using library maintenance or to other hosts using distributed systems services (DSS).

The ADD statement also copies files. However, the ADD statement will not copy a file if a file with the same title already resides at the destination. Also, the destination specified must be a disk. The ADD statement is useful for adding a directory of files to a disk where some of the files are already resident and are to be preserved.

The CHANGE statement changes the names of files on a disk. The REMOVE statement removes files from disk.

The SECURITY statement changes the security specifications of files on a disk. The various security settings affect whether the file can be read or changed by tasks running under other usercodes.

Examples

The following example copies a file from a disk to a tape, specifying a different usercode and file name for the new copy:

COPY (ID)FILEA AS (JONES)NEWF FROM ORDS (DISK) TO SAVEA (TAPE);

The following example copies a directory of files to a disk on another host:

ADD (ID)F/= FROM ORDS (DISK) TO SAVEA (DISK, HOSTNAME=MLM); 

The following example changes the name of a directory of files residing on a pack named STORPACK:

CHANGE COMPJOBS/= ON STORPACK TO QCOMPS/=;  

The following example removes files from two different packs:

REMOVE MAXERRS FROM PARTS, BADERRS FROM STORPACK;  

The following example changes the security of a file to PUBLIC (thus enabling any user free access to the file):

SECURITY NOVA/DATA/NINER PUBLIC;