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 OS/390.
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:
ASSOCIATE FILEID=FILEA SYSNAME=E:\MYFILES\FILEA.BTR FILETYPE=BTRIEVE
This is a required parameter.
This is a required parameter.
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.
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.
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'.