You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

&<img src="../resources/images/opentocr.png" title="Open Contents list" border="0"&>
You are here:

4.3.8.1 Initial Example

A simple RDML program to list off the transactions file and also show full transaction and state descriptions fields might be coded like this:
GROUP_BY   NAME(#TRANS) FIELDS(#TRANNUM #TRANDATE #TRANTIME
           #TRANTYPE #TRANDESC #TRANUSER #TRANSTATE #STATDESC)
 
SELECT     FIELDS(#TRANS) FROM_FILE(TRANS)
FETCH      FIELDS(#TRANS) FROM_FILE(STATES) 
           WITH_KEY(#TRANSTATE)
FETCH      FIELDS(#TRANS) FROM_FILE(TRNTYP) 
           WITH_KEY(#TRANTYPE)
UPRINT     FIELDS(#TRANS)
ENDSELECT
 
If file TRANS contained 10,000 records this RDML program would do (10,000 + 10,000 + 10,000) = 30,000 database accesses.
However, by using a working list, or the KEEP_LAST parameter on the FETCH commands, the speed of this program can be improved considerably.
&<img src="../resources/images/opentoc-dark.png" title="Open Contents List" border="0"&>

  • No labels