Leibnitz for Unix

Introduction

The following image should look familiar to anyone that has ever created a library tape on the Unisys A10.

#BOT 1380 LIBRARY/MAINTENANCE
#1380 (JOB)RESTART/USERTAPE1 REPLACED ON DISK.
#1380 (JOB)RESTART/USERTAPE1 COPIED FROM SPECIALAM TO DISK.
#1380 (JOB)RESTART/USERTAPE2 REPLACED ON DISK.
#1380 (JOB)RESTART/USERTAPE2 COPIED FROM SPECIALAM TO DISK.
#1380 (JOB)RESTART/USERTAPE3 REPLACED ON DISK.
#1380 (JOB)RESTART/USERTAPE3 COPIED FROM SPECIALAM TO DISK.
#1380 (JOB)RESTART/USERTAPE4 REPLACED ON DISK.
#1380 (JOB)RESTART/USERTAPE4 COPIED FROM SPECIALAM TO DISK.
#1380 (JOB)RESTART/USERTAPE5 REPLACED ON DISK.
#1380 (JOB)RESTART/USERTAPE5 COPIED FROM SPECIALAM TO DISK.
#1380 (JOB)RESTART/USERTAPE6 REPLACED ON DISK.
#1380 (JOB)RESTART/USERTAPE6 COPIED FROM SPECIALAM TO DISK.
#1380 (JOB)RESTART/USERTAPE7 REPLACED ON DISK.
#1380 (JOB)RESTART/USERTAPE7 COPIED FROM SPECIALAM TO DISK.
#1380 (JOB)RESTART/USERTAPE8 REPLACED ON DISK.
#1380 (JOB)RESTART/USERTAPE8 COPIED FROM SPECIALAM TO DISK.
#1380 (JOB)RESTART/USERTAPE9 REPLACED ON DISK.
#1380 (JOB)RESTART/USERTAPE9 COPIED FROM SPECIALAM TO DISK.
#EOT 1380 LIBRARY/MAINTENANCE


This particular screen shot, however, was taken from UNIX.SRI.COM. Leibnitz is a Unix utility that can read Unisys library tapes as well as labeled data tapes using ANSI standard labels. The command line that invoked this function was

COPY '(JOB)RESTART/=' FROM SPECIALAM
The single-quotes were needed because Unix requires them, but you get the idea.

Syntax

copy source { as destination } from tapename (+/-filekind)

Except for the program name, all parameters are case-insensitive. The syntax should be familiar except for the +/-filekind tag which is described below.

source is the same syntax that you would use on the Unisys except that you must deal with special characters (like parentheses) on the command line. You can specify a single filename or an entire directory by ending the directory with the equal character.

destination is optional and allows you to rename the files as they are copied. This is especially convenient if you don't like my naming conventions (see below).

source { as destincation } may also be a comma separated list, just like you are used to.

tapename is of course the name of the tape, and it must agree with the label of the tape you are reading. If the tape kind is not a Library Maintenance tape and the volume identifier is blank, any value for tapename is allowed.

Some companys do not follow the convention for Ansi standard labels and will sometimes place the serial number where the volume name is suppose to be. If this occurs, it will be obvious because Leibnitz will display that name. Simply use the serial number displayed as the tapename.

+/-filekind allows you to control how the data is converted when copied to Unix. The + and - play an important role in how this is done.

Filekind must be a valid filekind mnemonic. The program already assumes that some filekinds should be translated while others should not; for example, files whose filekind is JOBSYMBOL will have a new-line character inserted at the end of each line and will be translated to Ascii if their EXTMODE is EBCDIC. Thus to copy JOBSYMBOL files without this option you would specify something like this.

