How we can access the last record from KSDS file ?

Showing Answers 1 - 1 of 1 Answers

Yogendra Shinde

  • Jun 11th, 2007
 

Move High-values to  key-field of the VSAM file this points to the last record of the KSDS file.

  Was this answer useful?  Yes

Ya, moving low-values and high-values to key,  points to the first and last records respectively.
If you want to process the records of a VSAM file sequentially, use the START command.. Point the key to the first record and then read it like a normal flat file and sequentially process it till end of file..

  Was this answer useful?  Yes

Premasai

  • Jun 12th, 2010
 

I dont think moving HIGH-VALUES will take you to the last record , as you need to access the record for which the key value is <= HIGH VALUES. And START KEY syntax does not allow you to search a key <= to any value(Only allowed operators are >, >=, =, NOT <)
So I dont think you cannot reach the last record without reading the whole file.

If anybody could get to the last record of the KSDS by passing HIGH VALUES, please past the piece of code that worked!

But yes the first record can be accessed by passing LOW-VALUES.

  Was this answer useful?  Yes

Nandhakumar

  • Nov 19th, 2018
 

Start is used to read a file dynamically (Some where in between the file), so its not needed for sequential read from end of the file. Moving High-values to Key field would absolutely work.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions