|
You can also code the SFLRCDNBR keyword in your subfile then position to
the record. I like this because the user can still page up and down
through the whole subfile. Sometimes users don't understand when the
subfile starts somewhere in the middle and they press 'page-up' and
receive a message saying they're at the top of the subfile. Here's a very
abbreviated sample of the coding:
In the display-file DDS, code the following keyword on the record (before
any fields are defined):
A SFLRCDNBR 4S 0H SFLRCDNBR(CURSOR)
In your program, read sequentially through the subfile and compare the
position-to value:
. . .
. . .
. . .
perform Scan-subfile
varying SFLRRN from 1 by 1
until SFLRRN > Save-max-rrn
. . .
. . .
. . .
Scan-subfile.
read subfile Display-file
into List-detail
format 'DETAIL'
invalid key
continue
end-read
if Lastname of List-detail >= Save-lastname
or SFLRRN = Save-max-rrn
move SFLRRN to SFLRCDNBR
move Save-max-rrn to SFLRRN
end-if
Original message:
------------------------------
date: Fri, 7 Apr 2006 12:28:19 +0800
from: "Bhat, Chandra" <Chandra.Bhat@xxxxxxxxxxxx>
subject: [COBOL400-L] How to view data in alphabetical order in a
subfile
Folks,
In the below subfile, The records are displayed in the alphabetical order.
Now, what I want to know is how can I view records from a particular
customer name starting with alphabet say 'P' if when I enter P or PXXXXX
in
the 'Position' to field?
Position to
.
. . . .
Type options, press Enter.
2=Edit 3=Add 4=Delete
Cust.Name City A/c No
A1 MUMBAI 10001
A2 DELHI 10002
B1 HYDERABAD 20001
B2 KOLKATA 20002
C1 PUNE 30001
C2 CHENNAI 30002
D1 BANGALORE 40001
D2 NAGPUR 40002
- -
- -
Rgds
. . .
. . .
. . .
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.