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
nagendra
Posts: 21
Joined: Mon Jul 19, 2010 12:18 pm
Skillset: mainframes fresher.....
Referer: myself only through internet surfing
Location: bangalore

how to access a ksds file randomly....

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

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

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

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

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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.


  • Similar Topics
    Replies
    Views
    Last post