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
 

 

How to read KSDS file from bottom

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
yasho_bala

New User


Joined: 26 Jul 2012
Posts: 4
Location: india

PostPosted: Thu Jul 26, 2012 12:57 pm    Post subject: How to read KSDS file from bottom
Reply with quote

How to read KSDS file from bottom,
i dunno key also, in that case how it is possible
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2436
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 26, 2012 1:08 pm    Post subject:
Reply with quote

Mainframe Skills: jcl,cobol,vsam ?????????????????
Back to top
View user's profile Send private message
yasho_bala

New User


Joined: 26 Jul 2012
Posts: 4
Location: india

PostPosted: Thu Jul 26, 2012 1:09 pm    Post subject:
Reply with quote

im jus learner...
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2436
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 26, 2012 1:34 pm    Post subject:
Reply with quote

This site is for starters :

http://ibmmainframeforum.com/
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8132
Location: East Dubuque, Illinois, USA

PostPosted: Thu Jul 26, 2012 2:37 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 26, 2012 2:49 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 26, 2012 2:53 pm    Post subject:
Reply with quote

On a second thought, is it an interview question?
Back to top
View user's profile Send private message
yasho_bala

New User


Joined: 26 Jul 2012
Posts: 4
Location: india

PostPosted: Thu Jul 26, 2012 5:40 pm    Post subject:
Reply with quote

yes, it is an interview question
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10292
Location: italy

PostPosted: Thu Jul 26, 2012 6:04 pm    Post subject: Reply to: How to read KSDS file from bottom
Reply with quote

moved as per previous post icon_cool.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 26, 2012 6:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm


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