DSCCPY.DOC DSCCPY - FORTRAN program to copy just a few files from a DSC tape without restoring the entire volume. William D. Burton, Jr. Texas Research Institute of Mental Sciences 1300 Moursund Houston, Texas 77030 (713) 797-1976 ext 501 Modifications: 3-Nov-81, WB-005, Put confirmation of files copied on LUN-5 so it can go to some other device. Add count of files copied. 2-Nov-81, WB-004, Add option to select files to be copied on the basis of creation date. 28-Aug-81, WB-003, Do not unload after rewind 22-Jun-81, WB-002, Fix overwrite of files 22-Jun-81, WB-001, Allow 1600 BPI tape. I needed a program to copy some files from a DSC (Disk-Save-and- Compress) tape from a large disk onto an RK-05. DSCCPY is the result. It was written in FORTRAN (Fortran-IV-Plus v 2.51) and MACRO and has run under RSX-11M V3.0 (sic) and IAS. USING THE PROGRAM: This program is controlled by user responses to prompts. It will not accept indirect command files). The input tape(s) are UNMOUNTED. The reels of a multi-reel set do not have to be read in sequence PROVIDED that the data file being copied does not cross reels. 1. The Input tape must be UNMOUNTED 2. The Output Disk must be MOUNTED. 3. Run DSCCPY and answer the questions: a. prompt = ENTER TAPE INPUT UNIT answer = input tape device name (e.g. MT1:) program action = Assign Fortran LUN 3 to the specified device. Attach device and rewind. answer = control-Z program action = exit. b. prompt = TAPE DENSITY (800 OR 1600 BPI) answer = Integer 800 or 1600 for density of tape. default is 800 bpi. program action = Set density of tape using QIO. DSCCPY.DOC (continued) c. prompt = DSC TAPE FILE NAME answer = 12-character file name specified when tape was created. a wildcard (*) matches any name. A wild character (?) matches any single character. answer = a null input (carriage return only) inhibits the search for a named DSC output file. This is the response which must be used if the first reel of a multiple reel tape is NOT being read. program action = Search for the ANSI HDR1 record with the specified label. If not found on the current reel, return to step 3a. d. prompt = OUTPUT DEVICE AND UIC DDU:[UIC] answer = Disk output device where the restored file is to be put. No wildcards. The defaults are the normal Fortran defaults for LUN 4. program action = Check for the desired volume being mounted. e. prompt = FILE TO BE COPIED answer = [OWNING UIC]filename.ext;version of the file to be located and copied. Any field can be wildcard (*) or contain wild-characters (?) answer = /FI:filn,filsn this allows the user to copy a single file using its original file-number (filn),file-sequence-number. NO wildcards or wild-characters. program action = Search for the file specified and copy to the output. If the file is not on the current reel of a multi-reel tape, a prompt for the new reel will be issued. If the file is not in this volume (i.e. an ANSI EOF record is found) an error message is output. If the file already exists (same Directory, name, extension, version) an error message is produced and the file is not copied. f. prompt = FILENAME CONTAINS WILD CHARACTERS, COPY MULTIPLE FILES? answer = Y program action = multiple files will be copied. Prompt (g) will be produced (creation date selection) answer = N program action = Only the first file which matches will be copied. No selection on creation date. NOTE the file copied will not necessarily be the one with the highest version number. DSCCPY.DOC (continued) g. prompt = MULTIPLE FILES WILL BE COPIED SELECT BY CREATION DATE? [BEFORE: ON: AFTER: DD-MMM-YY] -ONLY IMPLIES NO DATE SELECTION ? answer = OPTION: dd-mmm-yy where OPTION = BEFORE, ON, AFTER dd-mmm-yy = date OPTION must be followed by either a : or a space. No other spaces are allowed. Date must be in the form specified. program action = file header of file with matching name will be checked to see if the creation date falls in the range implied by the option. If it does, the file will be copied. answer = (null line) program action = No selection by creation date. h. prompt = WARNING, FILE ALREADY EXISTS FILENAME: DO YOU WANT TO: C COPY ANYWAY (OVERWRITE) S SKIP COPYYYING THIS FILE N CREATE A NEW VERSION answer = C, S, or N default is to skip program action: C - program will overwrite the old file. S - program will skip the copy (the new input file) N - Will cause the version number of the offending new file to be stripped off. Then the file will be open for output, creating a new "most recent" version. DSCCPY.DOC (continued) NOTES AND LIMITATIONS: 1. This program has been used on both 7-track and 9-track TM-11 look-alike drives. Routine NXTAPE was changed to allow 1600 bpi tapes. 2. If DATA OVERRUN errors (-13. IE.DAO) occur, the size of the tape input buffer can be increased using PARAMETER NRLTH= newsize in the main program. The buffer should never be less than 1040. bytes. 3. Error checking on the prompt input filenames is very primitive. Only a simple check on the syntax of the file specifier is done. Illegal characters in the fields are not detected. This will lead to "NOT FOUND" type errors. 4. There is no verify of the copied data. 5. The /FI:filn,seqn command does not accept wildcards or wild characters 6. Because directory files are not guaranteed to be on the same reel as the file being copied, and I didn't want to have to read the whole DSC volume, I chose to use the file identifier as found in the files-11 file header. If a file has been re-named before being DSC-ed this file identifier will not match the directory entry. The /FI: option can be used to find the file, given a DSCDIR listing of the directories. 7. As much information as practical of the original file-header is preserved with the copied file. Because I did not want to do the copy with the index-file UNLocked not all information is preserved. The following items from the file header are preserved during the copy: file name, extension, version space allocated and contiguous/non-contiguous indication end-of-file pointer record attributes The following information is NOT preserved: DIRECTORY uic OWNING uic creation date and time last update date and time mapping DSCCPY.DOC (continued) INSTALLING DSCCPY DSCCPY was originally compiled under F4P (version 2.51). It uses some MACRO-11 routines for string and FDB manipulation. The distribution includes the following files: DSCCPY.FTN -- Fortran main program DSCFTN.FTN -- Fortran subroutines DSCMAC.MAC -- Macro-11 subroutines DSCCPY.CMD -- Task build command file DSCCPY.DOC -- This document. Compile or Assemble as appropriate, the 3 source files. Edit the task build command file to reflect your configuration if needed. The device assignments for luns 3 and 4 are changed in response to user prompts at run-time.