Routines to allocate media and interface to the TMS

Allocate new piece of media

 +----------------------------------------------------------------------+
 | CALL  FMALLO (MEDIA,DENS,COMPACT,LIB,POOL,LBANK,CHOPT,VSN*,VID*,IRC*) |
 +----------------------------------------------------------------------+
                                  

MEDIA
Character variable of length 4 to specify the medium required.
DENS
Character variable specifying the required density. Reserved for future use
COMPACT
Character variable specifying whether compaction is required or not. Reserved for future use
LIB
Character variable to specify the library from which the allocated volume should come. At CERN, a library consists of a two letter experimental code followed by the tape store name, such as PVDPVAULT, PV-ARCHIVE.
POOL
Character variable to specify the pool from which the allocated volume should come. Pools can be used to separate libraries into groups, such as EA0001-EA1000 for DSTs, EA1001-EA9999 for Rawdata etc.
LBANK
Integer variable to input the address of the bank corresponding to the generic name for which the medium is to be allocated
CHOPT
Character variable to specify the type of operation required.
VSN
Character variable of length 6 in which the VSN is returned.
VID
Character variable of length 6 in which the VID is returned.
IRC
Integer variable in which the return code is returned.

This routine allocates a new piece of medium of the type specified. The allocation is performed by calling the Tape Management System (TMS).

                Example of using the routine  FMALLO
                                  

      CHARACTER*6 VSN,VID
