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

APPEND

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Appends all or part of one or many spool files to a new spool file. The first spool file processed by the command creates the new spool file. Subsequent spool files are appended to it.

Syntax

   > AP[PEND]

   [  [spoolfileid [,spoolfileid [,...] ];

       * ;

       username[.acctname ];

       seleq 

       ;] [range[,filename] ]  

   END ]  

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:

  • Using APPEND END when you have not opened an append filename.

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

    Note that 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.), or specifying * as the source file, unless you have a current spool file. A current spool file is one that has been explicitly TEXTed in, or is current because it is the last spool file processed by the COPY, APPEND or BROWSE command.

    If you have no current spool file, the source file specification (something other than *) is a required parameter.

Parameters

spoolfileid

An existing spoolid to which the user has access. 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 append. 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 username, specifies the set of spool files to append. Full MPE wildcarding is supported. Default: the logon account is assumed. 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 append. The selection equation must be enclosed in brackets as in the following example which appends all spool files created by the user MANAGER.SYS with priority less than 3:

   APPEND [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 acessing 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

Refer to the discussion of selection equations for the LISTSPF or SPOOLF MPE/iX command.

range

The range of lines of the spool file(s) to append. By default, only the current record is appended. 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 than than the second.

filename

The name of the target file, the file being appended to. It must be a spooled file. 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. In 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 appended. 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 appended, including the starting record.

END

Closes the current append file, terminating append access to it.

Operation Notes

The APPEND command (abbreviated AP) appends all or a range of one or more spool files to a new spooled devicefile (filename in the syntax above). Spool files may be designated explicitly in a list (#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. For example, if you have TEXTed in #O18450, but you then APPEND #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 following:

  • 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.

Once a target device file has been opened, any spool files specified in this command or subsequent APPEND commands are appended to it until an APPEND END command is entered. At that time, the device file is closed and enters the READY state. The next APPEND command will open a new target device file.

NOTE: If you use the seleq or username.acctname form, and if this resolves to more than one file, the order in which these files are appended to the target file is determined by the underlying LISTSPF command generated by SPIFF.

In general, for a given device or class queue, the order of source spool files is determined first by output priority, then by the time they first entered the READY state. To ensure a specific order in the target file, enter an explicit list of spoolid's. These will be processed in left-to-right order.

Entering CtrlY during command execution stops the execution after the current record is transferred. The current target file remains open for possible use by subsequent APPEND commands. The current source file remains open as the current spool file.

When you interrupt an append 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 append 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



   APPEND #O6490;ALL

Creates a new spool file with attributes identical to #O6490. The new spool file remains open until closed with APPEND END.

   APPEND [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 appended to this environment information.

   APPEND 101,102,103;ALL,*MYPP

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

APPEND [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.

APPEND 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

> APPEND 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.

   >APPEND ALL, *MYPP

   You have no current TEXT file (SPERR 81)

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

> T #O357

> FIND @ "header: Start APPEND at next line"

100 This is the end of the header: Start APPEND at next line

>APPEND */LAST, *MYPP

After LISTing or FINDing a line, the current record pointer is advanced to the next record. Here the APPEND will start with record number 101.

Feedback to webmaster