how to access a ksds file randomly....

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

how to access a ksds file randomly....

Postby nagendra » Sun Jul 25, 2010 5:43 pm


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..

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....
Posts: 21
Joined: Mon Jul 19, 2010 12:18 pm
Location: bangalore
Has thanked: 0 time
Been thanked: 0 time

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


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

Postby NicC » Sun Jul 25, 2010 6:40 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Global moderator
Posts: 2514
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm
Has thanked: 4 times
Been thanked: 86 times

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

Postby Robert Sample » Sun Jul 25, 2010 6:47 pm

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.
Robert Sample
Global moderator
Posts: 3100
Joined: Sat Dec 19, 2009 8:32 pm
Location: Bellevue, Iowa
Has thanked: 1 time
Been thanked: 177 times

Return to IBM Cobol


  • Related topics
    Last post