View previous topic :: View next topic
|
Author |
Message |
tijo george
New User
Joined: 22 May 2009 Posts: 3 Location: pune
|
|
|
|
Hi,
I need to read the KSDS file for which i do not have the entire KEY. Using START I position the pointer on the required record. Now if i need read this particular record, is there any method? I do not want to use READ NEXT option. While using READ file-name the status code issued is '23' because it automatically picks the key as same as that one used in the START.
I have referred to other posts in the forum.
Any help is appreciated.
Tijo |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Please post the START statement you used -- this should have been posted as part of the question. |
|
Back to top |
|
|
tijo george
New User
Joined: 22 May 2009 Posts: 3 Location: pune
|
|
|
|
key of the VSAM ==> var1
var2
var3
START key1 KEY IS EQUAL TO var1
END-START
READ file1
Thanks,
Tijo [/i] |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I do not want to use READ NEXT option. |
Why not?
The posted START statement is not the one in the code - you need to post exactly what was used.
Suggest you also post the SELECT/ASSIGN and the first part of the FD. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
From the little bit you have posted -- nowhere near enough to accurately diagnose what's happening -- COBOL appears to be doing exactly what you told it to do. START KEY EQUAL is going to find one -- and only one -- record unless an alternate index is involved. And so far you have provided nothing indicating an alternate index is involved.
Not wanting to use READ NEXT is either a sign of an incompetent programmer or an insane programmer -- your choice. Either you are not willing to take advantage of the tools available (and which, by the way, are designed to do very precise tasks), or you have irrational (by definition, insane) reasons not to use valid COBOL statements. And claiming that this is a "requirement" imposed upon you falls in the irrational area. No valid set of requirements dictates the specific statements that can be used in the programming language. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Robert,
Quote: |
And claiming that this is a "requirement" imposed upon you falls in the irrational area. |
We might disagree with an opinion but a "requirement" is sacred and we must help implement as described - - - well, because it is required. . .
NOT
d |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
We might disagree with an opinion but a "requirement" is sacred and we must help implement as described - - - well, because it is required. |
RRRiiiggghhhttt .... since I'm still at work and haven't stared drinking (yet -- although after that last meeting I am ready to), that one's not gonna get past me! |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
"Can't make a good decision without knowing the alternatives."
Bill |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
We don' need no steenking decision - this is a requirement. . . |
|
Back to top |
|
|
|