Using variables ZTDSCRP and ZTDSRID
When ZTDSCRP contains a value other than 0, that value is the number of the table row that is to be at the top of the panel's scrollable area when the panel is redisplayed. ISPF sets ZTDSCRP to a nonzero value if a user has requested a downward scroll such that, when ISPF redisplays the panel following the scroll, the top row displayed in the scrollable area existed in the table at the time of the scroll request.
When the user requests an UP MAX or DOWN MAX, ISPF does not require the ZTDSCRP value to position the table when it is redisplayed following the scroll. It simply positions the table in the scrollable display area relative to the top table row (UP MAX) or the bottom-of-data marker (DOWN MAX).
For other scroll requests that require that rows be added to the table, ISPF may not be able to determine what the value of ZTDSCRP should be. In other words, one of the table rows to be added by the function will be the new top row displayed. ISPF has no way of knowing what the number of that row will be. In those cases, ISPF returns a value of 0 to the function.
UP 10
but there are only eight table rows
above the top one currently displayed. ISPF returns control to the
function with variable ZTDAMT having a value of 2, indicating that
two lines must be added to the table to satisfy the current scroll
request. ISPF has set variable ZTDSCRP to 0 because the new top displayed
row did not exist in the table when the scroll was requested. Assume
that, instead of adding only the two required table rows at the top
of the table to satisfy this scroll request, the function adds 20
rows as a cushion against additional scrolling. Therefore, the function
must set ZTDSCRP to 19 so that ISPF will redisplay the panel with
the table positioned as the user wants it.In addition to the row pointer in variable ZTDSCRP, ISPF returns to the function in variable ZTDSRID the identification (rowid) of the row that is to be displayed at the top of the scrollable area. As just described for ZTDSCRP, if ISPF cannot determine which is to be the top row displayed, it returns a value of 0 in ZTDSRID.