The COPY processor has always had a few quirks.
See the IRIS USER REFERENCE manual for R7.4 in the downloads area.
COPY is described in Section 5.9.
1. Ambiguous Documentation
Section 5.9 describes a feature that copies the file as an image (including header info) and not just copy the contents. The syntax, however, looks like it uses a left arrow instead of an equal sign. This weird format apparently is needed for Formatted Data Files so that the format info in the file header gets copied as well. Note: that syntax should be an underscore character. For example,
# COPY NEWFILE _ OLDFILE ( instead of ) # COPY NEWFILE = OLDFILE
2. Copying Contiguous files
No example is given in the manual for how to copy a contiguous file, but COPY can do it. But you need to supply the format, which needs to match the source file. Begin with a QUERY of the source file so you can be sure of the format, then supply the necessary parameters, for example:
# COPY [300:8] NEWFILE = ORIGINALFILE
3. File Type not preserved
COPY does NOT retain the source file type. For example, if you copy the QUERY processor, which has TYPE = 33401, the resulting destination will be TYPE = 77001. Which since it is missing the 400 bit, will not run as a processor. In this particular case, the problem can be remedied with the CHANGE processor, setting the R,L,I control digit to 4 (runnable processor).
4. TRAPS with certain file types
If you include driver files in the syntax, things get interesting. First, if you have a “$” sign on the destination, COPY will attempt to open the device and print the source file. You can even add a “#” parameter to set the number of lines per page. However, it seems that the only driver allowed for a destination is “$LPT” so the feature is quite restricted. Similarly, the only drivers allowed for a source are $PTP and $PTM, and COPY will attempt to read those devices.
If you remove the “$” from a driver, and then use it as the source, COPY will produce a TRAP. This appears to be an oversight in the code, which simply fails to take file type 36 seriously.
The simple solution is to first change the driver to a Stand-Alone TYPE 3 file with DSP, then COPY the file, and then change the TYPE back to 36 in both files. ( the TYPE word is at displacement 10 in the file header ).
# DSP F LPT H 10:3 # COPY LPT2 = LPT !COPIED # DSP F LPT H 10:36 F LPT2 H 10:36 #