COPY '(DENIS)=' FROM USERTAPE2 -JOBSYMBOL
One or more filekinds can be passed on the command line. You can also use the keyword all to specify that all filekinds should (or shouldn't) be converted.

COPY = FROM SPECIALAM +ALL
The entire list of valid filekinds and their default setting (+ or -) can be found at the end of this document. You'll note that DATA is not set by default! This is the one filekind you'll probably want to arm, but because DATA can also contain binary data, the default will not convert this to Ascii nor append a new-line character.

unloadTape

If you are used to using unloadTape to copy data files created by Search, these files can now be copied to a library maintenance tape instead. You might specify something like this to produce the same effect:

COPY '(MSCUE)=' AS = FROM MYTAPE +DATA
Because we specified a desitination, the default naming convention for usercoded files is turned off and the files are created in your current directory (specify a directory name to place them in another directory). Data files will have a new-line appended to each record and will be converted to Ascii.

You can also use leibnitz to copy tapes that were not created with Library Maintenance. The syntax is identical except that the tapename is ignored if the volume identifier is blank; for example, where you now specify unloadTape, this would be changed to the following:

COPY = FROM MYTAPE +DATA
unloadTape is quite good and has served us well; however, leibnitz should be slightly more efficient since it does not create temporary disk files and has the additional benefit that it can perform a reel switch for files that span more than one volume.

Installation

Copies of leibnitz reside in /usr/local/bin on both Astro and unix.sri.com. Simply create an alias as follows:

Put this in your .cshrc file so you won't have to remember to do this every time you log on.

Some Useful Notes

  • Usercoded files are created under the directory called USERCODE. This is consistent with Unix naming conventions and eliminates any problems with global filenames that might reside on the tape. Use the destination option if you don't like this convention.

  • Special characters are preserved when copied to Unix and do not need to be quoted; however, Unix does not like filenames to contain a forward slash even if that name is quoted. I couldn't figure out how to do it so Unisys files that use a forward slash as a special character in their name will have that character replaced by a backward slash (\).

  • You cannot specify "special characters" on the command line. If you need to copy a file containing special characters in its name, you will have to copy the complete directory in which is resides.

  • The log file is called leibnitz.log. This looks similar to a Unisys LFILES and may contain additional information if the program detects a descrepancy; for example, the total number of bytes in the file is calculated to be the record size times the number of records in the file (including the new-line character if that was added as well). Sometimes this value will not match the total number of bytes in the file, and will occur when the last record written is partially filled. The program does not warn about such conditions (and it usually does not occur), but an appropriate message will be displayed if the file size is greater than what was expected or smaller than the length of one record.

  • While I have not tested non-fixed filetypes, these should be copied correctly since the program is simply copying blocks of data; however, non-fixed filetypes would have to be read with programs designed to read them.

    Library Maintenance tapes contain the complete disk image of a file including wasted space in a block; for example, a file with a blocksize of 200 characters wastes 160 bytes in each block so this must be discarded when the file is copied.

    In the case of variable length record types, although the record length is variable, the block length is not. And since records do not span blocks, a block will contain "unused" areas. It would be possible to add the code to handle each filetype and create an appropriate Unix file, but it doesn't do it now so you'll have to handle this yourself.

  • I haven't had the nerve to do a reel-switch yet! I'll let you know when I do (or you can let me know).

  • If you interrupt the program (or it cores), the tape will not be positioned at the beginning. If you rerun, you'll get a nasty message saying so, but this will also rewind the tape, and you can then try the copy again.

  • Unix does not allow a file to be both a file and a directory. Unfortunately, the Unisys does allow this. When this happens, whichever is copied first will be successful. The other is not copied!

    You can get around this [Unix] limitation by copying the directory and filename into separate directories; for example,

    COPY '(DENIS)SYMBOL/INTRINSICS,' '(DENIS)SYMBOL/INTRINSICS/=' AS INTRINSICS/= FROM DENISPKDUMP
    
  • Leibnitz will report BLOCKCOUNT and RECORDCOUNT errors if the number of blocks or records do not match the value for UBCNT and URCNT in the End of File header.

  • Leibnitz will report an I/O Error if the sequence number on each block read is incorrect. This sequence number helps to insure that the file is not damaged.

  • Leibnitz will say an I/O error has occured if it can't find a special pattern that is written to some blocks. This special pattern occurs when the ROWSIZE is not a multiple of the blocksize used to create this tape.

  • Leibnitz will say Operation not supported when the EXTMODE and BLOCKSIZE are not envenly divisible by 8, and the file will not be copied.

  • Leibnitz will exit with -1 for any fatal error or the number of non-fatal warnings otherwise. An exit status of 0, for example, means no warnings were produced.

    Appendix A

    These are the filekinds and their default setting that you are allowed to specify. There are no others, and if the program sees a filekind that is not in this list, no translation can occur; however, it will still copy the file.

    FilekindValueDefault
    NULLFILE 0 -
    DIRECTORY 1 -
    SYSTEMDIRECTORY 2 -
    CATALOG 3 -
    BACKUPPRINTER 4 -
    RECONSTRUCTIONFILE 5 -
    SYSTEMDIRFILE 6 -
    JOBDESCFILE 7 -
    ARCHIVELOG 8 -
    BOOTCODE 9 -
    BACKUPVSID 10 -
    DASDLDATA 11 -
    FTAUDIT 13 -
    RESTRICTEDFILE 14 -
    XDISKFILE 15 -
    KEYSFILE 16 -
    BACKUPPUNCH 17 -
    REMOTEBACKUP 18 -
    REMOTEAUDIT 19 -
    COMPILERCODEFILE 20 -
    CHECKPOINTFILE 21 -
    CPJOBFILE 22 -
    DCPCODE 23 -
    NDLCODE 24 -
    NDLIICODE 25 -
    RECOVERYFILE 26 -
    SCHEDULEFILE 27 -
    INFOFILE 28 -
    LIBRARYCODE 29 -
    INTRINSICFILE 30 -
    MCPCODEFILE 31 -
    ALGOLCODE 32 -
    COBOLCODE 33 -
    FORTRANCODE 34 -
    XALGOLCODE 35 -
    PLICODE 36 -
    JOVIALCODE 37 -
    ESPOLCODE 39 -
    DCALGOLCODE 40 -
    BASICCODE 41 -
    XFORTRANCODE 42 -
    JOBCODE 43 -
    DMALGOLCODE 44 -
    NEWPCODE 45 -
    SANSCODE 46 -
    PASCALCODE 47 -
    RPGCODE 48 -
    FORTRAN77CODE 50 -
    SORTCODE 53 -
    COBOL74CODE 54 -
    CCCODE 55 -
    MODULA2CODE 56 -
    COBOL85CODE 57 -
    BOUNDCODE 62 -
    CODEFILE 63 -
    ALGOLSYMBOL 64 +
    COBOLSYMBOL 65 +
    FORTRANSYMBOL 66 +
    XALGOLSYMBOL 67 +
    PLISYMBOL 68 +
    JOVIALSYMBOL 69 +
    ESPOLSYMBOL 71 +
    DCALGOLSYMBOL 72 +
    BASICSYMBOL 73 +
    XFORTRANSYMBOL 74 +
    JOBSYMBOL 75 +
    VFORTRANSYMBOL 77 +
    SFORTRANSYMBOL 78 +
    NEWPSYMBOL 79 +
    SANSSYMBOL 80 +
    PASCALSYMBOL 81 +
    RPGSYMBOL 82 +
    NDLIISYMBOL 83 +
    FORTRAN77SYMBOL 84 +
    SORTSYMBOL 85 +
    COBOL74SYMBOL 86 +
    CCSYMBOL 87 +
    MODULA2SYMBOL 88 +
    COBOL85SYMBOL 89 +
    BINDERSYMBOL 94 +
    DASDLSYMBOL 95 +
    DMALGOLSYMBOL 96 +
    DCPSYMBOL 97 +
    NDLSYMBOL 98 +
    LOG 99 -
    MDLCODE 104 -
    MDLSYMBOL 105 +
    VFORTRANCODE 106 -
    VLINKEDCODE 107 -
    VMCPCODE 108 -
    LCOBOLSYMBOL 109 +
    LCOBOLSL3CODE 110 -
    LCOBOLSL5CODE 111 -
    SFORTRANCODE 112 -
    SLINKEDCODE 113 -
    SMCPCODE 114 -
    FIRMWARE 115 -
    OHNESYMBOL 116 -
    MDTTEST 165 -
    MDTDUMP 166 -
    PROMBURNERDATA 167 -
    CONFIGURATIONDATA 168 -
    CONFIDENCECODE 169 -
    MP1FIRMWARE 176 -
    MP1ALGOLCODE 177 -
    FONT 181 -
    FORM 182 -
    GRAPHICS 183 -
    BDDATA 191 -
    DATA 192 -
    SEQDATA 193 +
    GUARDFILE 194 -
    APLFILE 195 -
    APLWORKSPACE 196 -
    CDATA 197 +
    CSEQDATA 198 +
    DBRESTARTSET 199 -
    DBDATA 200 -
    TEXTDATA 201 +
    PRINTERCONTROLFILE202 -
    FTPDATA 203 -
    PDUMPFILE 204 -
    FOLDER 205 -
    MSGDRAFT 206 -





    Denis D. Workman / http://Sybernet.sri.com/