Obsolete routines

The following routines remain for backward compatibility only. New code should use the suggested replacement, which is normally both more powerful and more efficient.

Return file names in specified directory

          +----------------------------------------------------+
          | CALL  FMFNMS (PATH,FILES*,KEYS*,NKEYS*,MAXKEY,IRC*) |
          +----------------------------------------------------+
                                  
PATH
Character variable of maximum length 255 to specify the path name of interest.
FILES
Character array of length 20 characters and dimension MAXKEY to return the names of the files found.
KEYS
Integer matrix of size (10,MAXKEY) to return the keys vectors associated with the file names in FILES.
NKEYS
Integer variable to return the actual dimension of KEYS.
MAXKEY
Integer constant to specify the second dimension of KEYS.
IRC
Integer variable in which the return code is returned.

This routine returns the file names and keys vectors in the directory specified by PATH. NKEYS returns the actual number of files and keys returned. If more than MAXKEY files are found, IRC will be non-zero. Otherwise IRC will be 0. N.B. This routine returns ALL file names in the specified directory in the order in which they were added to the catalogue. See the routine on Page [more info] for details of how to sort the FILES arrary.

The suggested replacement for this routine is FMLFIL, which provides wild-card support.

                Example of using the  FMFNMS routine
                                  

      PARAMETER     (LKEYFA=10)
      PARAMETER     (MAXKEY=100)
      CHARACTER*20  FILES(MAXKEY)
      INTEGER       KEYS(LKEYFA,MAXKEY)
      CALL FMFNMS('//CERN/DELPHI'//
     +            '/ALLD/RAWD/CERN/V001/E091.00/P01R000314/NONE',
     +            FILES,KEYS,NKEYS,MAXKEY,IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMFNMS'

       Using the  FMLFIL routine as a replacement for  FMFNMS
                                  

      PARAMETER     (LKEYFA=10)
      PARAMETER     (MAXKEY=100)
      CHARACTER*255  FILES(MAXKEY)
      INTEGER        KEYS(LKEYFA,MAXKEY)
      ICONT = 0
*     On return, IRC = -1 if more than MAXKEY files found.
*     Call FMLFIL again with ICONT ^=0 to retrieve the next batch of MAXKEY files.
      CALL FMLFIL('//CERN/DELPHI'//
     +            '/ALLD/RAWD/CERN/V001/E091.00/P01R000314/NONE/*',
     +            FILES,KEYS,NKEYS,MAXKEY,ICONT,IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLFIL'

Return file names in directory structure

          +----------------------------------------------------+
          | CALL  FMLIST (PATH,FILES*,KEYS*,NFOUND,MAXFIL,IRC*) |
          +----------------------------------------------------+
                                  

PATH
Character variable of maximum length 255 to specify the path name of interest.
FILES
Character array of length 255 characters and dimension MAXFIL to return the names of the files found.
KEYS
Integer matrix of size (10,MAXFIL) to return the keys vectors associated with the file names in FILES.
NFOUND
Integer variable to return the actual dimension of FILES and then actual second dimension of KEYS.
MAXFIL
Integer constant to specify the second dimension of KEYS.
IRC
Integer variable in which the return code is returned.

The suggested replacement for this routine is FMLFIL, which allows an arbitrary number of file names to be returned.

This routine returns the file names and keys vectors in the directory tree specified by PATH. The directory tree may contain wild-cards (* or %) in any position, or numeric ranges specified as (mm:nn), such as (13:147). See on Page [more info] for more details. NFOUND returns the actual number of files and keys returned. If more than MAXFIL files are found, IRC will be non-zero. Otherwise IRC will be 0. N.B. This routine returns ALL file names in in the order in which they were added to the catalogue. See the routine on Page [more info] for details of how to sort the FILES array.

                Example of using the  FMLIST routine
                                  

      PARAMETER     (LKEYFA=10)
      PARAMETER     (MAXFIL=1000)
      CHARACTER*255 FILES(MAXFIL)
      INTEGER       KEYS(LKEYFA,MAXFIL)
      CALL FMLIST('//CERN/DELPHI'//
     +            '/ALLD/RAWD/*/E091.*/P01R000%%%/NONE',
     +            FILES,KEYS,NFOUND,MAXFIL,IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLIST'

       Using the  FMLFIL routine as a replacement for  FMLIST
                                  

      PARAMETER     (LKEYFA=10)
      PARAMETER     (MAXKEY=100)
      CHARACTER*255  FILES(MAXKEY)
      INTEGER        KEYS(LKEYFA,MAXKEY)
      ICONT = 0
*
*     On return, IRC = -1 if more than MAXKEY files found.
*     Call FMLFIL again with ICONT ^=0 to retrieve the next
*     batch of MAXKEY files.
*
      CALL FMLFIL('//CERN/DELPHI'//
     +            '/ALLD/RAWD/CERN/V001/E091.00/P01R000314/NONE/*',
     +            FILES,KEYS,NKEYS,MAXKEY,ICONT,IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLFIL'

Obtain names of subdirectories in specified tree

         +------------------------------------------------------+
         |CALL  FMTREE (PATH,SUBDIR*,NLEVEL,NFOUND*,MAXDIR,IRC*) |
         +------------------------------------------------------+
                                  

PATH
Character variable of maximum length 255 to specify the path to be searched.
SUBDIR
Character array of maximum length 255 and dimension MAXDIR to return the directory names found.
NLEVEL
Integer variable to set the number of levels below PATH to be searched.
NFOUND
Integer variable to return the number of names returned in the array SUBDIR.
MAXDIR
Integer constant to specify the maximum second dimension of the array SUBDIR.
IRC
Integer variable in which the return code is returned.

The suggested replacement for this routine is FMLDIR, which provides wild-card support and allows an arbitrary number of file names to be returned.

This routine returns in the character array SUBDIR the names of all directories below and including the input directory specified in PATH down to the level NLEVEL. MAXDIR specifies the maximum dimension of the array SUBDIR. NFOUND returns the number of directories found. Should NFOUND be less than or equal to MAXDIR, SUBDIR(NFOUND) will be the name of the current directory. If NFOUND > MAXDIR, IRC will be non-zero. PATH and SUBDIR are of type CHARACTER and may be as long as 255 characters.

                Example of using the  FMTREE routine
                                  

*
*     Argument declarations
      PARAMETER     (MAXDIR=1000)
      CHARACTER*255 PATH,SUBDIR(MAXDIR)
*     Get list of subdirectories down to a level of 10
      CALL FMTREE('//CERN',SUBDIR,10,NFOUND,MAXDIR,IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMTREE'

             Using  FMLDIR as a replacement for  FMTREE
                                  

*
      PARAMETER     (MAXDIR=100)
      CHARACTER*255  CHDIRS(MAXDIR)
      ICONT = 0
*
*     On return, IRC = -1 if more than MAXDIR directories found.
*     Call FMLDIR again with ICONT ^=0 to retrieve the next
*     batch of MAXDIR directories
*
      CALL FMLDIR('//CERN/DELPHI'//
     +            '/ALLD/RAWD/CERN/V001/E091.00/P01R000314/NONE/*',
     +            CHDIRS,NDIRS,MAXKEY,ICONT,IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLDIR'

User routine to allocate new piece of media

                  +------------------------------------+
                  | CALL  FUALLO (MEDIA,VSN*,VID*,IRC*) |
                  +------------------------------------+
                                  

MEDIA
Character variable of length 4 to specify the medium 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.

The suggested replacement for this routine is FMUALL, which is automatically called from FMALLO if FATMEN has been installed without the TMS option.

This routine returns a free VSN and VID of type MEDIA.

                Example of using the routine  FUALLO
                                  

*     Argument declarations
      CHARACTER*6 VSN,VID
      CHARACTER*4 MEDIA
      MEDIA = '3480'
      CALL FUALLO(MEDIA,VSN,VID,IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FUALLO

Create a new FATMEN bank

              +--------------------------------------------+
              | CALL  FMLIFT (GENAM,KEYS*,MEDIA,CHOPT,IRC*) |
              +--------------------------------------------+
                                  

GENAM
Character variable of maximum length 255 to specify the generic name.
KEYS
Integer array of length 10 to return the keys vector associated with the specified generic name.
MEDIA
Character variable of length 4 to specify the medium required.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

The suggested replacement for this routine and FMLINK is FMBOOK.

This routine will create a new ZEBRA bank for the specified generic name GENAM and fill in default values. The user may then modify these before committing the changes via FMPUT. If IRC is non-zero, the IQUEST vector will contain the error condition signaled by MZBOOK. See the description of MZBOOK in the ZEBRA manual. After calling the FMLIFT routine, the user must obtain the address of the associated bank using FMLINK and then fill in the appropriate media details using FMALLO or FUALLO. See on Page [more info], on Page [more info] and on Page [more info] for further details.

                Example of using the  FMLIFT routine
                                  
      CALL FMLIFT('//CERN/CNDIV/GOOSSENS/DCF/M123',KEYS,'DISK',' ',IRC)
 
FMLIFT returns warning conditions using the IQUEST vector. The following conditions may be reported:
IQUEST(11)
0 if this generic name does not exist, 1 otherwise.
IQUEST(12)
0 if the corresponding directories already exist, 1 otherwise.

Get the address of a FATMEN bank

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

GENAM
Character variable of maximum length 255 to specify the generic name.
LBANK
Integer variable to input the address of the bank corresponding to the generic name specified.
CHOPT
Character variable to specify the options desired.
IRC
Integer variable in which the return code is returned.

This routine will return the address LBANK of the ZEBRA bank corresponding to the specified generic name GENAM. It should be called after FMLIFT if the user wishes to modify the information contained in the bank before committing the changes via FMPUT, or at the end of run when more details, such as file size, first and last event number, are known. If no bank exists for the specified generic name GENAM, warning messages will be printed and a bank address of zero returned. These messages may be suppressed by specifying the character option 'Q' (quiet), or globally by using FMLOGL described below. If no bank corresponding to the specified generic name GENAM is found, IRC will be non-zero.

                Example of using the  FMLINK routine
                                  

*     Obtain address of bank previously lifted by FMLIFT
      CALL FMLINK('CERN/GOOSSENS/DCF/M123',LBANK,'Q',IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMLINK

Obtain volume characteristics

       +----------------------------------------------------------+
       | CALL  FMQTMS (VID,LIB*,MODEL*,DENS*,MNTTYP*,LABTYP*,IRC*) |
       +----------------------------------------------------------+
                                  

VID
Character variable of length 6 specifying the visual identifier of the volume on which information is required.
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, FMQTMS calls a user exit FMUTMS which has exactly the same calling sequence. A dummy FMUTMS routine exists in PACKLIB.

                Example of using the routine  FMQTMS
                                  

* 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 I28901
*
      CALL FMQTMS('I28901',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  FMUTMS routine
                                  

      SUBROUTINE FMUTMS(VID,LIB,MODEL,DENS,MNTTYP,LABTYP,IRC)
      CHARACTER*(*) VID
+CDE,FATTYP.
+CDE,TMSDEF.
*
*     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