Routines that provide access to the data

Find existing dataset and associate with logical unit

                +----------------------------------------+
                |CALL  FMFIND (GENAM,DDNAME,*LBANK*,IRC*) |
                +----------------------------------------+
                                  

GENAM
Character variable of maximum length 255 to specify the generic name.
DDNAME
Character variable of maximum length 8 to specify the FORTRAN logical unit.
LBANK
Integer variable to return the address of the bank corresponding to the generic name GENAM.
IRC
Integer variable in which the return code is returned.
This routine returns the bank address LBANK of the most suitable copy of the data referenced by the specified generic name GENAM. N.B. if LBANK is non-zero, the bank at this address will be used. This allows the user to make their own selection, e.g. by first calling FMGET, FMGETK or FMSELM, or to override some parameters in the Zebra bank for the specified generic name. If you do not wish to use this facility, you must drop the bank at LBANK using MZDROP.

When the calling program receives control, it may open the file on the logical unit corresponding to the DDNAME specified and read the data. Should the required data reside on tape, the FATMEN system will check access to the tape using the Tape Management System and STAGE the data on to disk.

The ddname, of type CHARACTER, may be specified as 'nn', e.g. 1 or 99, or as any valid logical unit such as FT93F005, IOFILE11, FOR003, fort.20 etc. If a one or two digit character is specified, it will be converted to the format used by FORTRAN on the host machine. (For files in EP or FX format on VM/CMS systems, the format IOFILEnn will be used). If the input bank-address is non-zero, the information in the bank to which it points will be used to accessed the data. If the bank-address is zero, FMLIFT will automatically call FMGET.

On VM/CMS systems only, a DDNAME of NOWAIT will result in a STAGE request with the NOWAIT option. This may be used to initialise the input staging of the tape i+1 while tape i is being processed. See the tutorial section of this manual for an example of using the NOWAIT option.

                  Example of using routine  FMFIND
                                  

*     Find a dataset using the default FATMEN selection
      CALL FMFIND('//CERN/CNDIV/CHRIS/TAPE8','IOFILE13',LFAT,IRC)
      IF(IRC.NE.0) PRINT *,'Return code',IRC,' from FMFIND.'

Create new dataset

                +----------------------------------------+
                |CALL  FMMAKE (GENAM,DDNAME,*LBANK*,IRC*) |
                +----------------------------------------+
                                  

GENAM
Character variable of maximum length 255 to specify the generic name.
DDNAME
Character variable of maximum length 8 to specify the FORTRAN logical unit.
LBANK
Integer variable to return the address of the bank corresponding to the generic name GENAM.
IRC
Integer variable

This subroutine creates a new disk or tape dataset, according to the contents of the bank passed at LBANK Before calling FMMAKE, the user should call FMBOOK (see on Page [more info]) and then set the various fields as required.

See the description of the FMFIND routine for information on the DDNAME parameter. N.B. if LBANK is non-zero, the bank at this address will be used. This allows the user to make their own selection, e.g. by first calling FMGET, FMGETK or FMSELM, or to override some parameters in the Zebra bank for the specified generic name. If you do not wish to use this facility, you must drop the bank at LBANK using MZDROP.

                Example of using the routine  FMMAKE
                                  

*     Create dataset on IOFILE11.
*     The bank at address LBANK was created by FMLIFT
      CALL FMMAKE('//CERN/ALEPH/MDST/KELLNER/RUN123','IOFILE11',LBANK,IRC)

Open a dataset for read or write

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

GENAM
Character variable of maximum length 255 to specify the generic name.
DDNAME
Character variable to specify the FORTRAN logical unit to be opened.
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 accesses a dataset via its generic name GENAM and opens it on the logical unit specified by the character DDNAME. The following values are allowed for CHOPT.

D
Make a duplicate into the SMCF robot (CERN only)
E
When used with option T, add END option to SETUP command
F
Issue call to FZFILE If option F is specified, IQUEST(10) may be set to indicate which form of I/O should be used. The default is FORTRAN I/O.
IQUEST(10) = 1 : C I/O
                 Corresponds to option L in FZFILE
IQUEST(10) = 2 : VM only : VMIO
                 (via  FZHOOK to FATMEN routine)
