Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To Find perticular record if I do not know the key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: To Find perticular record if I do not know the key
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

Site Director


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

PostPosted: Sun Apr 01, 2007 8:45 am    Post subject:
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

Site Director


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

PostPosted: Wed Apr 04, 2007 2:44 am    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Apr 04, 2007 12:35 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us