You are on page 1of 10

//---------------------------------------------------

// Program -

// Purpose - Load single page at a time

// Written - xx/xx/xx

// Author - xxxxxxxxxxxxxxxxxxxx

//

// INPUT PARAMETERS

// Description Type Size How Used

// ----------- ---- ---- --------

//

// INDICATOR USAGE

// 03 - leave

//---------------------------------------------------

fSINGLEP if e k disk

fSINGLEAD cf e workstn INFDS(INFDS)

f SFILE(SUB01:RRN1)

// Data Structures

d Infds ds
INFDS data structure
d Choice 369 369

d Currec 378 379B 0

//

// Program Info

//

d SDS

d @PGM 001 010

d @PARMS 037 039 0

d @MSGDTA 91 170

d @MSGID 171 174

d @JOB 244 253


d @USER 254 263

d @JOB# 264 269 0

//

// Variables

//

d Normal c X'20'

d Red c X'28'

d White c X'22'

d Blue c X'3A'

d Pink c X'38'

d @Scrn1 s 1

d count s 4 0

d EndScreen1 s n inz('0')

d KeyTop s 2

d KeyBottom s 2

d pagesize s 2 0 inz(10)

d RRN1 s like(SCRRN)

d Savrrn s like(SCRRN)

d ScreenError s 1 inz('N')

* Command Keys

d Cmd01 c const(x'31')
Cmd-1
d Cmd02 c const(x'32')
Cmd-2
d LeaveProgram c const(x'33')
Cmd-3
d Cmd04 c const(x'34')
Cmd-4
d Cmd05 c const(x'35')
Cmd-5
d Cmd06 c const(x'36')
Cmd-6
d Cmd07 c const(x'37')
Cmd-7
d Cmd08 c const(x'38')
Cmd-8
d Cmd09 c const(x'39')
Cmd-9
d Cmd10 c const(x'3A')
Cmd-10
d Cmd11 c const(x'3B')
Cmd-11
d Cmd12 c const(x'3C')
Cmd-12
d Cmd13 c const(x'B1')
Cmd-13
d Cmd14 c const(x'B2')
Cmd-14
d Cmd15 c const(x'B3')
Cmd-15
d Cmd16 c const(x'B4')
Cmd-16
d Cmd17 c const(x'B5')
Cmd-17
d Cmd18 c const(x'B6')
Cmd-18
d Cmd19 c const(x'B7')
Cmd-19
d Cmd20 c const(x'B8')
Cmd-20
d Cmd21 c const(x'B9')
Cmd-21
d Cmd22 c const(x'BA')
Cmd-22
d Cmd23 c const(x'BB')
Cmd-23
d Cmd24 c const(x'BC')
Cmd-24
d EnterKey c const(x'F1')

d PageDown c const(x'F5')
Roll Up
d PageUp c const(x'F4')
Roll Down

//

// Break apart the time stamp

//

//---------------------------------------------------

// C a l c u l a t i o n S p e c s

//---------------------------------------------------

/free
exsr $Screen1;

*inlr = *on;

//===========================================

// $Screen1 - Display all parts allow for

// Search.

//===========================================

begsr $Screen1;

//

reset EndScreen1;

dow EndScreen1 = *off;

write FKEY01;

exfmt SUB01CTL;

if Currec <> *Zeros;

RRN1 = Currec;

SCRRN = Currec;

endif;

reset ScreenError;

select;

// F3 pressed end the program F3 = LeaveProgram

when Choice = LeaveProgram;

EndScreen1 = *on;

when Choice = PageUp;

exsr $Clearsfl;
exsr $pageup;

when Choice = PageDown;

exsr $Clearsfl;

exsr $pagedown;

other;

if c1key = *blanks;

exsr $process;

else;

exsr $position;

endif;

endsl;

enddo;

endsr;

//===========================================

// $ClearSFL- Clear the route error sub

//===========================================

begsr $clearsfl;

*in31 = *Off;

*in32 = *Off;

*in30 = *On;

write SUB01CTL;
*in31 = *On;

*in32 = *On;

*in30 = *Off;

clear RRN1;

clear SCRRN;

clear SavRrn;

*in33 = *off;

clear count;

endsr;

//===========================================

// $PageDown = page down 10 records

//===========================================

begsr $PageDown;

if SavRrn > *Zeros;

rrn1 = savrrn;

scrrn = savrrn;

endif;

setgt (keybottom) SINGLEP;

for count = 1 to Pagesize;

read SINGLEP;

if %eof(singlep);

// subfile end indicator


*in33 = *on;

leave;

endif;

// keep track of first and last record

select;

when count = 1;

keytop = key;

when count = Pagesize;

keybottom = key;

endsl;

s1key = key;

s1desc = desc;

RRN1 +=1;

SCRRN = RRN1;

write SUB01;

savrrn = scrrn;

endfor;

//

// If no records in subfile then do not disply the subfile.

//

if SavRrn = *zeros;

*in31 = *off;

endif;

endsr;
//===========================================

// $PageUp = page up 10 records

//===========================================

begsr $PageUp;

if SavRrn > *Zeros;

rrn1 = savrrn;

scrrn = savrrn;

endif;

// read back records

setll (keytop) singlep;

for count = 1 to (pagesize)+1;

readp singlep;

if %eof(singlep);

clear keytop;

clear keybottom;

leave;

endif;

// reset the top & bottom keys

select;

when count = (pagesize+1);

keybottom = key;

endsl;

keytop = key;

endfor;

exsr $pagedown;
//

// If no records in subfile then do not disply the subfile.

//

if SavRrn = *zeros;

*in31 = *off;

endif;

endsr;

//===========================================

// $Position

//===========================================

begsr $Position;

setll (c1key) singlep;


exsr $Clearsfl;
readp singlep;
if %eof;
setll *start singlep;
clear keybottom;
else;
keybottom = key;
endif;
exsr $pagedown;

endsr;

//===========================================

// $Process - Process the subfile(1)

//===========================================
begsr $Process;

endsr;

//=================================================

// *inzsr - One time run processing

//=================================================

begsr *inzsr;

exsr $Clearsfl;

exsr $PageDown;

endsr;

/end-free

You might also like