Next: CSPACK - Installation
Up: CSPACK
Previous: CSPACK - Tutorial
ZFTP is a file transfer program tuned to the needs of the HEP environment.
Using the standard FTP program, files often reach the remote system
in an unreadable format. This is due to differences such as file format
(presence or absence of FORTRAN control words etc.) or, more importantly,
differences used in the internal representation of data between machines.
When files are transferred between systems using ZFTP, these problems
are solved. Not only is data conversion performed automatically on the fly,
but the file format is such that no further manipulation is required before
processing with standard programs. Thus, an ntuple file produced on the
Cray may be transferred to an Apollo workstation with a single command.
In addition, considerable advantages arise from the standard interface
on all systems and the power of KUIP which provides macros and many other
facilities. All of the functionality is also available through FORTRAN
routines which are available as part of PACKLIB. This is used to advantage
in the FATMEN package, to provide convenient remote file transfer.
The ZFTP program is started by typing the command zftp.
As with the standard ftp program, if the nodename is given
on the command-line, a connection will be established to that
node, e.g. zftp vxcrnb
Otherwise, use the OPEN command to establish a connection to a remote
machine.
Valid options are described in the description of the OPEN command.
RFRFFZFILE RZFILE [LRECL] [CHOPT]
- FZFILE
- File name of the input FZ file
- RZFILE
- File name for the output RZ file
- LRECL
- Record length for the output RZ file in bytes. If zero is
specified, the record length of the original RZ file will be used.
- CHOPT
- List of options
- A
- the input file is in FZ alpha format
- S
- display statistics on the RZ file
- X
- the RZ file will be created in eXchange mode
- C
- respect case of file names
This command converts an FZ exchange format file to an
RZ file on the LOCAL machine. No network transfer is
performed. The FZFILE must be the output of a previous
RTOF command, or have been created using the RTOX or RTOA
programs. On Unix systems, this file will be read with
FORTRAN direct-access and will hence be transferable and
readable on other systems.
By default, the output RZ file will have the same record
length as the original RZ file. However, if LRECL is
specified then this value will be used instead.
RTOFRZFILE FZFILE [LRECL] [CHOPT]
- RZFILE
- File name of the input RZ file
- FZFILE
- File name for the output FZ file
- LRECL
- Record length for the output FZ file in bytes. If zero is
specified, a record length of 3600 bytes will be used for binary files,
or 80 bytes for ASCII files.
- CHOPT
- List of options
- A
- the output file is to be in FZ alpha format
- S
- display statistics on the RZ file
- C
- respect case of file names
This command converts an RZ file into an FZ exchange mode
format file on the LOCAL machine. No network transfer is
performed. By default a binary exchange mode FZ file is
created. On Unix systems, this file will be written with
FORTRAN direct-access and will hence be transferable and
readable on other systems.
FZCOPYFZIN FZOUT [IFORM] [IRECL] [OFORM] [ORECL] [CHOPT]
- FZIN
- input FZ file name
- FZOUT
- output FZ file name
- IFORM
- Format of input FZ file
- IRECL
- Input record length (in bytes)
- OFORM
- Format of output FZ file
- ORECL
- Output record length (in bytes)
- CHOPT
- List of options
- A
- lpha exchange mode format - RECL not needed
- N
- native data but exchange file format - RECL not needed
- X
- exchange format file - RECL not needed
- Z
- native data and file format - RECL must be specified
This command copies an FZ file on the local machine. At
the same time, file format and data format conversion is
possible. Thus, FZCOPY can be used to convert a binary
native format file into a alpha exchange format file etc.
RZCOPYRZIN RZOUT [ORECL] [CHOPT]
- RZIN
- input RZ file name
- RZOUT
- output RZ file name
- ORECL
- Output record length (in bytes). If not specified, the record
length of the input file will be used.
- CHOPT
- List of options
- N
- convert exchange RZ file into native RZ file
- X
- convert native RZ file into exchange RZ file
This command copies an RZ file on the local machine. At
the same time, the record length or data format may be
changed. Thus, RZCOPY can be used to convert a native
format RZ file with record length 512 into an exchange
format file with record length 8192.
If not specified, the output record length will be set equal
to that of the input file.
CTOFCFILE FFILE [LRECL] [CHOPT]
- CFILE
- input file name
- FFILE
- output file name
- LRECL
- record length (in bytes)
- CHOPT
- List of options
- X
- Zebra exchange format file - RECL not needed
-
- other files - RECL must be specified
This command copies a file written with C or FORTRAN
direct-access I/O to one written with FORTRAN sequential I/O.
FTOCFFILE CFILE [LRECL] [CHOPT]
- FFILE
- input file name
- CFILE
- output file name
- LRECL
- record length (in bytes)
- CHOPT
- List of options
- X
- Zebra exchange format file - RECL not needed
-
- other files - RECL must be specified
This command copies a file written with FORTRAN sequential
I/O to one written with FORTRAN direct-access I/O. The
output file may be read with C I/O or FORTRAN direct access.
GETAREMOTE LOCAL [CHOPT]
- REMOTE
- Remote file name
- LOCAL
- Local file name
- CHOPT
- List of options
- S
- Print statistics on the file transfer
- V
- Create the remote file with variable length record format
Transfer a text file from the remote machine to a local file.
If the local file name is not given, or a = sign specified,
the local file will have the same name as on the remote system.
PUTALOCAL REMOTE [CHOPT]
- LOCAL
- Local file name
- REMOTE
- Remote file name
- CHOPT
- List of options
- S
- Print statistics on the file transfer
- V
- Create the remote file with variable length record format
Transfer a text file from the local machine to the remote system.
If the remote file name is not given, or a = sign specified,
the remote file will have the same name as on the local system.
GETBREMOTE LOCAL [LRECL] [CHOPT]
- REMOTE
- Remote file name
- LOCAL
- Local file name
- LRECL
- Record length in bytes
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a binary file from the remote machine to a local file.
If the local file name is not given, or a = sign specified,
the local file will have the same name as on the remote system.
The file must contain fixed length blocks (EPIO or FZ exchange format).
PUTBLOCAL REMOTE [LRECL] [CHOPT]
- LOCAL
- Local file name
- REMOTE
- Remote file name
- LRECL
- Record length in bytes
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a binary file from the local machine to the remote system.
If the remote file name is not given, or a = sign specified,
the remote file will have the same name as on the local system.
The file must contain fixed length blocks (EPIO
or FZ exchange format).
GETDREMOTE LOCAL LRECL [CHOPT]
- REMOTE
- Remote file name
- LOCAL
- Local file name
- LRECL
- Record length in bytes
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a binary direct access
file from the remote machine to a local file.
If the local file name is not given, or a = sign specified,
the local file will have the same name as on the remote system.
The file must contain
fixed length blocks (EPIO or FZ exchange format).
PUTDLOCAL REMOTE LRECL [CHOPT]
- LOCAL
- Local file name
- REMOTE
- Remote file name
- LRECL
- Record length in bytes
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a binary direct access
file from the local machine to the remote system.
If the remote file name is not given, or a = sign specified,
the remote file will have the same name as on the local system.
The file must contain fixed length blocks (EPIO
or FZ exchange format).
GETPREMOTE LOCAL [CHOPT]
- REMOTE
- Remote file name
- LOCAL
- Local file name
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a compact binary PAM
file from the remote machine to a local file.
If the local file name is not given, or a = sign specified,
the local file will have the same name as on the remote system.
PUTPLOCAL REMOTE [CHOPT]
- LOCAL
- Local file name
- REMOTE
- Remote file name
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a compact binary PAM
file from the local machine to the remote system.
If the remote file name is not given, or a = sign specified,
the remote file will have the same name as on the local system.
GETFZREMOTE LOCAL RRECL RFORM LRECL LFORM [CHOPT]
- REMOTE
- Remote file name
- LOCAL
- Local file name
- RRECL
- Record length of the remote file in bytes
- RFORM
- Format of the remote file
-
- Native file format - record length required
- A
- Alpha exchange format - record length forced to be 80 bytes
- D
- Direct access I/O - ignored if option X is not also specified
- Z
- Native file format - record length required
- X
- Binary exchange format - record length will be obtained from
the file itself if not specified.
- LRECL
- Record length of the local file in bytes
- LFORM
-
-
- Native file format - record length required
- A
- Alpha exchange format - record length forced to be 80 bytes
- D
- Direct access I/O - ignored if option X is not also specified
- Z
- Native file format
- X
- Binary exchange format
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a ZEBRA FZ
file from the remote machine to the local system.
If the local file name is not given, or a = sign specified,
the local file will have the same name as on the remote system.
The FZ file is created on the local computer with the same
parameters as on the remote machine.
If the format of the local and remote files are not specified,
this command file copies a remote native format file to a local
native format file.
PUTFZLOCAL REMOTE LFORM LRECL RFORM RRECL [CHOPT]
- LOCAL
- Local file name
- REMOTE
- Remote file name
- LRECL
- Record length of the local file in bytes
- LFORM
-
-
- Native file format - record length required
- A
- Alpha exchange format - record length forced to be 80 bytes
- D
- Direct access I/O - ignored if option X is not also specified
- Z
- Native file format - record length required
- X
- Binary exchange format - record length will be obtained from
the file itself if not specified.
- RRECL
- Record length of the remote file in bytes
- RFORM
- Format of the remote file
-
- Native file format - record length required
- A
- Alpha exchange format - record length forced to be 80 bytes
- D
- Direct access I/O - ignored if option X is not also specified
- Z
- Native file format
- X
- Binary exchange format
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a ZEBRA FZ
file to the remote machine from the local system.
If the remote file name is not given, or a = sign specified,
the remote file will have the same name as on the local system.
The FZ file is created on the remote computer with the same
parameters as on the local machine.
If the format of the local and remote files are not specified,
this command file copy a local native format file to a remote
native format file.
GETRZREMOTE LOCAL [CHOPT]
- LOCAL
- Local file name
- REMOTE
- Remote file name
- CHOPT
- List of options
- R
- the local file will have RELATIVE organisation (VAX)
- L
- a list of the top level directories in the received file
is displayed.
- T
- the entire directory tree is displayed.
- S
- Print statistics on the file transfer
PUTRZLOCAL REMOTE [CHOPT]
- REMOTE
- Remote file name
- LOCAL
- Local file name
- CHOPT
- List of options
- R
- the remote file will have RELATIVE organisation (VAX)
- L
- a list of the top level directories in the received file
is displayed.
- T
- the entire directory tree is displayed.
- S
- Print statistics on the file transfer
Transfer a local RZ file to the remote machine.
If the local file name is not given, or a = sign specified,
the local file will have the same name as on the remote system.
The RZ file is created on the remote computer with the same
parameters as on the local machine.
GETXREMOTE LOCAL LRECL [CHOPT]
- REMOTE
- Remote file name
- LOCAL
- Local file name
- LRECL
- Record length in bytes
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a binary direct access
file from the remote machine to a local file.
If the local file name is not given, or a = sign specified,
the local file will have the same name as on the remote system.
The file must contain
fixed length blocks (EPIO or FZ exchange format).
The GETX command uses Fortran
sequential I/O on all systems except Unix, where files are
processed with direct access I/O to avoid the control
words that are written at the beginning and end of each
record with binary sequential Fortran I/O.
PUTXLOCAL REMOTE LRECL [CHOPT]
- LOCAL
- Local file name
- REMOTE
- Remote file name
- LRECL
- Record length in bytes
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer a binary direct access
file from the local machine to the remote system.
If the remote file name is not given, or a = sign specified,
the remote file will have the same name as on the local system.
The file must contain fixed length blocks (EPIO
or FZ exchange format).
The PUTX command uses Fortran
sequential I/O on all systems except Unix, where files are
processed with direct access I/O to avoid the control
words that are written at the beginning and end of each
record with binary sequential Fortran I/O.
MGETREMOTE LOCAL [CHOPT]
- REMOTE
- Remote file name
- LOCAL
- Local file name
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer all files matching the specified remote file name
to the local system. The file name given may contain
*, to match one or more characters, or character.
By default the transfer is performed
using GETA, unless the file name has a known extension.
e.g.
*.PAM --> GETP
*.CETA, *.CET --> GETB, LRECL=3600
*.CMZ, *.RZ --> GETRZ
MPUTLOCAL REMOTE [CHOPT]
- LOCAL
- Local file name
- REMOTE
- Remote file name
- CHOPT
- List of options
- S
- Print statistics on the file transfer
Transfer all files matching the specified local file name
to the remote system. The file name given may contain
*, to match one or more characters, or character.
By default the transfer is performed
using PUTA, unless the file name has a known extension.
e.g.
*.PAM --> GETP
*.CETA, *.CET --> GETB, LRECL=3600
*.CMZ, *.RZ --> GETRZ
RSHELLCOMMAND
- COMMAND
- Command to be executed on the remote machine
the specified command is transmitted for execution to the
remote machine.
OPENMACHINE [CHOPT]
- MACHINE
- Name of remote machine
- CHOPT
- List of options
-
- Use TCP/IP to connect to remote systems.
- D
- Use DECnet to connect to remote systems. Only valid between
VAX/VMS systems
- V
- The remote system is running VM/CMS. This option is required
unless the remote node is known to the CSPACK software
- M
- The remote system is running MVS. This option is required
unless the remote node is known to the CSPACK software
Opens a communication with the remote machine named MACHINE.
MACHINE may be an alphanumeric host name or a TCP/IP address
(e.g. CERNVM, 128.141.1.181)
This command will prompt you for user authentification.
Normally, a server is started by software known as the Internet
Daemon, or inetd. This is not available with certain versions
of TCP/IP, notably DEC/UCX, IBM VM/CMS and MVS. On VM/CMS systems
only, the server is started using the REXEC remote execution
client, supplied as part of IBM's TCP/IP software. More
information on the inetd can be obtained by typing "man inetd"
on a Unix system.
CLOSE
Close communication with the current remote host.
CD[PATHNAME] [PASSWORD] [CHOPT]
- PATHNAME
- Pathname
- PASSWORD
- Password - for password protected VM/CMS minidisks only
- CHOPT
- List of options
- C
- Case sensitive directory name. If not specified,
pathnames are folded to lower case on Unix systems.
Change remote working directory.
If a pathname is not specified, the current working directory
is displayed.
ZFTP>cd JaMiE -c
On remote VM systems, one can change directory to a mini-disk that
has a read or write password by specifying the password and access
mode required, as in the examples below.
ZFTP> cd jamie.400 mypass -r | Read only link
ZFTP> cd fatmen.222 mypass -w | Write link
LCD[PATHNAME] [PASSWORD] [CHOPT]
- PATHNAME
- Pathname
- PASSWORD
- Password - for password protected VM/CMS minidisks only
- CHOPT
- List of options
- C
- Case sensitive directory name. If not specified,
pathnames are folded to lower case on Unix systems.
Change local working directory.
If a pathname is not specified, the current working directory
is displayed.
PWD
Print remote working directory.
LPWD
Print local working directory.
LS[PATTERN] [CHOPT]
- PATTERN
- Filenames to list. If not specified, all files in the
current working directory will be displayed
- CHOPT
- List of options
- L
- Long listing
Issue remote LS command
If option -l is given, a 'long listing' will be generated.
This corresponds to the Unix ls -l option or the VM/CMS
LISTFILE (L command.
LLS[PATTERN] [CHOPT]
- PATTERN
- Filenames to list. If not specified, all files in the
current working directory will be displayed
- CHOPT
- List of options
- L
- Long listing
Issue local LS command
If option -l is given, a 'long listing' will be generated.
This corresponds to the Unix ls -l option or the VM/CMS
LISTFILE (L command.
MVSOURCE TARGET CHOPT
- SOURCE
-
- TARGET
-
- CHOPT
- List of options
- C
- Respect case of file names (Unix systems)
Move remote file from SOURCE to TARGET.
LMVSOURCE TARGET CHOPT
- SOURCE
-
- TARGET
-
- CHOPT
- List of options
- C
- Respect case of file names (Unix systems)
Move local file from SOURCE to TARGET.
RMFILENAME
- FILENAME
- Filename to be removed
Filename 'Filename' C D=' '
Remove (delete) remote file
LRMFILENAME
- FILENAME
- Filename to be removed
Filename 'Filename' C D=' '
Remove (delete) local file
LOGLEVELLEVEL
- LEVEL
- Loglevel to set, default=0
Use the LOGLEVEL command to set the level of logging/debug of
the ZFTP command.
SVERSION
Print version of server program
VERSION
Print version of client program
Distributed PAW is currently limited to the ability to access remote
histogram files, or histograms and ntuples existing in global
sections on remote VMS systems. This will be extended over time
to provide the equivalent of global sections on Unix systems,
and to distribute CPU intensive parts of PAW on
mainframes or powerful CPU servers.
The FORTRAN callable interface consists of the CZ and XZ packages.
Normally, only the XZ package is of concern to the user: any calls
to the CZ package being made in a completely transparent manner.
The exception to this case is of course when a new application
that requires a different server is to be built.
5cmBasic client-server routines
4cmOpen communication with a remote node
CALL CZOPEN (SERVICE,HOST,IRC*)
- SERVICE
- Character variable specifying the name of the service required,
e.g. ZSERV
- HOST
- Character variable specifying the name of the remote host.
- IRC
- Integer variable in which the return code is returned.
This routine opens a connection with a remote node. A new process
is automatically created on the specified node using the username
and password that are prompted for at the terminal.
When TCPAW is used as the network layer, usernames and passwords
may also be given in a .netrc file in the user's home
directory (Unix systems).
In the case of VAX/VMS systems,
the name of this file is .ftplogin;.
For VM/CMS systems running the C version of TCPAW,
this file is DOT NETRC A0.
For a description of the format of these files, see page .
In the case of VM systems, the virtual machine of the specified
user is autologged. This requires that the user in question
is not currently logged on.
Example of using the CZOPEN routine
CALL CZOPEN('ZSERV','CERNVM',IRC)
IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from CZOPEN
To select DECnet instead of TCP/IP as the communications protocol,
the variable IPROT in the sequence CZSOCK should be set to 1.
Example of using DECnet as the communications protocal
+CDE,CZSOCK. From CSPACK PAM
IPROT = 1
CALL CZOPEN('ZSERV','VXCRNA',IRC)
When using DECnet as the communications protocol, username and
password prompting only occurs for interactive sessions.
For other sessions, a server is started using the standard
DECnet techniques, i.e. using a PROXY account if one
exists, or else the default DECnet account.
To disable username and password prompting for interactive sessions,
set the logical name CZPROXY to TRUE, e.g.
Turning off username prompting for DECnet connections
DEFINE CZPROXY TRUE
3cmClose communication with the current remote node
CALL CZCLOS (IRC*)
- IRC
- Integer variable in which the return code is returned.
This routine closes the connection with the current remote node.
The process on the remote node is automatically terminated.
The current remote node is the one specified in the last call
to CZOPEN, or set by the routine CZSWAP.
Example of using the CZCLOS routine
CALL CZCLOS(IRC)
IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from CZCLOS
4cmSwitch communication to another node
CALL CZSWAP (NODE,LUN,IRC*)
- NODE
- Character variable specifying the node name to which communication
should be swapped.
- LUN
- Integer variable specifying the logical unit associated with
the remote node.
- IRC
- Integer variable in which the return code is returned.
This routine changes the current node to that associated with the
specified logical unit or nodename. If the nodename is non-blank,
communication is swapped to the specified node. If the nodename
is blank, communication is swapped to the node associated
to LUN (e.g. from a call to XZOPEN, see on Page ).
This routine is called automatically
by the routines of the XZ package and need normally not be called
by a user.
Example of using the CZSWAP routine
CALL CZSWAP(' ',77,IRC)
IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from CZSWAP
3cmReturn real time elapsed since last call
CALL CZRTIM (ELAPSED*)
- ELAPSED
- Character variable in which the elpased time is returned in the
format HH:MM:SS.
The CZRTIM routine is used by the XZGET/PUT routines if the option
S is specified in order to print statistics on data transfer rates.
This routine must always be called twice: once
to start the timer and a second time to return the elapsed time.
Example of using the CZRTIM routine
*
* Start timer
*
CALL CZRTIM(ELAPSD)
* Work a little
* ...
*
* Get elapsed time since last call
CALL CZRTIM(ELAPSD)
4cmSend text string to current remote node
CALL CZPUTA (STRING,IRC*)
- STRING
- Character variable containing the data to be sent to the remote node.
- IRC
- Integer variable in which the return code is returned.
This routine sends a text string to the remote server.
Example of using the CZPUTA routine
*
* Extract from the ZFTP routine ZFTPCD (action routine for
* the CD command.
*
CALL CZPUTA('XZIO :CD '//PATH(1:LPATH)',IRC)
IF(IRC.NE.0) PRINT *,'Return code ',IRC,' from CZPUTA
4cmRead text string from remote server
CALL CZGETA (STRING,IRC*)
- STRING
- Character variable in which the data read from the remote server is
returned.
- IRC
- Integer variable in which the return code is returned.
This routine gets a text string from the remote server.
An example of its use in the ZFTP program is shown on the following
page.
Example of using the CZGETA routine
*
* Sequence CZMESS from CSPACK - this sequence is used by the
* various XZ routines to process server messages.
*
+KEEP,CZMESS.
*
* Process server messages
*
10 CONTINUE
CALL CZGETA(CHMAIL,ISTAT)
LCH = LENOCC(CHMAIL)
IF(CHMAIL(1:1).EQ.'0') THEN
*
* Nop
*
ELSEIF(CHMAIL(1:1).EQ.'1') THEN
PRINT *,CHMAIL(2:LCH)
ELSEIF(CHMAIL(1:1).EQ.'2') THEN
PRINT *,CHMAIL(2:LCH)
GOTO 10
ELSEIF(CHMAIL(1:1).EQ.'3') THEN
PRINT *,CHMAIL(2:LCH)
IQUEST(1) = 1
IRC = 1
ELSEIF(CHMAIL(1:1).EQ.'E') THEN
IQUEST(1) = -1
IRC = -1
ELSEIF(CHMAIL(1:1).EQ.'V') THEN
*
* Number of bytes read from a variable length read
*
READ(CHMAIL(2:11),'(I10)') NGOT
GOTO 10
ELSE
PRINT *,'Unknown server message ',CHMAIL
IQUEST(1) = 1
IRC = 1
ENDIF
*
4cmSend character array to remote server process
CALL CZPUTC (NCHAR,IRC*)
- NCHAR
- Integer variable giving the number of characters to be sent. The
data is in the common block /CZBUFC/ in the character variable
CHBUF.
- IRC
- Integer variable in which the return code is returned.
This routine sends a character string to the remote server.
Example of using the CZPUTC routine
CALL CZPUTC(NTOT,ISTAT)
IF(ISTAT.NE.0)GO TO 99
4cmGet character array from remote server process
CALL CZGETC (NCHAR,IRC*)
- NCHAR
- Integer variable giving the number of characters to be sent. The
data is in the common block /CZBUFC/ in the character variable
CHBUF.
- IRC
- Integer variable in which the return code is returned.
This routine reads a character string from the remote server.
Example of using the CZGETC routine
CALL CZGETC(NTOT,ISTAT)
IF(ISTAT.NE.0)GO TO 99
5cmTransfer data between client and server
CALL CZTCP (IBUFF,ICONTR)
- IBUFF
- Array containing hollerith or binary data to be sent to the server
or received from the server depending on the ICONTR vector.
- ICONTR
- Integer vector of length 2 to determine mode of operation.
ICONTR(1) = IMODE, ICONTR(2) = NBYTES
This routine sends or receives data to/from the remote server.
IMODE = 0: receive binary
IMODE = 1: send binary
IMODE = 2: receive character data
IMODE = 3: send character data
Example of using the CZTCP routine*
* Send the data
*
ICONT(1) = 1
LBUF = NWORDS
CALL CZTCP(IBUFF,ICONT)
ENDIF
17cmRoutines to convert or copy files
5cmConvert RZ file to FZ exchange format
CALL XZRTOF (CHRZ,CHFZ,LRECL,CHOPT,IRC)
- CHRZ
- Character string giving the name of the RZ file
to be converted.
- CHFZ
- Character string giving the name of the output
FZ file.
- LRECL
- Integer variable specifying the record length
for the output file in bytes. If not specified, a default
of 3600 bytes will be used for binary exchange format files
and 80 bytes for alpha exchange format files.
- CHOPT
- Character variable specifying the options required
- A
- Output file should be in alpha exchange format (default is binary).
- C
- Respect case of input and output file names
- R
- Replace output file, if it exists
- IRC
- Integer variable in which the completion status is
returned.
This routine will convert a ZEBRA RZ file into FZ exchange format.
The resultant file may then be transferred to another system
and reconverted using XZRFRF.
Example of using the XZRTOF routine
*
* Convert an RZ file to a FZ alpha file
*
CALL XZRTOF('NTUPLE.DAT','NTUPLE.FA',0,'A',IRC)
5cmConvert RZ file from FZ exchange format
CALL XZRFRF (CHFZ,CHRZ,LRECL,CHOPT,IRC)
- CHFZ
- Character string giving the name of the FZ file
to be converted.
- CHRZ
- Character string giving the name of the output
RZ file.
- LRECL
- Integer variable specifying the record length
for the output file in bytes. If not specified, the record
length of the original RZ file is used.
- CHOPT
- Character variable specifying the options required
- C
- Respect case of input and output file names
- R
- Replace output file, if it exists
- X
- Output file should be in exchange format (default is native).
- IRC
- Integer variable in which the completion status is
returned.
This routine will convert a ZEBRA FZ file created using
the routine XZRTOF into FZ exchange format.
Example of using the XZRFRF routine
*
* Convert an FZ exchange file back into an RZ file
* Override the record length in the process
*
CALL XZRTOF('NTUPLE.FX','NTUPLE.RZ',16384,'X',IRC)
CALL XZCTOF (CHIN,CHOUT,LRECL,CHOPT,IRC)
- CHIN
- Character string giving the name of the file
to be converted.
- CHOUT
- Character string giving the name of the output
file.
- LRECL
- Integer variable giving the record length of the
input file in bytes. In case of option X, the record length
is automatically determined from the file itself.
- CHOPT
- Character string specifying the options required.
- C
- Respect case of input and output file names
- R
- Replace output file, if it exists
- X
- Input file is in ZEBRA exchange format
- IRC
- Integer variable in which the return code is returned.
This routine converts a binary file written with C or FORTRAN
direct-access I/O into a file written with FORTRAN sequential
I/O. This can be useful on Unix systems, when an FZ or EPIO
file that has been transferred from another system is to be read using
FORTRAN I/O.
Example of using the XZCTOF routine*
* Convert an FZ file for processing with FORTRAN
*
CALL XZCTOF('FXFILE.DAT','FXFILE.OUT',0,'X',IRC)
CALL XZFTOC (CHIN,CHOUT,LRECL,CHOPT,IRC)
- CHIN
- Character string giving the name of the file
to be converted.
- CHOUT
- Character string giving the name of the output
file.
- LRECL
- Integer variable giving the record length of the
input file in bytes. In case of option X, the record length
is automatically determined from the file itself.
- CHOPT
- Character string specifying the options required.
- C
- Respect case of input and output file names
- R
- Replace output file, if it exists
- X
- Input file is in ZEBRA exchange format
- IRC
- Integer variable in which the return code is returned.
This routine converts a binary file written with FORTRAN
sequential I/O into a file written with FORTRAN direct access
I/O. This can be useful on Unix systems, when an FZ or EPIO
file written with FORTRAN sequential I/O is to be transferred
to another system.
Example of using the XZFTOC routine*
* Convert an EPIO file for ftp-ing to another system
*
CALL XZFTOC('EPIO.DAT','EPIO.OUT',3600,' ',IRC)
CALL XZFZCP (CHIN,CHOUT,IRECL,IFORM,ORECL,OFORM,CHOPT,IRC)
- CHIN
- Character string giving the name of the file
to be copied.
- CHOUT
- Character string giving the name of the output
file.
- IRECL
- Integer variable giving the record length of the
input file. The record length need only be specified in case
of option Z below.
- IFORM
- Character variable giving the format of the output file
- A
- Input file is in alpha exchange format
- N
- Input file is in exchange file format, but native data
- X
- Input file is in binary exchange format
- Z
- Input file is in native data and file format
- ORECL
- Integer variable giving the record length of the
output file. If not specified, the input record length will
be taken, except for alpha exchange mode files, where a record
length of 80 will be used.
- OFORM
- Character variable giving the format of the input file
- A
- Output file is in alpha exchange format
- N
- Output file is in exchange file format, but native data
- X
- Output file is in binary exchange format
- Z
- Output file is in native data and file format
- CHOPT
- Character string specifying the options required.
- C
- Respect case of input and output file names
- R
- Replace output file, if it exists
- IRC
- Integer variable in which the return code is returned.
This routine copies an FZ file on the local machine, with
optional format and/or data conversion.
Example of using the XZFZCP routine*
* Copy an alpha FZ file to a native FZ file
*
CALL XZFZCP('fafile.dat','fzfile.dat',0,'A',32400,'Z',IRC)
CALL XZRZCP (CHIN,CHOUT,LRECL,CHOPT,IRC)
- CHIN
- Character string giving the name of the file
to be copied.
- CHOUT
- Character string giving the name of the output
file.
- LRECL
- Integer variable giving the record length for
the output file. The record length of the input file will
be used if a value of 0 is given for LRECL.
- CHOPT
- Character string specifying the options required.
- C
- Respect case of input and output file names
- N
- Output file should be in native format (default)
- R
- Replace output file, if it exists
- X
- Output file should be in exchange format
- IRC
- Integer variable in which the return code is returned.
This routine copies an RZ file on the local machine, with
optional data conversion and/or record length conversion.
Example of using the XZRZCP routine*
* Copy an ntuple, changing the record length and
* data representation at the same time
*
CALL XZRZCP('HRZTEST.DAT','hrztest.rz',8192,'CX',IRC)
17cmRoutines to transfer files
N.B. for all of the following routines, a connection must
first be established using CZOPEN (see on Page ).
All of the following routines return:
IRC < 0 : error - explanatory message will be printed by routine
IRC = 0 : success : see statistics in IQUEST
IRC = 1 : cannot open remote file
IRC = 2 : cannot open local file
IRC = 3 : problem in file transfer
For IRC = 0:
IQUEST(11) = Number of records transferred
IQUEST(12) = Number of kilobytes transferred
IQUEST(13) = Transfer rate in KB/second
IQUEST(14) = Number of hours elapsed (real time)
IQUEST(15) = Number of minutes elapsed (real time)
IQUEST(16) = Number of seconds elapsed (real time)
IQUEST(17) = Number of seconds elapsed (CPU time)
N.B. file names for VM/CMS systems should be specified in
the form filename.filetype[.filemode], e.g.
PROFILE.EXEC.A. VM mini-disks should be specified in the form
[username[.address]],e.g.
[N.B. no further communication with the remote node is possible
until all pending file names have been read. Use the PATCHY sequence
CZFLUSH to flush pending file names if required. JAMIE], [PUBWS.197].
File transfer to and from VM/CMS systems and access to files
stored in VM/CMS systems is only possible to the current 'A-disk',
which can be changed using the XZCD routine (see on Page ).
5cmGet text file
CALL XZGETA (LOCAL,REMOTE,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
If LOCAL = '=', then the file on the local system will
have the same name as on the remote system.
- REMOTE
- Character variable specifying the remote file name.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer vriable in which the return code is returned.
This routine gets a text file from the remote system.
If option 'S' is specified, statistics on the file transfer
are printed. If option 'V' is specified, the local file will
have variable length record format (IBM-VM systems only).
Example of using the XZGETA routine
CALL XZGETA('=','CZPACK.CARDS','S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
5cmSend text file
CALL XZPUTA (LOCAL,REMOTE,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
- REMOTE
- Character variable specifying the remote file name.
If REMOTE = '=', then the file on the remote system will
have the same name as on the local system.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine sends a text file to the remote system.
If option 'S' is specified, statistics on the file transfer
are printed. If option 'V' is specified, the remote file will
have variable length record format (IBM-VM systems only).
Example of using the XZPUTA routine
CALL XZPUTA('CZPACK.CARDS','=','S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
6cmGet binary file: fixed length records
CALL XZGETB (LOCAL,REMOTE,LRECL,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
If LOCAL = '=', then the file on the local system will
have the same name as on the remote system.
- REMOTE
- Character variable specifying the remote file name.
- LRECL
- Integer variable specifying the record length of the file in bytes.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine gets a binary file from the remote system.
The file must have fixed length records. ZEBRA FZ files in
binary exchange format, PATCHY CETA files and EPIO files
are examples of files that can be transferred with this routine.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZGETB routine
CALL XZGETB('FXFILE.DAT','FXFILE.VAX',32400,'S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
6cmSend binary file: fixed length records
CALL XZPUTB (LOCAL,REMOTE,LRECL,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
- REMOTE
- Character variable specifying the remote file name.
If REMOTE = '=', then the file on the remote system will
have the same name as on the local system.
- LRECL
- Integer variable specifying the record length of the file in bytes.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine sends a binary file to the remote system.
The file must have fixed length records. ZEBRA FZ files in
binary exchange format, PATCHY CETA files and EPIO files
are examples of files that can be transferred with this routine.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZPUTB routine
CALL XZPUTB('CZPACK.CETA','=',3600,'S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
6cmGet FORTRAN direct access file
CALL XZGETD (LOCAL,REMOTE,LRECL,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
If LOCAL = '=', then the file on the local system will
have the same name as on the remote system.
- REMOTE
- Character variable specifying the remote file name.
- LRECL
- Integer variable specifying the record length of the file in bytes.
- CHOPT
- Characer variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine gets a direct access file from the remote system.
ZEBRA FZ files in binary exchange format written with option D,
ZEBRA RZ files (between
like machines)
are examples of files that can be transferred with this routine.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZGETD routine
CALL XZGETD('FXFILE.DAT','FXFILE.VAX',32400,'S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
6cmSend FORTRAN direct access file
CALL XZPUTD (LOCAL,REMOTE,LRECL,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
- REMOTE
- Character variable specifying the remote file name.
If REMOTE = '=', then the file on the remote system will
have the same name as on the local system.
- LRECL
- Integer variable specifying the record length of the file in bytes.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine sends a direct access file to the remote system.
ZEBRA FZ files in binary exchange format written with option D,
ZEBRA RZ files (between
like machines)
are examples of files that can be transferred with this routine.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZPUTD routine
CALL XZPUTD('FXFILE.DATA','=',32400,'S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
5cmGet binary PAM file
CALL XZGETP (LOCAL,REMOTE,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
If LOCAL = '=', then the file on the local system will
have the same name as on the remote system.
- REMOTE
- Character variable specifying the remote file name.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine gets a binary PAM file from the remote system.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZGETP routine
CALL XZGETP('=','ZEBRA.PAM','S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
5cmSend binary PAM file
CALL XZPUTP (LOCAL,REMOTE,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
- REMOTE
- Character variable specifying the remote file name.
If REMOTE = '=', then the file on the remote system will
have the same name as on the local system.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine sends a binary PAM file to the remote system.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZPUTP routine
CALL XZPUTP('KERNAPO.PAM','/cern/new/pam/kernapo/pam','S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
7cmGet ZEBRA FZ file
CALL XZGETF (LOCAL,REMOTE,LRECL,LFORM,RRECL,RFORM,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
If LOCAL = '=', then the file on the local system will
have the same name as on the remote system.
- REMOTE
- Character variable specifying the remote file name.
- LRECL
- Integer variable specifying the record length of the local
file in bytes.
- LFORM
- Character variable specifying the format of the local file.
- RRECL
- Integer variable specifying the record length of the remote
file in bytes.
- RFORM
- Character variable specifying the format of the remote file.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine gets a binary file from the remote system.
If the local file format or record length are not given,
they default to the same values as on the remote system.
The format may be 'A', for FZ exchange, ASCII mapping,
'X', for FZ exchange, binary, or ' ' for FZ native.
For ASCII files the record length defaults to 80 bytes.
For binary exchange format files, the record length is taken
from the file itself. For native format files the record
length must be specified. For binary exchange format files,
a 'D' may also be specified, indicating that the file should
be processed using direct-access I/O.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZGETB routine
*
* Transfer a remote ASCII exhange format file to a local
* binary exchange format file
*
CALL XZGETF('FXFILE.DAT','FXFILE.VAX',80,'A',32400,'X','S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
7cmSend ZEBRA FZ file
CALL XZPUTF (LOCAL,REMOTE,LRECL,LFORM,RRECL,RFORM,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
- REMOTE
- Character variable specifying the remote file name.
If REMOTE = '=', then the file on the remote system will
have the same name as on the local system.
- LRECL
- Integer variable specifying the record length of the local
file in bytes.
- LFORM
- Character variable specifying the format of the local file.
- RRECL
- Integer variable specifying the record length of the remote
file in bytes.
- RFORM
- Character variable specifying the format of the remote file.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine sends a ZEBRA FZ file to the remote system.
If the remote file format or record length are not given,
they default to the same values as on the local system.
The format may be 'A', for FZ exchange, ASCII mapping,
'X', for FZ exchange, binary, or ' ' for FZ native.
For ASCII files the record length defaults to 80 bytes.
For binary exchange format files, the record length is taken
from the file itself. For native format files the record
length must be specified. For binary exchange format files,
a 'D' may also be specified, indicating that the file should
be processed using direct-access I/O.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZPUTF routine
*
* Transfer the local exchange format file to a remote native
* format file
*
CALL XZPUTF('FZFILE.DATA','=',32400,'X',32400,' ','S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
6cmGet RZ file
CALL XZGETR (LOCAL,REMOTE,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
If LOCAL = '=', then the file on the local system will
have the same name as on the remote system.
- REMOTE
- Character variable specifying the remote file name.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine gets a ZEBRA RZ file from the remote system.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZGETR routine
CALL XZGETR('=','HBOOK.CMZ','S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
5cmSend ZEBRA RZ file
CALL XZPUTR (LOCAL,REMOTE,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
- REMOTE
- Character variable specifying the remote file name.
If REMOTE = '=', then the file on the remote system will
have the same name as on the local system.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine sends a ZEBRA RZ file to the remote system.
ZEBRA RZ files include HBOOK histogram files, ntuples, CMZ files etc.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZPUTR routine
CALL XZPUTR('FPACK.CMZ','=,'S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
6cmGet exchange format file
CALL XZGETX (LOCAL,REMOTE,LRECL,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
If LOCAL = '=', then the file on the local system will
have the same name as on the remote system.
- REMOTE
- Character variable specifying the remote file name.
- LRECL
- Integer variable specifying the record length of the file in bytes.
- CHOPT
- Characer variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine retrieves an exchange format file from the remote system.
An exchange format file is one with fixed length records and
no control words.
The XZGETX routine uses Fortran
sequential I/O on all systems except Unix, where files are
processed with direct access I/O to avoid the control
words that are written at the beginning and end of each
record with binary sequential Fortran I/O.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZGETX routine
CALL XZGETX('FXFILE.DAT','FXFILE.VAX',32400,'S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
6cmSend exchange format file
CALL XZPUTX (LOCAL,REMOTE,LRECL,CHOPT,IRC)
- LOCAL
- Character variable specifying the local file name.
- REMOTE
- Character variable specifying the remote file name.
If REMOTE = '=', then the file on the remote system will
have the same name as on the local system.
- LRECL
- Integer variable specifying the record length of the file in bytes.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine sends an exchange format file to the remote system.
An exchange format file is one with fixed length records and
no control words.
The XZPUTX routine uses Fortran
sequential I/O on all systems except Unix, where files are
processed with direct access I/O to avoid the control
words that are written at the beginning and end of each
record with binary sequential Fortran I/O.
If option 'S' is specified, statistics on the file transfer
are printed.
Example of using the XZPUTX routine
CALL XZPUTX('FXFILE.DATA','=',32400,'S',IRC)
IF(IRC.NE.0) PRINT *,'File transfer failed'
7cmRoutines to perform remote I/O
6cmOpen remote file
CALL XZOPEN (LUN,FILE,NODE,LRECL,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- FILE
- Character variable specifying the remote file name.
- NODE
- Characer variable specifying the remote node name.
- LRECL
- Integer ariable specifying the record length in bytes.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine opens a file on the specified node. If a connection
to the remote system is not yet established, a call to CZOPEN
is made automatically.
The record length is currently only required for direct access files.
CHOPT: 'D' - Open the file for direct access (default=sequential)
CHOPT: 'F' - Open the file 'FORMATTED' (default=unformatted)
CHOPT: 'N' - Open the file with STATUS='NEW' (default=unknown)
Example of using the XZOPEN routineCALL XZOPEN(11,'/user/jamie/cspack/cspack.ceta',3600,' ',IRC)
IF(IRC.NE.0) PRINT *,'Cannot open remote file'
4cmClose remote file
CALL XZCLOS (LUN,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine closes a remote file previously opened by XZOPEN.
CHOPT: 'D' - Delete remote file
Example of using the XZCLOS routineCALL XZCLOS(11,' ',IRC)
IF(IRC.NE.0) PRINT *,'Error closing remote file'
4cmOpen a remote RZ file
CALL XZRZOP (LUN,NODE,CHFILE,CHOPT,LRECL,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- NODE
- Characer variable specifying the remote node name.
- CHFILE
- Character variable specifying the remote file name.
- CHOPT
- Character variable to specify the options desired.
- LRECL
- Integer ariable specifying the record length in bytes.
- IRC
- Integer variable in which the return code is returned.
Use the XZROPN to open a remote RZ file. See the description of
the RZOPEN routine in the Zebra manual for more details.
7cmRead record from remote file
CALL XZREAD (LUN,IBUFF,NREC,NWANT,NGOT,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- IBUFF
- Array to receive the data.
- NREC
- Integer variable specifying the record number to read
(for direct access files only).
- NWANT
- Integer variable specifying the number of bytes to read
(for files with variable length records NWANT specifies the
maximum number of bytes that can be accepted).
- NGOT
- Integer variable specifying the number of bytes read
for files with variable length records.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine reads a record from a remote file
previously opened by XZOPEN.
Example of using the XZREAD routine
CALL XZREAD(11,IBUFF,0,32400,NGOT,' ',IRC)
IF(IRC.NE.0) PRINT *,'Error reading remote file'
6cmWrite record to remote file
CALL XZRITE (LUN,IBUFF,NREC,NWRITE,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- IBUFF
- Array to containing the data to be written.
- NREC
- Integer variable specifying the record number to write
(for direct access files only).
- NWRITE
- Integer variable specifying the number of bytes to write.
for files with variable length records.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine writes a record from a remote file
previously opened by XZOPEN.
Example of using the XZRITE routine
NREC = 30
LENBUFF = 8192
CALL XZRITE(11,IBUFF,NREC,32400,LENBUFF,' ',IRC)
IF(IRC.NE.0) PRINT *,'Error writing to remote file'
4cmRead a line from a remote file
CALL XZGETL (LUN,CHLINE,CHFORM,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- CHLINE
- Character variable to receive the line
- CHFORM
- Character variable specifying the format to
be used for reading the line
- CHOPT
- Character variable specifying the options required
- IRC
- Integer variable in which the return code is returned.
This routine reads a record from a remote formatted
file previously opened with the XZOPEN routine.
Example of using the XZGETL routineCALL XZGETL(LUFZFA,CHLINE,'(A)',' ',IRC)
IF(IRC.NE.0) GOTO 20
4cmWrite a line to a remote file
CALL XZPUTL (LUN,CHLINE,CHFORM,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- CHLINE
- Character variable containing the data to be written
- CHFORM
- Character variable specifying the format to
be used for writing the line
- CHOPT
- Character variable specifying the options required
- IRC
- Integer variable in which the return code is returned.
This routine writes a record to a remote formatted
file previously opened with the XZOPEN routine.
Example of using the XZPUTL routineCALL XZPUTL(LUFZFA,CHLINE,'(A)',' ',IRC)
IF(IRC.NE.0) GOTO 20
4cmRewind remote file
CALL XZREWD (LUN,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine rewinds a remote file
previously opened by XZOPEN.
Example of using the XZREWD routine
CALL XZREWD(11,' ',IRC)
IF(IRC.NE.0) PRINT *,'Error rewinding to remote file'
5cmInquire if remote file exists
CALL XZINQR (LUN,FILE,NODE,IEXIST,LRECL,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- FILE
- Character variable specifying the remote file name.
- NODE
- Character variable specifying the node on which the
file resides
- IEXIST
- Integer variable in which the remote file status is returned.
- LRECL
- Integer variable in which the record length of the
remote file status is returned.
- IRC
- Integer variable in which the return code is returned.
This routine checks whether a remote file exists or is OPENed.
Example of using the XZINQR routine
CALL XZINQR(11,'DISK$CERN:<JAMIE>ZEBRA.PAM',
+ 'VXCRNA',IEXIST,LRECL,IRC)
IF(IRC.NE.0) PRINT *,'Error issuing remote inquire'
7cmGeneral utility routines
6cmInitialise XZ package
CALL XZINIT (LPRINT,LDEBUG,LUNI,LUNO,IRC)
- LPRINT
- Integer variable specifying logical unit to be used to
print diagnostic messages.
- LDEBUG
- Integer variable specifying the level of debug messages
to be printed.
See the description of the XZLOGL routine for details of the
various log levels.
- LUNI
- Integer variable specifying the logical unit used for file input
by the XZGETx/XZPUTx routines.
- LUNO
- Integer variable specifying the logical unit used for file output
by the XZGETx/XZPUTx routines.
- IRC
- Integer variable in which the return code is returned.
This routine sets the logical units to be used by the XZ package
and the log level. The log level may be reset at any time by
a call to XZLOGL or by a further call to XZINIT.
Example of using the XZINIT routine
CALL XZINIT(6,0,11,21,IRC)
IF(IRC.NE.0) PRINT *,'Error from XZINIT'
3cmSet log level of XZ package
CALL XZLOGL (LDEBUG)
- LDEBUG
- Integer variable specifying the level of debug messages
to be printed.
This routine sets the log level of the XZ package
The log level may be reset at any time by
a further call to XZLOGL or by XZINIT.
The various levels are described below.
1 Initialise ZEBRA (via call to HLIMIT)
2 Initialise XZ (define logical units, log level)
3 Open connection to the FATMEN server
4 Call an EXEC that uses WAKEUP to wakeup upon arrival of new files in
the RDR, or every hour.
5 If a new file has been received, this is then sent to the appropriate
directory on the FATCAT machine.
6 If no new file has been received, or after successfully sending any
new files, a search is made in the appropriate directories on the
remote node for pending updates for CERNVM.
7 Any such files are transferred, and then the call to WAKEUP is
reissued.
8 The program can only exit if a user hits enter on the console of the
virtual machine, or if an appropriate SMSG is received from a suitably
authorised used.
Example of using the XZLOGL routine
CALL XZLOGL(-3)
3cmPrint date of generation of package
CALL XZVERS
This routine prints the PAM file title from the CSPACK
PAM file and the date and time of the PATCHY run
that generated the code.
Example of using the XZVERS routine
CALL XZVERS
5cmDirectory utilities
4cmChange remote directory
CALL XZCD (PATH,IRC)
- PATH
- Character variable specifying the name of the remote directory
to be set.
- IRC
- Integer variable in which the return code is returned.
This routine changes the remote directory to that specified by
the character variable PATH. On VM systems, the remote directory
should be given in the form user.address or <user.address>
If the address is omitted, 191 is assumed.
Example of using the XZCD routine
CALL XZCD('FAT3.192',IRC)
IF(IRC.NE.0) PRINT *,'Error setting remote directory'
On remote VM systems, one can change directory to a mini-disk that
has a read or write password by specifying the password and access
mode required, as in the examples below.
*
* Read link to FAT3.192
*
CALL XZCD('FAT3.192 MYPASS R',IRC)
*
* Write link to FAT3.192
*
CALL XZCD('FAT3.192 MYPASS W',IRC)
4cmChange local directory
CALL XZLCD (PATH,IRC)
- PATH
- Character variable specifying the name of the local directory
to be set.
- IRC
- Integer variable in which the return code is returned.
This routine changes the local directory to that specified by
the character variable PATH. On VM systems, the local directory
should be given in the form user.address or <user.address>
If the address is omitted, 191 is assumed.
Example of using the XZLCD routine
CALL XZLCD('FAT3.192',IRC)
IF(IRC.NE.0) PRINT *,'Error setting local directory'
4cmGet current remote directory
CALL XZPWD (PATH,IRC)
- PATH
- Character variable in which the current remote directory
is returned.
- IRC
- Integer variable in which the return code is returned.
This routine returns the current remote directory.
Example of using the XZPWD routine
CALL XZPWD(PATH,IRC)
IF(IRC.NE.0) THEN
PRINT *,'Error setting remote directory'
ELSE
PRINT *,'Current working directory is ',PATH(1:LENOCC(PATH))
ENDIF
4cmGet current local directory
CALL XZLPWD (PATH,IRC)
- PATH
- Character variable in which the current local directory
is returned.
- IRC
- Integer variable in which the return code is returned.
This routine returns the current local directory.
Example of using the XZLPWD routine
CALL XZLPWD(PATH,IRC)
IF(IRC.NE.0) THEN
PRINT *,'Error obtaining local directory'
ELSE
PRINT *,'Current working directory is ',PATH(1:LENOCC(PATH))
ENDIF
19cmIssue remote LS command
CALL XZLS (PATH,FILES,MAXFIL,NFILES,ICONT,CHOPT,IRC)
- PATH
- Character variable specifying the path name for the remote
ls command. If the intention is to list the current working
directory, PATH should be set to a single blank.
- FILES
- Character array of size MAXFIL in which the remote file names
are returned. If more than MAXFIL files are found, IRC will be set
to -1. XZLS may be called again with ICONT.NE.0 to receive the
the next batch of file names.
- MAXFIL
- Integer constant specifying the dimension of the character array
FILES.
- NFILES
- Integer variable in specifying
the number of files returned in FILES.
- ICONT
- Integer variable specifying
the number of files returned in FILES.
- CHOPT
- Character variable specifying the required options:
If CHOPT = 'L' a 'long listing' will be returned.
This corresponds to the Unix ls option -l and the VM LISTFILE option L.
- IRC
- Integer variable in which the return code is returned.
This routine issues a remote LS command and returns the output
in the character array FILES.
Example of using the XZLS routine
CALL XZLS('*.CARDS',FILES,100,NFILES,0,'L',IRC)
IF(IRC.NE.0) THEN
PRINT *,'Error issuing remote LS command'
ELSE
DO 10 I=1,NFILES
PRINT *,FILES(I)(1:LENOCC(FILES(I)))
10 CONTINUE
ENDIF
8cmIssue local LS command
CALL XZLLS (PATH,FILES,MAXFIL,NFILES,ICONT,CHOPT,IRC)
- PATH
- Character variable specifying the path name for the local
ls command. If the intention is to list the current working
directory, PATH should be set to a single blank.
- FILES
- Character array of size MAXFIL in which the remote file names
are returned. If more than MAXFIL files are found, IRC will be set
to -1. XZLS may be called again with ICONT.NE.0 to receive the
- MAXFIL
- Integer constant specifying the dimension of the character array
FILES.
- NFILES
- Integer variable in specifying
the number of files returned in FILES.
- ICONT
- Integer variable specifying
the number of files returned in FILES.
- CHOPT
- Character variable specifying the required options:
If CHOPT = 'L' a 'long listing' will be returned.
This corresponds to the Unix ls option -l and the VM LISTFILE option L.
- IRC
- Integer variable in which the return code is returned.
This routine issues a remote LS command and returns the output
in the character array FILES.
Example of using the XZLLS routine
CALL XZLLS('*.CARDS',FILES,100,NFILES,0,'L',IRC)
IF(IRC.NE.0) THEN
PRINT *,'Error issuing LS command'
ELSE
DO 10 I=1,NFILES
PRINT *,FILES(I)(1:LENOCC(FILES(I)))
10 CONTINUE
ENDIF
4cmIssue remote MV command
CALL XZMV (SOURCE,TARGET,CHOPT,IRC)
- SOURCE
- Character variable specifying the source file name
- TARGET
- Character variable specifying the target file name
- CHOPT
- Options
- C
- Respect case of file names (Unix systems)
- IRC
- Integer variable in which the return code is returned.
This routine moves the remote file from SOURCE to TARGET.
4cmIssue local MV command
CALL XZLMV (SOURCE,TARGET,CHOPT,IRC)
- SOURCE
- Character variable specifying the source file name
- TARGET
- Character variable specifying the target file name
- CHOPT
- Options
- C
- Respect case of file names (Unix systems)
- IRC
- Integer variable in which the return code is returned.
This routine moves the local file from SOURCE to TARGET.
4cmIssue remote RM command
CALL XZRM (FILE,IRC)
- FILE
- Character variable specifying the name of the file to be removed.
- IRC
- Integer variable in which the return code is returned.
This routine issues deletes the specified file on the remote system.
Example of using the XZRM routine
CALL XZRM('CSPACK.CARDS',IRC)
IF(IRC.NE.0) PRINT *,'Error issuing RM command'
4cmIssue local RM command
CALL XZLRM (FILE,IRC)
- FILE
- Character variable specifying the name of the file to be removed.
- IRC
- Integer variable in which the return code is returned.
This routine issues deletes the specified file on the local system.
Example of using the XZLRM routine
CALL XZLRM('CSPACK.CARDS',IRC)
IF(IRC.NE.0) PRINT *,'Error issuing RM command'
When using the standard TELNET program to login to a remote host,
such as an IBM mainframe, from a local workstation,
the graphics capabilities of the workstation are normally lost.
TELNETG is a modified version of TELNET which overcomes this
deficiency for HIGZ applications such as PAW or GEANT in a rather
elegant manner.
Not only is the user able to display graphical output from the
remote session in a window on the local station, the mouse
may also be used to provide input. More importantly,
the HIGZ macro primitives are very compact, resulting in
a significant reduction in network traffic (and corresponding
increase in performance). Factors of 10 improvement are typical
for one dimensional histograms, rising to 100 or more for two dimensional
histograms, surfaces, LEGO plots etc.)
The only change that the user must make (apart from typing TELNETG
instead of TELNET,
is to specify the negative value of the
workstation type in the remote application. Thus, when using
TELNETG from an Apollo DN3000 to run PAW on CERNVM, the workstation
type -10002 should be used.
TAG++ is a terminal emulator that provides full-screen access
to IBM VM systems. The version included in CSPACK has been enhanced
to provide the same kind of graphics support as in TELNETG.
As with TELNETG, HIGZ applications, such as PAW, may display
graphical output in a local window and receive graphical input, e.g.
using the mouse.
On VM/CMS systems, two versions of SYSREQ exist. The first requires
a CP modification to add a new command plus a diagnose (Diagnose 140).
The second version uses IUCV and is enabled by selecting
IUCVREQ when installing the package via the PATCHY [5]
command +USE,IUCVREQ.
SYSREQ-TCP provides a remote interface to a central SYSREQ server
over TCP/IP connections.
SYSREQ-TCP is currently only used to provide remote access to the HEPVM
Tape Management System (TMS) from nodes at CERN other than CERNVM, where the
TMS currently resides. However, the mechanism of passing commands
and messages to a server that is already running is of general
use and so it is planned to release this code as a separate
component that avoids all use of SYSREQ on the IBM system.
Both command line and FORTRAN callable interfaces to SYSREQ exist.
The command line interface is shown below.
Using the SYSREQ command line interface
SYSREQ service command
e.g.
SYSREQ TMS QVOL I29021
CALL SYSREQ (SERVICE,COMMAND,IRC*,REPLY*,*LENREP*)
- SERVICE
- Character variable specifying the service required
- COMMAND
- Character variable specifying the command to pass to that service
- IRC
- Integer variable in which the return code is returned
- REPLY
- Character array of length LENREP in which the reply is returned
- LENREP
- Integer variable containing the number of elements of REPLY
on input and the number of elements of REPLY containing returned data on
output
This routine sends the specified command to the named service via the
SYSREQ mechanism.
One may also use the routine FMSREQ, which is part of the FATMEN [9]
and resides in PACKLIB. This routine as the same calling sequence as SYSREQ,
but provides automatic protection against network problems (timeouts etc.)
with retry where required.
- IRC
- Return status
- 0
- Normal completion
- 2
- Reply longer then LENREP. The COMMAND(LENREP) contains the
command to issue to get the remaining part of the reply.
Example of using the SYSREQ routineCHARACTER*240 COMMAND
CHARACTER*8 SERVICE
INTEGER IRC
INTEGER REPLEN
PARAMETER (REPLEN=100)
CHARACTER*132 TMSREP(REPLEN)
IRC = 0
SERVICE = 'TMS'
COMMAND = 'Q VID I29001 - I29010'
LCOMM = LENOCC(COMMAND)
500 CONTINUE
I = REPLEN
CALL SYSREQ(SERVICE,COMMAND(1:LCOMM),IRC,TMSREP,I)
DO 20 J=1,I-1
WRITE (6,200) TMSREP(J)
200 FORMAT(1X,A80)
20 CONTINUE
IF (IRC .EQ. 2) THEN
*
* Reply exceeded buffer length. Print command that we
* should issue to get remainder of reply
*
COMMAND = TMSREP(I)
LCOMM = LENOCC(COMMAND)
PRINT *,'Issuing ',COMMAND(1:LCOMM)
GOTO 500
ENDIF
C Print the Last Line
WRITE (6,200) TMSREP(I)
9999 CONTINUE
PRINT *,'SYSREQ(Fortran): RC(',IRC,')'
END
The ZEBRA and PAW servers (ZSERV, PAWSERV)
are all built as part of the standard
program library installation. More details can be found in the
Installation and Management section of this manual.
The following server routines are all controlled by a single
server steering routine. This routine receives messages
from the client, unpacks the messages and calls the appropriate
server routine with a standard FORTRAN call.
The remote file transfer routines behave similarly. However,
rather than just issue remote reads or writes record by
record, the individual records of the files to be transferred
are blocked to reduce the number of network operations.
This has a significant effect on the file transfer rate.
Error and informational messages from the server are sent
back to the client using the CZPUTA routine. These are processed
in a standard manner using the PATCHY sequence CZMESS.
6cmServer Routines to perform remote I/O
5cmOpen remote file
CALL SZOPEN (LUN,FILE,LRECL,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- FILE
- Character variable specifying the file name.
- LRECL
- Integer variable specifying the record length in bytes.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine opens a file on the server node.
CHOPT: 'D' - Open the file for direct access
CHOPT: 'F' - Open the file 'FORMATTED' (default=unformatted)
CHOPT: 'N' - Open the file with STATUS='NEW'
4cmClose remote file
CALL SZCLOS (LUN,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine closes a remote file previously opened by SZOPEN.
CHOPT: 'D' - Delete remote file
7cmRead record from remote file
CALL SZREAD (LUN,IBUFF,NREC,NWANT,NGOT,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- IBUFF
- Array to receive the data.
- NREC
- Integer variable specifying the record number to read
(for direct access files only).
- NWANT
- Integer variable specifying the number of bytes to read
(for files with variable length records NWANT specifies the
maximum number of bytes that can be accepted).
- NGOT
- Integer variable specifying the number of bytes read
for files with variable length records.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine reads a record from a remote file
previously opened by SZOPEN.
6cmWrite record to remote file
CALL SZRITE (LUN,IBUFF,NREC,NWRITE,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- IBUFF
- Array to containing the data to be written.
- NREC
- Integer variable specifying the record number to write
(for direct access files only).
- NWRITE
- Integer variable specifying the number of bytes to write.
for files with variable length records.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine writes a record from a remote file
previously opened by SZOPEN.
4cmRewind remote file
CALL SZREWD (LUN,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- CHOPT
- Character variable to specify the options desired.
- IRC
- Integer variable in which the return code is returned.
This routine rewinds a remote file
previously opened by SZOPEN.
6cmInquire if remote file exists
CALL SZINQR (LUN,CHOPT,IRC)
- LUN
- Integer variable specifying logical unit to be used.
- FILE
- Character variable specifying the remote file name.
- NODE
- Character variable specifying the remote node name.
- IEXIST
- Integer variable in which the remote file status is returned.
- LRECL
- Integer variable in which the record length of the
remote file status is returned.
- IRC
- Integer variable in which the return code is returned.
This routine checks whether a remote file exists or is OPENed.
5cmGeneral utility routines
3cmPrint date of generation of package
CALL SZVERS
This routine prints the PAM file title from the CSPACK
PAM file and the date and time of the PATCHY run
that generated the code.
5cmRemote directory utilities
4cmChange remote directory
CALL SZCD (PATH,IRC)
- PATH
- Character variable specifying the name of the remote directory
to be set.
- IRC
- Integer variable in which the return code is returned.
This routine changes the remote directory to that specified by
the character variable PATH. On VM systems, the remote directory
should be given in the form user.address or <user.address>
If the address is omitted, 191 is assumed.
4cmGet current remote directory
CALL SZPWD (PATH,IRC)
- PATH
- Character variable in which the current remote directory
is returned.
- IRC
- Integer variable in which the return code is returned.
This routine returns the current remote directory.
4cmIssue remote LS command
CALL SZLS (PATH,CHOPT,IRC)
- PATH
- Character variable specifying the path name for the remote
ls command. If the intention is to list the current working
directory, PATH should be set to a single blank.
- CHOPT
- Character variable specifying the required options:
If CHOPT = 'L' a 'long listing' will be returned (Unix and VM systems).
This corresponds to the Unix ls option -l and the VM LISTFILE option L.
- IRC
- Integer variable in which the return code is returned.
This routine issues a remote LS command and returns the output
to the client.
On Unix and VM/CMS systems, the .netrc DOT NETRC A0 on
VM/CMS systems) have the following format. On Unix systems these
files must reside in the home directory of the relevant user and
be correctly protected using the command
Protecting a .netrc file
chmod 0600 .netrc
Format of the .netrc filesmachine <host-name> login <user-name> password <password>
e.g.
machine cernvm login zftptest password kwerdal
On VAX/VMS systems, the file is named ftplogin.; and should again
reside in the home directory. It should be protected as follows:
Protecting an ftplogin file
SET FILE/PROTECTION=(S,W,G,O:R) FTPLOGIN.;
The format of this file is somewhat simpler, containing no keywords,
as shown in the following example.
An example of an ftplogin file
cernvnm zftptest kwerdal
vxcrna zftptest -
Note that the minus sign will cause a prompt for the password.
Next: CSPACK - Installation
Up: CSPACK
Previous: CSPACK - Tutorial