HPlogo Native Mode Spooler Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 5 Utilities

COPY

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Copies all or part of one or many spool files to a new spool file.

Syntax

   > C[OPY] [spoolfileid [,spoolfileid [,...] ];

             * ;

             username[.acctname];

             seleq ; ] 



   [range[,filename] ]

where range is

   [ [recnumber [{+

                  -} offset]

      * [{+

          -} offset]

      FIRST [{+

              -} offset]

      LAST [{+

             -} offset] ] [, count

                           / recnumber[{+ offset]

                                        -}

                           / * [{+

                                 -}offset]

                           / FIRST [{+

                                     -} offset]

                           / LAST [{+

                                    -} offset] ]

      ALL ]

Semantics

Range expressions are limited to:

(first line number of file) <= expression <= (last line number of file).

Lines are numbered from 0 to N-1. No error is generated for exceeding these limits; SPIFF simply limits the expression. For example, FIRST-2 evaluates to FIRST.

The following situations, although syntactically valid, are semantic errors and are flagged as such:

  • Specifying a first position range expression that evaluates to a greater line number than that of the second position range expression.

    The expression, not its components, is tested. A range of LAST/FIRST is always an error, but a range of LAST-20/FIRST+40 is valid for any file consisting of no more than 61 lines (numbered 0 to 60).

  • Omitting the source file syntax (spoolfileid, username, etc.) unless you have previously TEXTed in a spool file. If you have no currently TEXTed spool file, the source file specification is a required parameter.

Parameters

spoolfileid

