Server Guide
You must create a resource association file to make the workstation aware
of the files you will be accessing from Smalltalk; it contains
information about the files you will be using. The resource association
file will not be needed when you run your applications on MVS.
The syntax of the resource association file is as follows:
ASSOCIATE FILEID=fileid
SYSNAME={path | fully qualified path}
FILETYPE={BTRIEVE | PDS | SEQ}
[VSAMTYPE={KSDS | ESDS | RRDS}]
[RECFM={FB | F | VB | V | U}]
[LRECL=length]
[KEYNUMBER=index]
- Note:
- The parameters must be specified on the same line in the resource association
file. There is no specific order to the parameters; they can be
specified in any order. The braces ( { } ) in the above
syntax indicate that one of the enclosed options is required. That is,
if you specify VSAMTYPE, you must specify KSDS, ESDS, or
RRDS. The brackets ( [ ] ) indicate that the parameter is
optional. That is, you are not required to specify that
parameter.
The ASSOCIATE keyword indicates that the information that follows should be
associated with a specific file descriptor. The parameters for the
ASSOCIATE keyword follow:
- FILEID=fileid
- Indicates the file descriptor (maximum eight characters) of the file being
used in an MVS Native Smalltalk application. For programmers familiar
with MVS terminology, this is similar to a DD name. When your program
opens a file, it will refer to this file descriptor to access the correct
file. This is a required parameter.
- SYSNAME={path | fully qualified path}
- Indicates the path to the file on your workstation. For a file with
a file type of PDS, you must specify the path to the PDS member. The
actual member will be specified when you perform the open. For a file
with a file type of either BTRIEVE or SEQ, you must specify the fully
qualified path. For example, if FILEA is a BTRIEVE file, residing on
disk e: in directory myfiles, you would specify SYSNAME as
follows:
ASSOCIATE FILEID=FILEA SYSNAME=E:\MYFILES\FILEA.BTR FILETYPE=BTRIEVE
This is a required parameter.
- FILETYPE={BTRIEVE | PDS | SEQ}
- Indicates the filetype of the specified file.
- BTRIEVE
- Indicates a VSAM file for disk format. Generally, Btrieve files
have a file extension of .btr. The SYSNAME for
Btrieve files must be a fully qualified path.
- PDS
- Indicates a BPAM, partitioned data set (PDS) member for disk
format. The SYSNAME for PDS members must be the path to the
file.
- SEQ
- Indicates a QSAM, sequential file for disk format. You can provide
a file extension for sequential files, but it is not required. The
SYSNAME for SEQ files must be a fully qualified path.
This is a required parameter.
- [VSAMTYPE={KSDS | ESDS | RRDS}]
- Indicates the type of VSAM file. This parameter is valid when the
filetype is BTRIEVE; if the filetype is either PDS or SEQ, the VSAMTYPE
parameter is ignored. If you do not specify a value for VSAMTYPE and
the filetype is BTRIEVE, KSDS is the default.
- [RECFM={F | FB | V | VB | U}]
- Indicates the record format of the records in the specified file.
This parameter is valid when the filetype is either SEQ or PDS; if the
filetype is BTRIEVE, the RECFM parameter is ignored. A record format of
F or FB indicates that your program is accessing records that have a fixed
length. A record format of V, VB, or U indicates that your program is
accessing records that have a variable length.
If you do not specify a value for RECFM and your program is accessing a PDS
member or a sequential file, the records are assumed to be fixed.
- [LRECL=length]
- Indicates the length of the records in the specified file. This
parameter is valid when the filetype is either SEQ or PDS or when the filetype
is BTRIEVE and the file contains variable length records; if the filetype
is BTRIEVE and the file contains fixed length records, you do not need to
specify the LRECL parameter. If you do specify the LRECL parameter for
a fixed length BTRIEVE file, ensure that the value is identical to the value
with which the file was created.
If the RECFM is specified as either F or FB, specify the LRECL as the
length of each record. For example, if the file your program will
access contains fixed records, each 80 bytes in length, you would
specify:
... RECFM=F LRECL=80 ...
If the RECFM is specified as either V or VB, specify the LRECL as the
maximum length for any of the variable records included in the file.
For example, if the file your program will access contains variable records,
and the maximum length of any one record in the file is 255 bytes, you would
specify:
... RECFM=V LRECL=255 ...
If you do not specify a value for LRECL and your program is accessing a PDS
member, a sequential file, or a variable BTRIEVE file, the LRECL defaults to
80.
- [KEYNUMBER=index]
- Indicates the indexed key to be used for the specified file. This
parameter is valid for a BTRIEVE keyed sequential (KSDS) file or a BTRIEVE
ESDS file. If the KEYNUMBER parameter is specified for a file other
than a BTRIEVE KSDS or ESDS file, it is ignored. The default KEYNUMBER
is 0, which is the primary key. To access an alternate key, specify the
number of the key you want to use. For example, to use the alternate
key numbered three for file file1.btr, you would specify on
a single line:
ASSOCIATE FILEID=FILE1 SYSNAME=E:\MYFILES\FILE1.BTR FILETYPE=BTRIEVE KEYNUMBER=3
The following example shows a sample resource association file (note that
each specification must be on a single line):
ASSOCIATE FILEID=FILEA SYSNAME=E:\U\MYFILES\FILEA.BTR FILETYPE=BTRIEVE KEYNUMBER=3
ASSOCIATE FILEID=FILEB SYSNAME=\ABT\FILEB.BTR FILETYPE=BTRIEVE VSAMTYPE=ESDS
ASSOCIATE FILEID=PDSFILE SYSNAME=D:\MYFILES\PDS FILETYPE=PDS RECFM=F LRECL=80
ASSOCIATE FILEID=SEQFILE SYSNAME=D:\MYFILES\SEQ\SEQFILE FILETYPE=SEQ RECFM=V LRECL=255
Notice that for the specification of FILEB, there is no drive
specified in the SYSNAME parameter. This assumes that the drive from
which you are running Smalltalk and the drive in which you have the
FILEB file is identical. Given the above resource
association file, your Smalltalk code can access the associated files by
specifying the correct file descriptor. For example, to open
FILEA, which resides on disk e: in the directory structure
\u\myfiles, you would enter:
| file |
file := SrvVsamFileDescriptor open: 'FILEA' mode: 'READ'.
To open a PDS member named mypds, which resides in directory
myfiles\pds on disk d:, you would enter:
| file |
file := SrvBasicFileDescriptor open: 'PDSFILE' member: 'MYPDS' mode: 'READ'.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]