View previous topic :: View next topic
|
Author |
Message |
yasho_bala
New User
Joined: 26 Jul 2012 Posts: 4 Location: india
|
|
|
|
How to read KSDS file from bottom,
i dunno key also, in that case how it is possible |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Mainframe Skills: jcl,cobol,vsam ????????????????? |
|
Back to top |
|
|
yasho_bala
New User
Joined: 26 Jul 2012 Posts: 4 Location: india
|
|
|
|
im jus learner... |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Terminology is critical in IT, where similar terms may mean very different things. A file does not have a "bottom", much less a "top". Assuming you meant that you need to read the file from the last record forward, there are two possible answers: if you are using CICS, you can -- possibly (if the file has a HIGH-VALUES key ending record) -- set the key to HIGH-VALUES, do EXEC CICS START, then do EXEC CICS READPREV twice to get the last record and repeat the EXEC CICS READPREV as needed; if you are using batch, then the answer is that it is not possible to read a VSAM file backwards in batch, period. CICS and batch use different methods to access the data, so batch does not support reading the file backwards.
If you don't know the key starting position and length, you will need to use IBM utility IDCAMS to generate a LISTCAT ENT(<filename>) ALL in order to get this required information. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
May be somewhat brutal method but with the kind of info we've in hand -- use some intermediate step(s) to copy the file in "reverse order" and work with this intermediate file.
Or load the data into a COBOL table, then process the data out from the table in reverse order. Well, this a concept - can this be implemented, well, it depends. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
On a second thought, is it an interview question? |
|
Back to top |
|
|
yasho_bala
New User
Joined: 26 Jul 2012 Posts: 4 Location: india
|
|
|
|
yes, it is an interview question |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
moved as per previous post |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
yasho_bala wrote: |
yes, it is an interview question |
There is a separate section for "Interview Questions" - if you've an interview question, please post it in that section going forward. It helps others to answer your question in a legitimate way. For example, some interview questions are just conceptual and those concepts might not be applied in practical scenarios. Having said that, I believe you've enough answers for your question. If you've more obsevations, post us back.
Please notice your question has been moved to "Interview Questions" part of the Forum. |
|
Back to top |
|
|
Kumar Srijan
New User
Joined: 22 Dec 2024 Posts: 1 Location: India
|
|
|
|
Can someone Post the code and explain it. Thanks |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1341 Location: Bamberg, Germany
|
|
|
|
Open a new topic, do not resurrect older posts. |
|
Back to top |
|
|
|