An existing spoolid to which the user has access. This specifies the source of the data to be copied. To be taken as a spoolid (instead of a username), this parameter must begin with a number or with a pound sign (#). The full syntax is [#O]nnnnn, where the n's represent digits. If the # is used, the O must also be used. If the O is used without the #, the parameter is interpreted as a username and will probably cause an error.

username

The name of a user on the system. This parameter, when used with the optional acctname, specifies the set of spool files to copy. Full MPE wildcarding is supported. The SPIFF user must have access to files generated by username. Refer to “Security ”.

acctname

The name of an account on the system. This parameter, when used with the username, specifies the set of spool files to copy. If omitted, the logon account is assumed. Full MPE wildcarding is supported. The SPIFF user must have access to files generated by users in acctname. Refer to “Security ”.

seleq

A native mode spooler selection equation specifying the set of spool files to copy. The selection equation must be enclosed in brackets as in the following example that copies all spool files created by the user MANAGER.SYS with priority less than 3:

   COPY [OWNER=MANAGER.SYS AND PRI<3];ALL

If you choose this (seleq) form of file set selection, SPIFF inserts an OWNER=!HPUSER.!HPACCOUNT in its internal selection equation, unless you explicitly include your own OWNER definition. This prevents users with SM, OP, or AM capabilities from accidentally accessing files that they did not create.

Consult one of the following documents for more information about selection equation syntax and semantics:

  • MPE/iX Commands Reference Manual Volumes 1 and 2 (32650-60115)

  • MPE/iX online help facility

range

The range of lines of the spool file(s) to copy. By default, only the current record is copied. Any line number specified that is outside the range of lines in the spool file will be handled as though FIRST or LAST was specified, as appropriate. If your range consists of two expressions, the first expression must evaluate to a number no larger the second.

filename

The name of the target file, the file being copied to. You may specify filename with or without the backreferencing *, as long as the corresponding file equation already exists.

If you omit this parameter, SPIFF tries to open the target file using the formal file designator of the first source spool file.

The controlling file equation may have been canceled with a RESET command since the source spool file was created. In this case, the attributes of the source spool file are given to the target spool file.

Similarly, the file equation may have been redefined. If that case, the file equation will prevail, because it overrides any HPFOPEN parameters specified by SPIFF.

ALL

Specifies that all of the records in the spool file(s) should be copied. No other range element is allowed if this keyword is used.

FIRST

The first record in the spool file.

LAST

The last record in the spool file.

*
  • When used as a source file specification, * specifies the current spool file.

  • When used as a range element, * specifies the current record in the spool file.

recnumber

An absolute record or line number of text in the spool file. Records are numbered starting with 0.

offset

A relative number of records before (-) or after (+) the specified record.

count

A numeric value, the number of lines to be copied, including the starting record.

Operation Notes

The COPY command (abbreviated C) copies all or a range of one or more spool files to a new spooled device file (filename). The new spool file is closed at the end of the command and enters the READY state. Spool files may be designated explicitly in a list (for example, #O12345, #O67890), by user and/or account (MYUSER.MYACCT), or by selection equation.

If you have a current spool file, you may omit the source file specification and SPIFF will take its source from the current spool file. It is an error to omit the source file specification if you do not have a current spool file.

The last source file processed remains as the current spool file, regardless of any earlier current spool file. If you have TEXTed in #O18450, but you then COPY #O18451,#O18452;ALL, the current spool file at the end of the command is #O18452.

The target file must be a local spooled device file. An ordinary disc file, a spooled device file on a remote node, or a non-spooled device file (such as a tape drive) is not supported and, if specified, results in an error.

The FCOPY subsystem can be used to create such a target file, but this is not recommended: except for the remotely spooled device file, doing so deletes information from the target file, which is usually vital to printing data properly. Once this information has been deleted, it cannot be recovered.

Examples of such information include:

  • The control field for HP2680 environment file records. Without this information, the data in the records appears as unintelligible random characters.

  • Prespace/postspace information. Without it, all records are printed in postspace mode.

  • Information that indicates whether or not the first byte of data in each record should be treated as carriage control.

A remotely spooled device file—one that exists on another system node—is not supported and, if specified, results in an empty spool file on the remote system and an error message. SPIFF cannot delete this empty spool file on the remote system.

Entering CtrlY during command execution stops the execution after the current record is transferred. The current target file is closed. The current source file remains open as the current spool file.

When you interrupt a copy operation with CtrlY, the identity of the last record transferred is usually not known. Therefore, you should regenerate the file or use it to create a new target file with the desired subset of records.

Examples

EXAMPLES OF range:

   */*+20

   *-20/*

   ALL

   FIRST/LAST

   */LAST

   LAST-100/LAST

   FIRST,20

   100/200

   5

EXAMPLES OF COMMANDS:

   FILE MYLP;DEV=LP

   FILE MYPP;DEV=PP;ENV=MYENV

   COPY #O6490;ALL

Creates a new spool file with attributes identical to #O6490.

   COPY [OWNER=MYUSER.MYACCT];ALL,*MYPP

Creates a new spool file targeted to device class PP using environment file MYENV. Spool Files belonging to MYUSER.MYACCT are copies to the target file following the environment information.

   COPY 101,102,103;ALL,*MYPP

This is the same as the previous example, except that an explicit list of spoolfileids has been used.

COPY [OWNER=SOMEBODY.ELSE];ALL,*MYLP

The specified fileset contains no accessible spoolfiles. (SPERR 82)

The user does not have SM or OP capability or is not an AM user in the ELSE account.

COPY 10000;ALL

One or more of the specified spoolfile(s) is invalid. (SPERR 44)

Spool file #O10000 does not exist or is inaccessible to this user.

Assume that MYLP is a terminal for a session and that spoolfileid 101 was sent to it.

> :FILE MYLP=$STDLIST

> COPY 101;ALL

The target of a COPY or APPEND command must be a local spooled devicefile (SPERR 124)

>

Redefining the attributes of MYLP makes it impossible to copy spoolfileid #O101 to MYLP.

   >COPY ALL, *MYPP

   You have no current TEXT file (SPERR 81)

No source spool file is specified nor was one opened in an earlier command.

Feedback to webmaster