Question related to KSDS

vsam interview questions

Moderator: Moderator Group

Post Reply
malathy
Member
Posts: 4
Joined: Tue Sep 03, 2013 5:26 pm

Question related to KSDS

Post by malathy » Tue Sep 03, 2013 5:39 pm

1) Is it possible to read a KSDS file without Key??

2) We have 100 records in a KSDS file. While reading some 51 st record some abend has occured. Again the file should not be read from beginning it should start reading from where it got abended??

By restarting, how do you get the key for 51 st record ??

Can someone help me in answering this question?
Last edited by malathy on Wed Sep 04, 2013 1:31 pm, edited 2 times in total.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Sep 03, 2013 6:42 pm

You can read a KSDS sequentially.

For number 2, what do you want to achieve by not starting from the first record?

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Wed Sep 04, 2013 12:01 am

reading some 51 st record
does this actually mean "reading the 51st record"?
not be read from beginning it should start reading from the first
What is the difference between read from the beginning, i.e. the first record, and reading from the "first" where "first" is presumably the "first record"?
Regards
Nic

malathy
Member
Posts: 4
Joined: Tue Sep 03, 2013 5:26 pm

Post by malathy » Wed Sep 04, 2013 1:24 pm

William Collins wrote:You can read a KSDS sequentially.

For number 2, what do you want to achieve by not starting from the first record?
Thanks for your Reply..Yes, I know that we can read KSDS file sequentially. But my query is whether it is possible to read KSDS file without key??

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Sep 04, 2013 9:31 pm

If you read the file sequentially, why do you need a key?
Have a good one

User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

Post by Gurugars » Thu Sep 05, 2013 5:30 pm

Malathy -

For your second query, you want to start reading X th record if the program previously abended in Xth record also you don't have any key?

If my assumption over your second query is correct - it is not possible to perform a DYNAMIC read in KSDS with-out key. if you don't pass key (assume initially the key variable is space) it will start reading the file >= space.

So it is programmer's responsibility to have some logic to hold the key value (say in table or other files) in order to do the above mentioned requirement on restart.

Hope this help.

Thanks.
Guru:-)

You're never fully dressed without a smile :)

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others