​​

Using Record Limits

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.

Limit By Number Of Records

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.

 

EX AC

TABLE FILE AC

COUNT AC:POSITION

ACROSS AC:ETHNICGRP

IF RECORDLIMIT EQ 100

END

Limit By Social Security Number

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.  

 

EX AC

EX LX

MATCH FILE AC

SUM AC:FTE AC:SALARY

BY AC:SSA AS 'SSA'

IF AC:SSA LE 100-00-0000

RUN

FILE LX

MATCH FILE

SUM LB:LB

BY LX:SSA AS 'SSA'

BY LX:LT

IF LX:SSA LE 100-00-0000

AFTER MATCH HOLD AS PERMRPT OLD-AND-NEW

END

​ 

Last Updated: February 27, 2024