*
*     Allocate a 3480 from the pool XVPROD in the library SMCF_1
*
      CALL FMALLO('3480','38K',' ','SMCF_1','XVPROD',LBANK,' ',
     +VSN,VID,IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMALLO'

Get volume from name pool with sufficient free space

     +--------------------------------------------------------------+
     |CALL  FMGVOL (GENAM,LBANK,KEYS,CHLIB,CHPOOL,CHFREE,CHOPT,IRC*) |
     +--------------------------------------------------------------+
                                  

GENAM
Character variable of maximum length 255 to specify the generic name.
LBANK
Integer variable to return the address of the bank corresponding to the generic name GENAM. If LBANK is non-zero on input, the information in the bank at LBANK will be used.
KEYS
Integer array of length 10 to return the keys vector associated with the specified generic name. If LBANK is zero, KEYS may be used to select a specific copy of a file.
CHLIB
Character variable specifying the TMS library in which the specified pool(s) reside
CHPOOL
Character variable specifying the TMS pool that is to be searched for a volume with sufficient space. The space requirement is taken from the file size field MFSZFA of the FATMEN bank or catalogue entry.
CHFREE
Character variable specifying the TMS pool from which a new volume is allocated in the case the the pool CHPOOL contains no volumes or no volumes with sufficient space.
CHOPT
Character variable specifying the options required.
IRC
Integer variable in which the return code is returned.

This routine allocates a tape volume with sufficient space for the current file. The FATMEN bank is automatically updated with the volume information (FATMEN fields MVSNFA, MVIDFA and MFSQFA in the case of successful operation.

+----------------------------------------------------------------------------+
|CALL  FMGVID (IFREE,IMEDIA,CHLIB,CHPOOL,CHFREE,CHVSN,CHVID,IFILE,CHOPT,IRC*) |
+----------------------------------------------------------------------------+
                                  

IFREE
Integer variable specifying the space requirement in Megabytes
IMEDIA
Integer variable specifying the media type. This is used to obtain the high water mark and maximum capacity.
CHLIB
Character variable specifying the TMS library in which the specified pool(s) reside
CHPOOL
Character variable specifying the TMS pool that is to be searched for a volume with sufficient space.
CHFREE
Character variable specifying the TMS pool from which a new volume is allocated in the case the the pool CHPOOL contains no volumes or no volumes with sufficient space.
CHVSN
Character variable in which the VSN of the allocated volume is returned.
CHVID
Character variable in which the VID of the allocated volume is returned.
IFILE
Integer variable in which the file sequence number on the allocated volume is returned.
CHOPT
Character variable specifying the options required.
IRC
Integer variable in which the return code is returned.

Manipulate VOLINFO tag field

               +------------------------------------------+
               | CALL  FMVINF (CHVID,MB,NFILES,CHOPT,IRC*) |
               +------------------------------------------+
                                  

CHVID
Character variable specifying the volume for which the VOLINFO tag is to be treated.
MB
Integer variable in which the number of megabytes stored on the current volume is input or returned depending on the value of the CHOPT argument.
NFILES
Integer variable in which the number of files on the current volume is input or returned depending on the value of the CHOPT argument.
CHOPT
Character variable specifying the options required.
S
Set the VOLINFO tag to contain the values specified in the MB and NFILES arguments
G
Return in the MB and NFILES arguments the current information in the VOLINFO tag
I
Increment the information in the VOLINFO tag. The space used is incremented by the value contained in the MB argument, the number of files is incremented by one and the NFILES argument is ignored.
IRC
Integer variable in which the return code is returned.

Move volumes between TMS pools

           +--------------------------------------------------+
           | CALL  FMPOOL (GENAM,LBANK,KEYS,CHPOOL,CHOPT,IRC*) |
           +--------------------------------------------------+
                                  

GENAM
Character variable of maximum length 255 to specify the generic name.
LBANK
Integer variable to return the address of the bank corresponding to the generic name GENAM. If LBANK is non-zero on input, the information in the bank at LBANK will be used.
KEYS
Integer array of length 10 to return the keys vector associated with the specified generic name. If LBANK is zero, KEYS may be used to select a specific copy of a file.
CHOPT
Character variable specifying the options required.
L
write lock
U
unlock (write enable)
P
privileged]transfer even if not owner
D
delete the TMS tag
S
set the TMS tag to the generic name
B
binary tag
T
text tag (D)
IRC
Integer variable in which the return code is returned.

This routine allows you to transfer tape volumes between named pools in the Tape Management System (TMS). In addition, one can set or delete the TMS text or binary tags associated with the volume.

As an example of its use, one might wish to do the following:

  1. Allocate a tape volume from a named pool, e.g. XXFREE
  2. Write a DST
  3. If successful, move the volume to XXDSTS, write lock it, and set the TMS text tag to be the FATMEN generic name.

    Conversely, when returning the volume to XXFREE, one would call FMPOOL with options 'UDT' to unlock (write-enable) the volume and to delete the TMS text tag.

                    Example of using the routine  FMPOOL
                                      

          CHARACTER*6   VSN,VID
          CHARACTER*255 GENAM
    *
    *     Create new bank ...
    *
          GENAM = '//CERN/DELPHI/DSTS/RUN123'
          CALL FMBOOK(GENAM,KEYS,LBANK,LSUP,JBIAS,IRC)
    *
    *     Allocate a 3480 from the pool XX_FREE in the library SMCF_1
    *
          CALL FMALLO('3480','38K',' ','SMCF_1','XX_FREE',LBANK,' ',
         +VSN,VID,IRC)
          IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMALLO'
    *
    * ... write the data ...
    *
    * ...
    *
    *     Now move the volume to XX_DSTS, write lock and set the TMS text
    *     tag to the generic name
    *
          CALL FMPOOL(GENAM,LBANK,KEYS,'XX_DSTS','LST',IRC)
    

    Obtain volume characteristics

     +----------------------------------------------------------------------+
     |CALL  FMQVOL (GENAM,LBANK,KEYS,LIB*,MODEL*,DENS*,MNTTYP*,LABTYP*,IRC*) |
     +----------------------------------------------------------------------+
                                      

    GENAM
    Character variable of maximum length 255 to specify the generic name.
    LBANK
    Integer variable to return the address of the bank corresponding to the generic name GENAM.
    KEYS
    Integer array of length 10 to return the keys vector associated with the specified generic name.
    LIB
    Character variable to return the name of the library in which the specified volume resides.
    MODEL
    Character variable to return the generic device type (e.g. CART, TAPE, SMCF) associated with VID, or the physical device type (e.g. 3480).
    MNTTYP
    Character variable to indicate whether VID will be robotically or manually mounted. MNTTYP returns 'R' or 'M' respectively.
    LABTYP
    Character variable to return the label type of the volume VID, e.g. SL, NL, BLP.
    IRC
    Integer variable in which the return code is returned.

    This routine interfaces to the local Tape Management System and returns information on a given volume. Interfaces currently exist to the HEPVM TMS and VMTAPE.

    If FATMEN has been installed without the TMS option, then default values will be returned. See the description of the FMEDIA routine for information on setting these default values. To allow this default information to be overridden on a volume by volume basis, FMQVOL calls a user exit FMUVOL which has exactly the same calling sequence. A dummy FMUVOL routine exists in PACKLIB.

                    Example of using the routine  FMQVOL
                                      

          CHARACTER*6  VID
    * Definitions from FATMEN sequence TMSDEF
          CHARACTER*6  DENS
          CHARACTER*8  LIB
          CHARACTER*4  LABTYP
          CHARACTER*1  MNTTYP
          CHARACTER*8  MODEL
          CHARACTER*7  ROBMAN(2)
          DATA         ROBMAN(1)/'-Robot '/,ROBMAN(2)/'-Manual'/
    *
    *     Obtain characteristics of volume corresponding to generic
    *     name   GENAM
    *
          CALL FMQVOL(GENAM,LBANK,KEYS,LIB,MODEL,DENS,MNTTYP,LABTYP,IRC)
          IF(IRC.EQ.100) PRINT *,'Volume unknown to TMS'
                IF(IC.EQ.0) THEN
                  ITYPE = 1
                  IF(MNTTYP.EQ.'M') ITYPE = 2
                  PRINT *,'Library = ',LIB,' model = ',MODEL//ROBMAN(ITYPE)
         +               ,' density = ',DENS,' label type = ',LABTYP
                  ENDIF
    

                  Example of a user coded  FMUVOL routine
                                      

          SUBROUTINE FMUVOL(GENAM,LBANK,KEYS,LIB,MODEL,DENS,MNTTYP,LABTYP,IRC)
          CHARACTER*255 GENAM
          PARAMETER     (LKEYFA=10)
          DIMENSION     KEYS(LKEYFA)
          CHARACTER*6 VID
    +CDE,FATTYP.
    +CDE,TMSDEF.
          CALL FMGETC(LBANK,VID,MVIDFA,6,IRC)
    *
    *     Return codes (HEPVM TMS convention)
    *                   0   ok
    *                   8   Syntax error
    *                   12  Access denied
    *                   100 Volume does not exist
    *                   312 Volume unavailable
    *
    *     The following test is CERN specific!!!
    *
          IF((VID(1:1).EQ.'I').AND.(ICNUM(VID,2,6).EQ.7)) THEN
             LIB = 'SMCF_1'
             MODEL = 'SMCF'
             MNTTYP= 'R'
          ENDIF
          END
    

    Obtain media information

            +--------------------------------------------------------+
            |CALL  FMQMED (GENAM,*LBANK*,*KEYS*,IMEDIA*,IROBOT*,IRC*) |
            +--------------------------------------------------------+
                                      

    GENAM
    Character variable of maximum length 255 to specify the generic name.
    LBANK
    Integer variable to return the address of the bank corresponding to the generic name GENAM. If LBANK is non-zero on input, the information in the bank at LBANK will be used.
    KEYS
    Integer array of length 10 to return the keys vector associated with the specified generic name. If LBANK is zero, KEYS may be used to select a specific copy of a file.
    IMEDIA
    Integer variable to return the media type of the file corresponding to the generic name GENAM.
    IROBOT
    Integer variable to indicate, for tape files only, whether the volume corresponding to the specified generic name is mounted robotically or not.
    0
    The volume is not mounted robotically
    1
    The volume is mounted robotically
    IRC
    Integer variable in which the return code is returned.

                    Example of using the routine  FMQMED
                                      

          PARAMETER (LURCOR=200000)
          COMMON/CRZT/IXSTOR,IXDIV,IFENCE(2),LEV,LEVIN,BLVECT(LURCOR)
          DIMENSION    LQ(999),IQ(999),Q(999)
          EQUIVALENCE (IQ(1),Q(1),LQ(9)),(LQ(1),LEV)
    *
          COMMON /USRLNK/LUSRK1,LUSRBK,LUSRLS
    *
          COMMON /QUEST/IQUEST(100)
    *
    * Start of FATMEN sequence FATPARA
    *
    ** ***     Data set bank mnemonics
    *
    *          Keys
          PARAMETER ( MKSRFA= 1, MKFNFA= 2, MKCLFA=7, MKMTFA=8
         1           ,MKLCFA= 9, MKNBFA=10, NKDSFA=10 )
    *
    ** ***     Bank offsets
    *
          PARAMETER ( MFQNFA=  1, MHSNFA= 65, MCPLFA= 67, MMTPFA= 68
         1           ,MLOCFA= 69, MHSTFA= 70, MHOSFA= 74
         2           ,MVSNFA= 77, MVIDFA= 79, MVIPFA= 81, MDENFA= 82
         3           ,MVSQFA= 83, MFSQFA= 84, MSRDFA= 85, MERDFA= 86
         4           ,MSBLFA= 87, MEBLFA= 88, MRFMFA= 89, MRLNFA= 90
         5           ,MBLNFA= 91, MFLFFA= 92, MFUTFA= 93, MCRTFA= 94
         6           ,MCTTFA= 95, MLATFA= 96, MCURFA= 97, MCIDFA= 99
         7           ,MCNIFA=101, MCJIFA=103, MFPRFA=105, MSYWFA=106
         8           ,MUSWFA=116, MUCMFA=126, NWDSFA=145
         9           ,MFSZFA=MSYWFA,MUSCFA=MSYWFA+1)
    * End of FATMEN sequence FATPARA
          CHARACTER*6  DENS
          CHARACTER*8  LIB
          CHARACTER*4  LABTYP
          CHARACTER*1  MNTTYP
          CHARACTER*8  MODEL
          CHARACTER*7  ROBMAN(2)
          DATA         ROBMAN(1)/'-Robot '/,ROBMAN(2)/'-Manual'/
          PARAMETER (LKEYFA=10)
          PARAMETER (MAXFIL=3000)
          DIMENSION KEYS(LKEYFA,MAXFIL)
          CHARACTER*255 FILES(MAXFIL)
          CHARACTER*8   THRONG
          CHARACTER*255 TOPDIR
          CHARACTER*26  CHOPT
          CHARACTER*8   DSN
    *
    *
    *     Initialise ZEBRA
    *
          CALL MZEBRA(-3)
          CALL MZSTOR(IXSTOR,'/CRZT/','Q',IFENCE,LEV,BLVECT(1),BLVECT(1),
         +            BLVECT(5000),BLVECT(LURCOR))
          CALL MZLOGL(IXSTOR,-3)
    *
    * *** Define user division and link area like:
    *
          CALL MZDIV  (IXSTOR, IXDIV, 'USERS', 50000, LURCOR, 'L')
          CALL MZLINK (IXSTOR, '/USRLNK/', LUSRK1, LUSRLS, LUSRK1)
    *
    *     Units for FATMEN RZ/FZ files
    *
          LUNRZ = 1
          LUNFZ = 2
    *
    *     Initialise FATMEN
    *
          CALL FMINIT(IXSTOR,LUNRZ,LUNFZ,'//CERN/delphi',IRC)
          CALL FMLOGL(1)
    *
    *     Get list of file names
    *
          JCONT = 0
    1     CONTINUE
          CALL FMLFIL('//CERN/DELPHI/P01_*/RAWD/NONE/Y90V00/E*/L*/*',
         +FILES,KEYS,NFOUND,MAXFIL,JCONT,IRC)
          IF(IRC.EQ.-1) THEN
            JCONT = 1
          ELSE
            JCONT = 0
          ENDIF
          PRINT *,NFOUND,' files found'
          DO 10 I=1,NFOUND
          LENF = LENOCC(FILES(I))
          PRINT *,'Processing ',FILES(I)(1:LENF)
          LBANK = 0
          CALL FMQMED(FILES(I)(1:LENF),LBANK,KEYS(1,I),IMEDIA,IROBOT,IRC)
    *
    *     Remove this entry if it corresponds to a tape in a (the) robot
    *
          IF(IROBOT.NE.1) GOTO 10
          CALL FMSHOW(FILES(I)(1:LENF),LBANK,KEYS(1,I),'MG',IRC)
          GOTO 10
    *
    *     Write enable the freed volume
    *
          CALL FMULOK(FILES(I)(1:LENF),LBANK,KEYS(1,I),' ',IRC)
          IF(IRC.NE.0) THEN
             PRINT *,'Return code ',IRC,' from FMULOK for ',
         +   FILES(I)(1:LENF)
             GOTO 10
          ENDIF
    *
    *     and return it to the pool XX_DSTS
    *
          CALL FMPOOL(FILES(I)(1:LENF),LBANK,KEYS(1,I),
         +            'XX_RAWD',' ',IRC)
          IF(IRC.NE.0) THEN
             PRINT *,'Return code ',IRC,' from FMPOOL for ',
         +   FILES(I)(1:LENF)
             GOTO 10
          ENDIF
          CALL FMRM(FILES(I)(1:LENF),LBANK,KEYS(1,I),IRC)
          IF(IRC.NE.0) THEN
             PRINT *,'Return code ',IRC,' from FMRM for ',
         +   FILES(I)(1:LENF)
             GOTO 10
          ENDIF
    10    CONTINUE
          IF(JCONT.NE.0) GOTO 1
    *
    *     Terminate cleanly
    *
          CALL FMEND(IRC)
          END
    

    Software write lock a volume

                 +----------------------------------------------+
                 |CALL  FMLOCK (GENAM,*LBANK*,*KEYS*,CHOPT,IRC*) |
                 +----------------------------------------------+
                                      

    GENAM
    Character variable of maximum length 255 to specify the generic name.
    LBANK
    Integer variable to return the address of the bank corresponding to the generic name GENAM. If LBANK is non-zero on input, the information in the bank at LBANK will be used.
    KEYS
    Integer array of length 10 to return the keys vector associated with the specified generic name. If LBANK is zero, KEYS may be used to select a specific copy of a file.
    CHOPT
    IRC

    This routine software write locks a volume by issuing a TMS LOCK DISABLE WRITE VID command.

    Software write enable a volume

                 +----------------------------------------------+
                 |CALL  FMULOK (GENAM,*LBANK*,*KEYS*,CHOPT,IRC*) |
                 +----------------------------------------------+
                                      

    GENAM
    Character variable of maximum length 255 to specify the generic name.
    LBANK
    Integer variable to return the address of the bank corresponding to the generic name GENAM. If LBANK is non-zero on input, the information in the bank at LBANK will be used.
    KEYS
    Integer array of length 10 to return the keys vector associated with the specified generic name. If LBANK is zero, KEYS may be used to select a specific copy of a file.
    CHOPT
    IRC

    This routine software write enables a volume by issuing a TMS LOCK ENABLE WRITE VID command.

    Issue SYSREQ command

              +----------------------------------------------------+
              | CALL  FMSREQ (SERVICE,COMMAND,IRC*,REPLY*,*REPLEN*) |
              +----------------------------------------------------+
                                      

    SERVICE
    Character variable giving the name of the service for which the command is intended. At CERN, the only valid service is TMS.
    COMMAND
    Character variable containing the command that is to be issued.
    IRC
    Integer variable in which the return code is returned. The return code maybe from SYSREQ itself, or from the service.
    0
    Success
    2
    Reply buffer too short. REPLY(REPLEN) contains the command that should be issued to receive the next batch of replies.
    REPLY
    Character array of length REPLEN in which the reply, if any, is returned.
    REPLEN
    Integer variable containing the length of the arrary REPLY. On output, it contains the number of elements that contain useful data (which may be zero).

    This routine issues a SYSREQ command. It differs from the routine SYSREQ described in the CSPACK [CSPACK] manual in that it performs retry in case of network problems.

    Set default media information

    +---------------------------------------------------------------------------+
    |CALL  FMEDIA (MFMMED,MFMTYP,MFMGEN,MFMSIZ,MFMDEN,MFMMNT,MFMLAB,NMEDIA,IRC*) |
    +---------------------------------------------------------------------------+
                                      

    MFMMED
    Integer array of length NMEDIA giving the FATMEN media type (integer code).
    MFMTYP
    Character array of length NMEDIA specifying the physical device type.
    MFMGEN
    Character array of length NMEDIA specifying the generic device type.
    MFMSIZ
    Character array of length NMEDIA specifying the capacity in Megabytes of this medium.
    MFMDEN
    Character array of length NMEDIA specifying the density of this medium.
    MFMMNT
    Character array of length NMEDIA specifying the default mount type (M=manual, R=robotic) of this medium.
    MFMLAB
    Character array of length NMEDIA specifying the default label type (SL=IBM labels, AL=ansi labels, NL=no labels)
    NMEDIA
    Integer variable specifying the length of the preceeding arrays.
    IRC
    Integer variable in which the return code is returned.

    This routine can be used to set the characteristics of the various types of medium. It is automatically called at FATMEN initialisation time by the routine FMINIT. New media may be added at runtime using the routine FMAMED.

                     Example using the  FMEDIA routine
                                      

    *KEEP,FATMED. Default media attributes
          PARAMETER     (NMEDIA=4)
    *
    *     FATMEN media type
    *
          DIMENSION     MFMMED(NMEDIA)
    *
    *     Generic device type
    *
          CHARACTER*8   MFMGEN(NMEDIA)
    *
    *     Physical device type
    *
          CHARACTER*8   MFMTYP(NMEDIA)
    *
    *     Default density
    *
          CHARACTER*8   MFMDEN(NMEDIA)
    *
    *     Media size in Megabytes
    *
          CHARACTER*8   MFMSIZ(NMEDIA)
    *
    *     Default mount type
    *
          CHARACTER*1   MFMMNT(NMEDIA)
    *
    *     Default label type
    *
          CHARACTER*2   MFMLAB(NMEDIA)
          DATA          MFMGEN(1)/'DISK'/,MFMGEN(2)/'3480'/,
         +              MFMGEN(3)/'3420'/,MFMGEN(4)/'8MM '/
          DATA          MFMTYP(1)/'DISK'/,MFMTYP(2)/'CT1 '/,
         +              MFMTYP(3)/'TAPE'/,MFMTYP(4)/'8200'/
          DATA          MFMDEN(2)/'38K '/,MFMDEN(3)/'6250'/,
         +              MFMDEN(4)/'43200'/
          DATA          MFMSIZ(1)/'0'/,   MFMSIZ(2)/'200'/,
         +              MFMSIZ(3)/'200'/, MFMSIZ(4)/'2300'/
          DATA          MFMMNT(1)/'M'/,   MFMMNT(2)/'M'/,
         +              MFMMNT(3)/'M'/,   MFMMNT(4)/'M'/
          DATA          MFMLAB(1)/'  '/,  MFMLAB(2)/'SL'/,
         +              MFMLAB(3)/'SL'/,  MFMLAB(4)/'SL'/
    *KEND
    *
    *     Set default media attributes
    *
          DO 55 I=1,NMEDIA
          MFMMED(I) = I
       55 CONTINUE
    *
    *     For each media type (1,2,3,...) set
    *         physical device type (disk, 3480, 3420,...)
    *         generic  device type (disk, ct1,  tape,...)
    *         capacity (MB)        (?, 200, 150,...)
    *         density              (?, 38K, 6250,...)
    *         mount type           (manual/robotic)
    *         label type           (SL/NL/AL)
    *
    +SELF,IF=APOL3,LEPICS.
    *
    *     Still using old generic device names...
    *
          MFMGEN(2) = 'CART'
    +SELF,IF=VMTAPE.
    *
    *     Generic names for VMTAPE...
    *
          MFMGEN(2) = '18TR'
          MFMGEN(3) = '9TR '
    +SELF.
          CALL FMEDIA(MFMMED,MFMTYP,MFMGEN,MFMSIZ,MFMDEN,
         +            MFMMNT,MFMLAB,NMEDIA,IRC)
    

    Add additional media definitions

    +---------------------------------------------------------------------------+
    |CALL  FMAMED (MFMMED,MFMTYP,MFMGEN,MFMSIZ,MFMDEN,MFMMNT,MFMLAB,NMEDIA,IRC*) |
    +---------------------------------------------------------------------------+
                                      

    MFMMED
    Integer array of length NMEDIA giving the FATMEN media type (integer code).
    MFMTYP
    Character array of length NMEDIA specifying the physical device type.
    MFMGEN
    Character array of length NMEDIA specifying the generic device type.
    MFMSIZ
    Character array of length NMEDIA specifying the capacity in Megabytes of this medium.
    MFMDEN
    Character array of length NMEDIA specifying the density of this medium.
    MFMMNT
    Character array of length NMEDIA specifying the default mount type (M=manual, R=robotic) of this medium.
    MFMLAB
    Character array of length NMEDIA specifying the default label type (SL=IBM labels, AL=ansi labels, NL=no labels)
    NMEDIA
    Integer variable specifying the length of the preceeding arrays.
    IRC
    Integer variable in which the return code is returned.

    This routine can be used to define additional media types.

    Get, Set or Delete TMS Tags

             +------------------------------------------------------+
             |CALL  FMTAGS (GENAM,*LBANK*,*KEYS*,*CHTAG*,CHOPT,IRC*) |
             +------------------------------------------------------+
                                      

    GENAM
    Character variable of maximum length 255 to specify the generic name.
    LBANK
    Integer variable to return the address of the bank corresponding to the generic name GENAM. If LBANK is non-zero on input, the information in the bank at LBANK will be used.
    KEYS
    Integer array of length 10 to return the keys vector associated with the specified generic name. If LBANK is zero, KEYS may be used to select a specific copy of a file.
    CHTAG
    Character variable of length 255 in which the tag associated with the specified generic name is returned (option G), or which contains the tag to be set (option S). This argument is ignored in the case of option D.
    CHOPT
    Character variable to specify the type of operation required.
    D
    delete the tag
    G
    get and display the tag
    S
    set the tag
    B
    to select the BINARY tag (stored as CHARACTER*255)
    T
    to select the TEXT tag (default)
    V
    to select the VOLINFO tag
    IRC
    Integer variable in which the return code is returned.

    This routine allows the TMS text or binary tag fields associated with a tape volume that corresponds to a specified generic name to be deleted, set or obtained.

                    Example of using the  FMTAGS routine
                                      

    *
    *     Set tag
    *
          GENAM = '//CERN/CNDIV/JAMIE/OUT'
          LG    = LENOCC(GENAM)
          CHTAGS = 'Archive tape for FATMEN source'
          CALL FMTAGS(GENAM(1:LG),LBANK,KEYS,CHTAGS,'S',IRC)
    *
    *     Get and print tag
    *
          CALL FMTAGS(GENAM(1:LG),LBANK,KEYS,CHTAGS,'G',IRC)
          PRINT *,IRC,CHTAGS(1:LENOCC(CHTAGS))
    *
    *     Delete binary tag
    *
          CALL FMTAGS(GENAM(1:LG),LBANK,KEYS,CHTAGS,'DB',IRC)