Record limits are frequently used when developing report requests to verify the results and/or design and also to speed retrieval time and reduce CPU costs. You can limit the records retrieved for your report requests by using either one of the methods below.
This method retrieves the specified number of records that meet your selection criteria. When the stated limit is found, record retrieval is stopped, so the cost is minimized. It is most useful if you are developing a new report request, but can also be used if you happen to know the number of records that meet your test criteria. The syntax is:
WHERE RECORDLIMIT EQ n
Where 'n' is a number greater than 0, and indicates the number of records to be retrieved.
For example, if you want to check the report layout of the report request below, the retrieval would stop when the 100th record is retrieved.
TABLE FILE AC
IF RECORDLIMIT EQ 100
This method retrieves all records relative to the SSN range supplied. It is most useful when you want to ensure you get all records through a particular SSN, but need only a sample of records. This is also the preferred method of limiting records when testing MATCH requests.
WHERE XX:SSA LE n
Where 'n' is a social security number (e.g, 005-00-0000), and indicates the highest SSN to be retrieved.
For example, if you are testing a match request between the Active Current Status (AC) and Leave Accounting Summary (LX) files, you could limit the range of SSNs retrieved to ensure you are comparing the same employee population in each file.
MATCH FILE AC
sum ac:fte ac:salary
by ac:ssa as 'ssa'
IF ac:ssa le 100-00-0000
by lx:ssa as 'ssa'
IF lx:ssa le 100-00-0000
after match hold as permrpt old-and-new
Last Updated: June 6, 2005