This article is intended to help you determine the most efficient number of BINS and VBINS to specify for a given Ramis activity.
Release: 7.4
CA Ramis
CA Ramis Reporter
First, let's review the basics. CA Ramis uses data areas called bins both as I/O buffers and as work areas for database and external file access. Blocks containing the data description as well as blocks containing the actual data are held in the bins. The selected data is assembled and prepared for sorting in the bins, and sorted records are processed for printing or extracting in the bins as well. When a reporting request references a field that is contained in an associated file, the blocks of that associated file are held in a special set of bins known as virtual bins or VBINS.
Each bin is 8K in size, and there are 5 bins automatically defined for every Ramis session or job. These are referred to as the static BINS, because they reside within the root module of the Ramis program. Additional bins may be defined by issuing the SET BINS= command. These are referred to as dynamic BINS, because they are acquired from available free memory at the time they are requested.
When a retrieval activity references one or more fields in an associated file, the blocks belonging to the associated file are read into the virtual bins for processing. To minimize the number of times that a given block must be read or reread, the number of virtual bins should be set to the number of database blocks in the associated file (as determined by the RAMBLOCKS utility), so that the entire associated file may reside in memory at once. For example, if an associated file occupies 12 blocks in the database, issuing the command SET VBINS=12 prior to the retrieval activity will allocate the necessary virtual bins to keep the entire associated file in memory, thus optimizing the retrieval process for data from the associated file.
Since both the dynamic bins and the virtual bins are acquired from the available free memory, you must attempt to balance the benefit of additional bins against the need for free memory for other aspects of the Ramis activity. For example, free memory is required to run either SBX or Executive procedures, for processing temporary fields using the DEFINE component, for selection of records by any method, the creation of the report or extract file, and for other product functions too numerous to list here.
To determine the maximum number of bins which can be allocated to a specific session or job, issue the command SET BINS=2000. Ramis will respond with the following message:
DM0305: BINS requested = 2000, BINS allocated = nnn
where nnn is the actual number of bins that were allocated. This will tell you the maximum number of bins that can be allocated to your session or job, based on the region or partition size. Take the number of allocated bins, subtract the number of virtual bins (VBINS) that you previously determined you would need from the allocated bins and divide the result by 2. This will give you an even balance between dynamic bins and free memory. Reset the dynamic bins by issuing the SET BINS= command with the newly calculated value, and allocate the virtual bins by issuing the SET VBINS= command. Use the run statistics provided by the ? STAT command to measure the resources used by a retrieval activity. By changing the number of dynamic bins and reviewing the resulting statistics, you will arrive at the value that is most efficient for a given Ramis activity.
For more information about bins and statistics, refer to the publications, System Building Executive (SBX) and Utilities via the CA Ramis Version 7.4 set of documentation can be found at CA Ramis Bookshelves and PDFs.