COPY

The COPY statement performs any of the following operations:

  • Creates a file containing syntax describing the USERDATAFILE

  • Creates a new SYSTEM/USERDATAFILE based on the current USERDATAFILE

The COPY statement involves reading an existing USERDATAFILE and possibly creating a new non-usercoded USERDATAFILE. A usercode designated with the SECADMIN attribute only does not have sufficient privileges to use the COPY statement. The user must also be designated with the PU attribute, or with a combination of the CHANGE, CREATEFILE, READ and REMOVE granulated privileges. The required granulated privileges depend on the disposition of the old USERDATAFILE, the security attributes of the old USERDATAFILE, and the type of COPY.

Syntax

── COPY ─┬─ NEW ─┬───────────────┬─────────────────────────────────────┤
         │       └─<disposition>─┤
         ├─ PRINTER ─────────────┤
         └─ DISK ──<file name>───┘

Explanation

The following paragraphs describe the various functions of the COPY statement.

NEW

Specifies that a new *SYSTEM/USERDATAFILE is to be written. Any deleted entries or vacated locations are discarded, and a new index is built. The COPY NEW function removes unneeded data and index optimization when the USERDATAFILE has become unwieldy as a result of many alterations.

PRINTER or DISK

Causes MAKEUSER to generate output, in source-input (card image) form, of syntax describing the current USERDATAFILE. You can direct the output to a line printer or disk file, and you can use the generated output as data to create a *SYSTEM/USERDATAFILE like the current file.

Empty data is not copied. Data entered using defines or default defines is expanded in the output. If DISK is specified, the output lines have data in columns 1 through 72 and are serially numbered (in increments of 100) in columns 73 through 80. If PRINTER alone is selected, output lines are unnumbered and occupy the available columns. See Output Conventions for more information.

CANDE might be unable to edit the generated output properly due to the nonprintable characters contained in the users' password list. To remedy this situation, recompile MAKEUSER with the $SET VISIBLE option. For more information about the VISIBLE option, see the discussion of <password> under Basic MAKEUSER Constructs.

The COPY function is accepted at any time other than during CREATE mode. Make changes in update mode, and then copy the file. You can invoke the COPY functions—NEW, PRINTER, and DISK—in any combination or one at a time.

When MAKEUSER returns a message warning that the USERDATAFILE is nearly full, use COPY NEW to write a new USERDATAFILE with an index large enough to accommodate up to 25 percent more entries than are in the current USERDATAFILE. There is no limit on the number of times you can use COPY NEW to enlarge the capacity of the USERDATAFILE.