.PAPER SIZE 54,60 .RIGHT MARGIN 60 .NO NUMBER .TITLE RMS Utilities for non-RMS users # .BLANK 4 .CENTER;RMS Utilities for non-RMS users .BLANK 4 .CENTER;- DA120B - .BLANK 4 .CENTER;Thomas R. Wyant, III .CENTER;E. I. DuPont de Nemours .CENTER;Richmond, Virginia .BLANK 4 .CENTER;December 11, 1991 .BLANK 4 .LEFT MARGIN +10;.RIGHT MARGIN -10 .CENTER;Abstract .BLANK The purpose of this paper is to provide a summary of the Record Management Services utilities provided with RSX. Emphasis will be placed on examples of their use in a non-RMS environment. .RIGHT MARGIN +10;.LEFT MARGIN -10 .PAGE .AUTOPARAGRAPH .HEADER LEVEL 1 A review of the RMS utilities The Record Management Services utilities are a group of tasks distributed with RSX that allow the user to create, load, and display files. A brief review of these will be presented. .HEADER LEVEL 2 RMSDES RMSDES is a general-purpose, interactive file design utility. It can create an empty file from a pre-existing data file, a file design script, or from scratch. If a script or a pre-existing data file is used as input, the user can modify the characteristics of the created file. In short, the user has full control over the file organization, record type, carriage control, placement, protection, initial space allocation, and more. .HEADER LEVEL 2 RMSCNV RMSCNV takes its name from its ability to convert files from one type to another. Its ability to actually create files is limited, but given an empty file created by RMSDES, it can load it from pretty much any other file, regardless of organization or record attributes. RMSCNV has less index tree optimization than RMSIFL, but can be used to add records to an existing file. .HEADER LEVEL 2 RMSIFL RMSIFL is specially designed for loading indexed files for optimal performance. Unlike RMSCNV, it requires the output file to be initially empty; but it preserves fill counts and area assignments. .HEADER LEVEL 2 RMSDSP This is a file attribute display utility, and is the translation of the DCL command .BLANK;.INDENT +5 DIRECTORY/ATTRIBUTES .BLANK It displays most file attributes for all file types supported by RMS; when used on a sequential file, it provides all information supplied by .BLANK;.INDENT +5 DMP TI:=file/HD/BL:0:0 .BLANK except the retrieval pointers and (strangely) the end-of-file position. And unlike DMP, it will handle wildcard file specifications. .HEADER LEVEL 1 Sample applications This section presents a sample of practical uses of the RMS utilities. Most of these are appropriate to any application environment, regardless of whether FCS or RMS was used to create the files being manipulated. .HEADER LEVEL 2 Changing the record size of a file Our location has several applications built around sequential files with fixed length records, which are read using direct access I/O. These are typically designed with some freeboard in the records, but in the course of time, the entire record becomes used. And then, of course, someone wants to add just one more data item. Assuming the code is well built, changing it is no problem, and the RMS utilities offer a quick way to expand the file records; .LIST .LE;Use RMSDES to create an empty file with larger records; this could be as simple as: .LEFT MARGIN +5;.NOFILL _>RUN $RMSDES DES: GET yourfile DAT DES: SET RECORD SIZE newsize DES: CREATE .LEFT MARGIN -5;.FILL .LE;Use RMSCNV to copy the old file into the new file; the /AP switch should be used to force the old file to be appended to the new file (which was created empty), and the /PD: switch should be used to pad the records with the desired character (usually, null: /PD:0). .END LIST As a variant on this, you can shorten the records in a file by using the /TR switch instead of the /PD switch in RMSCNV to truncate the records; or, the /TR and /PD switches can be used together when converting a file with variable length records to one with fixed length records. .HEADER LEVEL 2 Sorting a file Sorting is generally available in RSX only with layered products: SORT-11 or DATATRIEVE. However, the need to sort an arbitrary sequential file may arise, with none of these products available. The RMS utilities can be used to create an indexed file (indexed on the desired fields), load it, then convert it back to a sequential file. A segmented key can be used to set up a sort on discontiguous fields in the record. Decending sorts are not available, and the record must contain the whole primary key. The procedure for doing this has four steps: .LIST .LE;Use RMSDES to create an empty indexed file, whose primary key includes the field(s) you wish to sort on; the easiest way to cover all the bases is to issue the command SET ALL, and let RMSDES prompt you for the information it needs; be sure to specify organization INDEXED, and to define the primary key to cover the area you want; .LE;Use RMSCNV or RMSIFL to load the indexed file; .LE;Use RMSDES or PIP to create an empty sequential file with the same attributes as your original sequential file; .LE;Use RMSCNV to unload the indexed file into the sequential file; the default is to read the indexed file in primary key order. .END LIST .HEADER LEVEL 2 TYPEing an indexed file Assuming the file contains ASCII data, there is no reason why it shouldn't be TYPEd; However, PIP will balk because it doesn't know how to extract the records from the file. Instead, one could use the RMSCNV command .BLANK;.INDENT 5 CNV>TI:=inputfile .BLANK If the file has more than one key, you can type it in order by any key of reference using the /KR:n switch. .HEADER LEVEL 2 Changing the implied carriage control of a file Every so often, you have to deal with a file whose implied carriage control as given in the file header is just not appropriate to its internal organization or its intended use; for instance: .LIST 'o' .LE;MAILed files written with some carriage control other than "LIST"; .LE;Card-image or other "list"-type files written by FORTRAN with the default CARRIAGECONTROL attribute (which is FORTRAN); .LE;Files created by EDT that should not have "LIST" carriage control, for example: .LIST "-" .LE;"Movies" or other screen control files that should have no implied carriage control at all; .LE;Constant report headers and other files that should have "FORTRAN" carriage control. .END LIST .END LIST No data transformation is needed in these cases, you just need to get the file header to match the contents of the file. All you need to do to fix these things up is: .LIST .LE;Use RMSDES to create a file with the desired attributes; .LE;Use PIP or RMSCNV to append the original file to the new file; both RMSCNV and PIP will complain about the attributes mismatch, but will do what you want anyway. .END LIST .HEADER LEVEL 2 Reading stream files ANSI magtape is the closest thing the data processing business has to a universal medium - but even it doesn't solve all problems. For one thing, many operating systems, including RT-11, record textual data as stream files, terminating each record with an explicit carriage return, linefeed, or both. Heretofore, reading these files has always required custom code or some fairly slick TECO macros. However RMS supports STREAM as a record attribute for sequential files; this puts a solution in hand using only standard DEC tools: RMSCNV and RMSDES. Because RMSCNV thinks RT-11 stream files have variable length records rather than stream records, the first step is to pull the data off tape into a file with the STREAM record format. This step breaks down into two parts: .LIST .LE;Use RMSDES to create an empty sequential file with STREAM records; this example will assume the file is named TEMPLATE.TMP, though you could call it anything; .LE;Use RMSCNV to copy the file from tape to disk, using the /CA:TEMPLATE.TMP to cause RMSDES to create a sequential stream file as output, and the /IM switch to force a block mode copy from tape; for this example, assume this file is called STREAM.TMP. .END LIST Now, you have on disk a file whose RMS attributes match its internal structure: a sequential file with stream records. To convert this to a standard file is another two part process: .LIST .LE;Using RMSDES or PIP, create an empty sequential file with variable length records, with the desired name; .LE;Using RMSCNV (with the /AP switch), append STREAM.TMP to the file you just created. .END LIST .HEADER LEVEL 2 Disk tuning Some applications use a few files intensively, and the rest of the disk just occasionally. You may be able to tweak throughput by placing the heavily used files together on the disk. The quick and dirty way to do this is to use RMSDES to allocate space for new copies of all your files near a specified logical block, and then use RMSCNV or PIP to load the new files. The purist would initialize a fresh disk, allocate the space in the middle, and then load the rest of the application onto the disk. In either case, the creation of the new files is the same: .LIST .LE;Decide where you are going to put your files; you need to specify a logical block number to RMSDES, and you will do yourself little good unless this logical block is in an empty area of your disk that is big enough to hold your data; .LE;Run RMSDES to create and allocate space to each of your files; if you are using "SET ALL" to build your file description, specify "YES" to the question "File Placement:" in the SYSTEM section of the dialog; otherwise, you will not get a chance to specify placement at all for a sequential file; I find the documentation and help text misleading on this point; .LE;Use RMSCNV or PIP to load the files. .END LIST Note that BRU will not respect the file placement you have requested through RMSDES. You may be able to fake it by placing the files in a directory of their own, (and possibly naming it so SRD will place it at the beginning of 000000.DIR), but you should probably have a rebuild procedure to copy or restore your disk. .HEADER LEVEL 1 Bibliography .LIST "o" .LE;RSX-11M-PLUS Utilities Manual .LE;RSX-11M/M-PLUS RMS-11 Utilities .END LIST