View previous topic :: View next topic
|
Author |
Message |
rdr
New User
Joined: 26 May 2006 Posts: 35 Location: india
|
|
|
|
Hi All,
Can any one tell me how to access out last but one record when I do not know the key in a KSDS file.
Regards,
Rohit. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please explain this
Quote: |
how to access out last but one record when I do not know the key |
including a little sample data and what "result" you want from the process you are asking about.
Let's say your file has 5 records in it. Show 5 sample records and the "output" you want. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Rohit,
Is this solved or is there still a question? |
|
Back to top |
|
|
devidas-patil
New User
Joined: 08 Jan 2007 Posts: 54 Location: pune
|
|
|
|
Hi
if you want to find out the last record if you dont know the jey then read the KSDS sequentially giving at end condition.
LIKE
PERFORM READ-PARA UNTILL END(give some condition)
READ FILENAME AT END DISPLAY YOURRECORD
this will give you the last record.
let me know if any problme with above regards |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
devidas-patil
The requirement was for the last but one record, not the last record.
As for reading the whole file, errrrrrrrrrrrr, what if it has 3 million records in, how much resource would that use up ?
Another point is if the KSDS has been primed by key, which a lot of sites do, which is when a KSDS is defined for the first time, two records are inserted, one with '00'X as the key and one with 'FF'X. This was used to stop read errors on an empty KSDS. SO if the KSDS has been primed, does he want the last valid record, or the last but one valid record ?
What about keyed-sequential access ? |
|
Back to top |
|
|
|