IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To Find perticular record if I do not know the key


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rdr

New User


Joined: 26 May 2006
Posts: 35
Location: india

PostPosted: Sun Apr 01, 2007 8:20 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Apr 01, 2007 8:45 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 04, 2007 2:44 am
Reply with quote

Hello Rohit,

Is this solved or is there still a question?
Back to top
View user's profile Send private message
devidas-patil

New User


Joined: 08 Jan 2007
Posts: 54
Location: pune

PostPosted: Wed Apr 04, 2007 10:08 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Apr 04, 2007 12:35 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top