View previous topic :: View next topic |
Author |
Message |
jctgf Beginner
Joined: 05 Nov 2006 Posts: 89 Topics: 36
|
Posted: Mon Dec 11, 2006 4:28 pm Post subject: what is the best way to browse a screen? |
|
|
it's been a while since i last coded a cobol cics program
i wonder what is the best way to write a screen browsing
suppose i have already read a file and i have the lines i want to exhibit in a ws array
there are 25 lines in the ws array
my screen is a 10 line array
so, i need to pf8 the screen 2 times (1rst screen 10 lines; pf8; 2nd screen 10 lines; pf8; last screen 5 lines)
what is the best technique to transfer the lines from my ws array to my screen array?
is there a cutting-edge solution?
would it be a simple "move" from the ws to the screen "until" screen is full, every time a pf8 is issued?
could my screen array and my ws array be the same?
thanks |
|
Back to top |
|
 |
syam Beginner

Joined: 14 May 2006 Posts: 22 Topics: 7 Location: INDIA
|
Posted: Sun Dec 31, 2006 3:28 am Post subject: |
|
|
Hi jctgf
How about TSQ and paging logic, Ideally suits for this situation. Write the records into TSQ
The steps ivolved in the process are
Declaring TSQ
01 TSQ-QUEUE.
05 TSQ-QID.
10 TSQ-TRANS PIC X(04)
VALUE 'mytr'.
10 TSQ-TRMID PIC X(4).
05 TSQ-DATA.
10 TSQ-DATA-APPLICATION PIC X(55).
05 TSQ-LENGTH PIC S9(4) COMP.
05 TSQ-ITEM PIC S9(4) COMP.
05 WS-QUEUE-STATUS PIC S9(9) COMP.
and then for every record write in the que and increase TSQ-ITEM by 1
EXEC CICS WRITEQ
QUEUE(TSQ-QID)
FROM(TSQ-DATA)
LENGTH(TSQ-LENGTH)
ITEM(TSQ-ITEM)
RESP(WS-QUEUE-STATUS)
END-EXEC
IF WS-QUEUE-STATUS = DFHRESP(NORMAL)
continue
ELSE
blub blub blub
END-IF
then read the que one element by element and load on the screen until first page( first 10 records are filled)
EXEC CICS READQ
QUEUE(TSQ-QID)
INTO(TSQ-DATA)
LENGTH(TSQ-LENGTH)
ITEM(TSQ-ITEM)
RESP(WS-QUEUE-STATUS)
END-EXEC
EVALUATE WS-QUEUE-STATUS
WHEN DFHRESP(NORMAL)
ADD +1 TO TSQ-ITEM
WHEN DFHRESP(ITEMERR)
SET STOP-READING-QUEUE TO TRUE
--------
now when PF8 PRSSED change the TSQ-ITEM to 11 and read the queue for 10 times and throw each record to screen
Hope this helps. _________________ S Y A M
ONE CAN SMILE AND SMILE AND BE A VILLIAN |
|
Back to top |
|
 |
|
|