IQUEST(10) = 3 : Package I/O, i.e. IOPACK on VM or MVS systems
                 Corresponds to option Y in  FZFILE
H
Stage wHole tape. This option is ignored unless running on a VAX/VMS system using the VAXTAP [bib-VAXTAP] package.
K
KEEP option on STAGE OUT
L
Override DCB (record format, record length, block length) in tape label with information in FATMEN bank/catalogue. (Default on output and for VM disk files, should only be used on input if tape labels are bad).
N
Do not specify DSN or FILEID on STAGE or LABELDEF command
O
Override SIZE information with value specified in IQUEST(11)
P
AutoPut option in STAGE OUT
Q
Queue stage request (e.g. NOWAIT option for VMSTAGE). This option queues the staging request and then returns without waiting for the staging operation to complete.
R
Read access
S
Update FATMEN catalogue with file size, as obtained from staging system if filesize field is zero and return code from staging system is zero.
T
Read/write directly to tape (i.e. do not use STAGE).
U
OPEN will be performed by User
V
As S, but even if file size is non-zero. If the file size in the catalogue and that returned by VMSTAGE disagree, a warning message will be issued, but the information obtained from VMSTAGE will nevertheless be used to update the catalogue.
W
Write access
X
Direct access file
Y
Do not issue STAGE command, but write to file on unit DDNAME
Z
Issue RZOPEN and RZFILE

