Guest_imported
New member
- Jan 1, 1970
- 0
I want a already sorted file to load into a table (of 300 records or so)that I can tell it to display 20 records at a time on the screen and then if there are more than 20 records to continue and display the next 20 records and so on. I do need help, I have never done this before.
select sort-name-file
assign to disk
????
???
I created my fd
FD in the file section
fd sort-name-file
01 name-rec
03 lastname-1 pic x(30).
03 firstname-1 pic x(10).
03 lastname-2 pic x(30).
03 firstname-2 pic x(10).
03 ssn pic 9(09).
in working storage
01 sort-idx pic 9(03).
01 table-name-sort records occurs 300
indexed by sort-index
03 table-lastname-1 pic x(30)
03 lastname-1 pic x(30).
03 firstname-1 pic x(10).
03 lastname-2 pic x(30).
03 firstname-2 pic x(10).
03 ssn pic 9(09).
procedure division
set sort-index to 1.
perform display sort-fields
varying 1 by 1
until sort-idx = 20.
read input-file into table-name-sort
at end
display table-name-sort.
move firstname-1 to table-firstname-1.
lastname-1 to table-lastname-1.
firstname-2 to table-firstname-2.
lastname-2 to table-lastname-2.
ssn to table-ssn.
I am confused with the microfocus books and I am not sure what else needs to be done????
select sort-name-file
assign to disk
????
???
I created my fd
FD in the file section
fd sort-name-file
01 name-rec
03 lastname-1 pic x(30).
03 firstname-1 pic x(10).
03 lastname-2 pic x(30).
03 firstname-2 pic x(10).
03 ssn pic 9(09).
in working storage
01 sort-idx pic 9(03).
01 table-name-sort records occurs 300
indexed by sort-index
03 table-lastname-1 pic x(30)
03 lastname-1 pic x(30).
03 firstname-1 pic x(10).
03 lastname-2 pic x(30).
03 firstname-2 pic x(10).
03 ssn pic 9(09).
procedure division
set sort-index to 1.
perform display sort-fields
varying 1 by 1
until sort-idx = 20.
read input-file into table-name-sort
at end
display table-name-sort.
move firstname-1 to table-firstname-1.
lastname-1 to table-lastname-1.
firstname-2 to table-firstname-2.
lastname-2 to table-lastname-2.
ssn to table-ssn.
I am confused with the microfocus books and I am not sure what else needs to be done????