Like OS/390, the Tachyon Operating System requires that VSAM files be explicitly defined before they can be used. OS/390 provides the IDCAMS utility for this purpose. The Tachyon Operating System provides the tosvsam program to delete, define, load and list the definition of VSAM files. The Tachyon Operating System does not provide a way to define and delete VSAM files through JCL DD and EXEC PGM=IDCAMS statements.
The file containing records to be loaded into a VSAM file can be in any format supported as a sequential file format by the Tachyon Operating System. This allows a program to create a sequential file that can then be loaded into a VSAM file.
You can also download a file from the mainframe and then load it into a VSAM file. For fixed-length records or records that can be downloaded as ASCII text, you can use any normal file transfer method. The best way to download variable length records is to export them using the TSO TRANSMIT command, download the exported file (in binary), extract the file using the Tachyon Un-Xmit program and then load them into the VSAM file. To download records from a mainframe VSAM data set, you first need to REPRO the records from the VSAM data set to a sequential data set before downloading the sequential data set.
tosvsam [-dir vsam-directory] [vsam-data-set-name] [{-delete|-del}] [{-define|-def}] [-load] [{-listcat|-listc}] [-recorg {k|ksds|e|esds|r|rrds|v|vrrds}] [-ave average-record-length] [-max maximum-record-length] [-dci data-control-interval-size] [-ici index-control-interval-size] [-rkp relative-key-position] [{-keylen|-kl} key-length] [-file input-file-name] [-recfm {t|f|v|vb|u}] [-lrecl record-length]
-delete (or -del) will cause the VSAM file to be deleted. -delete can be combined with -define to cause an existing VSAM file to be redefined.
-define (or -def) will cause an empty VSAM file to be defined. The VSAM file must not already exist unless the -delete parameter is also specified. -define can be combined with any or all of the other function parameters: -delete, -load and -listcat. -define uses the information provided by the -recorg, -ave, -max, -dci, -ici, -rkp and -keylen parameters.
-load will cause an existing VSAM file to be loaded. If the VSAM file already contains records, the VSAM file will be emptied before the new records are loaded. -load can be combined with -define and -listcat. -load uses the information provided by the -file, -recfm and -lrecl parameters.
-listcat (or -listc) will cause the definition of the VSAM file to be listed. -listcat can be combined with -define and -load.
Format code t specifies that the file contains ASCII text. Each line of text will be converted to EBCDIC before it is loaded into the file. If the records are loaded into a RRDS or if the -lrecl parameter is specified, the records will be padded with blanks to the required length.
Format code f specifies that the file contains fixed length EBCDIC records. The length of each record may be specified through the -lrecl parameter.
Format code v specifies that the file contains variable length records prefixed by a standard 4-byte Record Descriptor Word (RDW). Spanned records are supported.
Format code vb specifies that the file contains blocks of variable length records prefixed by a standard 4-byte Record Descriptor Word (RDW). Each block of records must be prefixed by a standard Block Descriptor Word (BDW). Spanned records are supported.
Format code u specifies that the file contains variable length records prefixed by a 2-byte Record Descriptor Word (RDW) that does not include the length of the RDW.
This command will delete, define, load and then list the definition for a KSDS named XXX.YYY in the current directory. It will be loaded from text records from the file named records.txt with a key field in the first 8 characters. The following should be entered as a single command:
tosvsam -del -def -load -listc -dir . XXX.YYY -recorg k -ave 100 -max 200 -rkp 0 -kl 8 -dci 2048 -ici 1024 -file records.txt -recfm tOutput from the example command might look like:
TLC010I Tachyon Operating System VSAM Utility - version 2.0.00 (c) Copyright 1997-2000 Tachyon Software LLC VSAM file XXX.YYY has been deleted. VSAM file XXX.YYY has been successfully defined. VSAM file XXX.YYY successfully loaded with 1111 records from "records.txt". CLUSTER ------ XXX.YYY FILE--------XXX.YYY.CAT RECORG------KSDS DATA --------- XXX.YYY.D FILE--------XXX.YYY.D.VSM ATTRIBUTES KEYLEN-----------8 CISIZE--------2048 CI/CA--------83 RKP--------------0 MAXLRECL-------200 STATISTICS REC-TOTAL-----1111 SPLITS-CI--------0 REC-DELETED------0 SPLITS-CA--------0 REC-INSERTED-----0 FREESPACE-%CI----0 REC-UPDATED------0 FREESPACE-%CA----0 REC-READ---------0 FREESPACE----77824 VOLUME------SYSRES HI-A-RBA-----169984 HI-U-RBA------92160 END-RBA-------90112 INDEX -------- XXX.YYY.I FILE--------XXX.YYY.I.VSM ATTRIBUTES KEYLEN-----------8 CISIZE--------1024 CI/CA---------1 RKP-------------72 MAXLRECL------1008 STATISTICS REC-TOTAL--------1 SPLITS-CI--------0 INDEX: REC-DELETED------0 SPLITS-CA--------0 LEVELS--------1 REC-INSERTED-----0 FREESPACE-%CI----0 KEY/CI-------83 REC-UPDATED------0 FREESPACE-%CA----0 SEQ-SET-RBA---0 REC-READ---------0 FREESPACE--------0 TOP-RBA-------0 VOLUME------SYSRES HI-A-RBA------1024 HI-U-RBA------1024 END-RBA----------0
Defining a VSAM file will create a catalog information file in the specified directory with the name of the cluster and an extension of .CAT. Loading a VSAM file will cause one or two more files to be created. The data component file will be created with the cluster name followed by .D and an extension of .VSM. A KSDS or VRRDS will also have an index component file named with the name of the cluster followed by .I and an extension of .VSM. These file names are shown in the LISTCAT output as shown above.
Note: If you move a VSAM file from one directory or machine to another, you must move all of these files together.