Page 1 of 1

how to access a ksds file randomly....

PostPosted: Sun Jul 25, 2010 5:43 pm
by nagendra
hiii,

i m confused with the accessing of the ksds file randomly in cobol...

how to use select statement...

how it works...

what is the meaning of file status here.

nd here..

select
access to dd name..
organization is indexed
access mode is random..
record key is .......... what shud be here... and for what reason...
file status...?? what is file status.. nd why it is required... here....

Re: how to access a ksds file randomly....

PostPosted: Sun Jul 25, 2010 6:40 pm
by NicC
what have you been reading to get confused? Suggest you read the COBOL manual or a COBOL book and all these things will be explained. Actually, just scanning the manual it looks quite clear.

Re: how to access a ksds file randomly....

PostPosted: Sun Jul 25, 2010 6:47 pm
by Robert Sample
The record key will be the variable in the FD 01 that matches the starting position and length of the VSAM file key. If your VSAM DEFINE says the record key is (17 0) then you need in the 01 under the FD for the file a variable name for the first 17 bytes of the record -- and that variable name goes in the RECORD KEY IS clause.

And you really, really, really need to spend time reading the COBOL manuals (the IBM web site has them available if you have no other source). File status is not required -- it is optional. However, it provides (especially when using the extended form for VSAM files) a lot of useful information about what happened when something doesn't work correctly.