All links used to access summary records must be elements of arrayThe additional restriction is included for a possible future extension: overflowing summary records to disk. For this RAA needs to know what summary records are currently being accessed and it can do this by inspecting this array. The arraylraa_subp_summdeclared inraa_com_subp.inc.
lraa_subp_summ is not
used by RAA; while a subprocessor has control it is free to use any or all of
them.
Access to the summary records is via the utility RAA_SUMM_GET whose
calling sequence is:-
subroutine raa_summ_get( id, l_summ )
id in Required id. One of the following:-
KRAA_FIRST First record
KRAA_LAST Last record
KRAA_PREVIOUS The record before l_summ
KRAA_NEXT The record after l_summ
n (>0) Record with id n.
l_summ in Current record (only used for PREVIOUS and NEXT).
out Required record or =0 if none.
The following code fragment loops over all summary records backwards and
prints each header to unit IQPRNT using RAA_SUMM_PRINT.
include 'raa_com_subp.inc'
include 'zunit.inc'
integer l_summ
equivalence (lraa_subp_summ(1), l_summ)
...
call raa_summ_get( KRAA_LAST, l_summ )
do while ( l_summ .ne. 0 )
call raa_sum_print( iqprnt, l_summ )
call raa_summ( KRAA_PREVIOUS, l_summ )
enddo
The header words of a summary record can be accessed using the
mnemonics as described above but, as has been explained, the remainder of the
record is dynamic; its content is dictated by the RAAR 1 bank. It is safest
not to hardwire word addresses into code but instead determine them at
execution time using the routine KRAA_SUMM_WORD_ADDRESS which will
return the bank address corresponding to the name provided in the RAAR 1 bank.
For example, suppose the RAAR 1 bank has the entry:-
' num_pmt float_equals EV+$KEV_NPM; 'then, to access it:-
integer knum_pmt, num_pmt, raa_summ_word_addr
knum_pmt = call raa_word_addr( 'NUM_PMT' )
if ( knum_pmt .eq. 0 ) then
print *, 'Summary records do not have NUM_PMT!'
else
num_pmt = rq(l_summ + knum_pmt)
endif
Note that, unlike the header, but like all normal n-tuples, words are floating
point and must be accessed via RQ even if they were originally integer.