N.B. if LBANK is non-zero, the bank at this address will be used. This allows the user to make their own selection, e.g. by first calling FMGET, FMGETK or FMSELM, or to override some parameters in the Zebra bank for the specified generic name. If you do not wish to use this facility, you must drop the bank at LBANK using MZDROP.

                Example of using the  FMOPEN routine
                                  

      CALL FMOPEN('//CERN/CHARM2/TEST/DST1/ELEC/HO20/NOM/E02/FILE3',
     +            '3',LBANK,'R',IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMOPEN

Option D, when used with option R, will call the routine FMSMCF to automatically copy the data into the robot. Note that this facility is currently CERNVM specific, and requires that

  1. The dataset resides on tape and is successfully STAGEd in by FMOPEN (i.e. option T not allowed).
  2. No dataset with the specified generic name currently exists in the robot.
  3. A pool of tapes ggFAT1 exists (i.e. WS-FAT1).

Option Y is valid for stage operations only. Instead of issuing the stage command, it will be written to the file specified by the DDNAME parameter. No further action will be taken.

Close file opened via FATMEN

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

GENAM
Character variable of maximum length 255 to specify the generic name.
DDNAME
Character variable to specify the name of the logical unit to be closed. The DDNAME is specified as for the routines FMOPEN, FMFIND and FMMAKE.
LBANK
Integer variable to specify the address of the bank to be written to the FATMEN catalogue.
CHOPT
Character variable to specify the required options.
IRC
Integer variable in which the return code is returned.

This routine closes a file IUNIT previously opened via FMOPEN. If LBANK is non-zero, the information concerning the specified generic name GENAM is written back to the database. This would typically be used by a production job, which would update the bank information with the number of records and total amount of data written, before updating the file catalogue. The following values are allowed for CHOPT.

C
The data, if STAGEd, is cleared.
D
DROP the Staging or maxi-disk (VM), Dismount the tape volume (option T on FMOPEN) or Deassign the logical name created by FMOPEN (VMS).
E
Call the appropriate Zebra termination routine for this file. If the file was opened via a call to FMOPEN, FMCLOS will automatically call RZEND as appropriate.
F
Update the bank at LBANK with the file size as obtained from FZINFO.
N
Do not issue close (FORTRAN, VMIO or other) for output file
P
For output staging only: request that the writing of the data to tape begins (STAGE PUT).
U
Update FATMEN catalogue with bank at LBANK
Z
Drop bank at LBANK with MZDROP

               Example of using the routine  FMCLOS 
                                  

*
      CALL FMCLOS('//CERN/CNDIV/CHRIS/TAPE8','FT11F002',LBANK,IRC)
      IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from FMCLOS'

Copy a dataset and update the FATMEN catalogue

  +--------------------------------------------------------------------+
  | CALL  FMCOPY (GN1,*LBANK1*,*KEYS1*,GN2,*LBANK2*,*KEYS2*,CHOPT,IRC*) |
  +--------------------------------------------------------------------+
                                  
GNn
Character variable of maximum length 255 to specify the generic names of the files to be copied.
LBANKn
Integer variable(s) to return the addresses of the banks corresponding to GN1 and GN2.
KEYSn
Integer array of length 10 to return the keys vectors associated with the specified generic names.
CHOPT
Character variable specifying the required options.
IRC
Integer variable in which the return code is returned.

This routine copies the dataset pointed to by the generic name GN1 to the location pointed to by GN2. (Typically GN1 will be the same as GN2). If either LBANK1 or LBANK2 is non-zero, the bank(s) at the corresponding address will be used. If either LBANK1 or LBANK2 are zero, the routine FMGETK will be used to obtain the corresponding bank. Should KEYS1(1) or KEYS2(1) be zero, the default FATMEN selection will apply. If CHOPT='S', the input file will first be STAGEd and then the STAGE CHANGE command used to write the output tape (assuming that input and output media are tape). In all other cases, the copy will be performed using the VMIO package.

The following options may be specified:

A
Input data is already STAGEd.
C
Use STAGE CHANGE / stagewrt/ WRTAPE to write the output file.
F
Copy file using FZIN/FZOUT (permits change of FZ formats)
K
Queue copy for transfer by CHEOPS using FMCOPQ
R
Skip Zebra start of run / end of run records (with F)
S
Stage the input file
Z
Stage the output file

               Example of using the  FMCOPY routine 
                                  

*     In this example, both datasets are already catalogued
*     IN points to the FATMEN source (FATMEN CARDS)
*     OUT points to a robot tape. FMCOPY copies IN to OUT
*     converting RECFM F to RECFM FB (due to catalogue entries)
      CALL FMCOPY('//CERN/CNDIV/JAMIE/IN' ,LBANK1,KEYS1,
     +            '//CERN/CNDIV/JAMIE/OUT',LBANK2,KEYS2,'S',IRC)

N.B.The FMCOPY routine allocates FORTRAN logical units to perform the copy using the routine FMGLUN (see on Page ). These are freed immediately after use by FMFLUN. For FMCOPY to work, first allocate some units for use by FATMEN using the routine FMSETU (see on Page [more info]).

On VM systems, FATMEN uses the VMIO logical units corresponding to the two units declared in FMSTRT (see on Page ) or FMINIT (see on Page ). For example, if FMINIT is called with logical units 1 and 2, FMCOPY will use VM01F001 and VM02F001.

When the copy is performed by STAGE CHANGE (stagewrt on Cray, WRTAPE on VAX), no additional logical units are required.

Queue a copy request

  +--------------------------------------------------------------------+
  | CALL  FMCOPQ (GN1,*LBANK1*,*KEYS1*,GN2,*LBANK2*,*KEYS2*,CHOPT,IRC*) |
  +--------------------------------------------------------------------+
                                  
GNn
Character variable of maximum length 255 to specify the generic names of the files to be copied.
LBANKn
Integer variable(s) to return the addresses of the banks corresponding to GN1 and GN2.
KEYSn
Integer array of length 10 to return the keys vectors associated with the specified generic names.
CHOPT
Character variable specifying the required options.
IRC
Integer variable in which the return code is returned.

This routine is called by FMCOPY when option K is specified. Rather than perform the copy directly, it is queued for transfer by CHEOPS. This is performed by writing a request file in a special queue directory. FMCOPQ may only be used at sites that are CHEOPS partners.

Copy a dataset over the network and update the FATMEN catalogue

  +--------------------------------------------------------------------+
  | CALL  FMRCOP (GN1,*LBANK1*,*KEYS1*,GN2,*LBANK2*,*KEYS2*,CHOPT,IRC*) |
  +--------------------------------------------------------------------+
                                  

GNn
Character variable of maximum length 255 to specify the generic names of the files to be copied.
LBANKn
Integer variable(s) to return the addresses of the banks corresponding to GN1 and GN2.
KEYSn
Integer array of length 10 to return the keys vectors associated with the specified generic names.
CHOPT
Character variable specifying the required options.
IRC
Integer variable in which the return code is returned.

This routine is called by FMCOPY when it determines that a network copy is required.