View previous topic :: View next topic
|
Author |
Message |
Satheeshkumar
New User
Joined: 20 Feb 2009 Posts: 51 Location: Chennai
|
|
|
|
Hi,
Please suggest a suitable method to read a VSAM KSDS file using partial key.
The key is of 24 bytes, and I have only data upto first 8 bytes. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
To name a few :
idcams
sas
easytrev
sort ? |
|
Back to top |
|
|
Satheeshkumar
New User
Joined: 20 Feb 2009 Posts: 51 Location: Chennai
|
|
|
|
Hi,
Please suggest a suitable method to read a VSAM KSDS file using partial key through cobol batch program.
The key is of 24 bytes, and I have only data upto first 8 bytes. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Oh, yes and cobol of course.
I suggest to explore the cobol manual(s), that good enough? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You obviously did not search the forum, otherwise you would have found THIS topic. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
There is a manual link at the top of the page. Click on it, find the COBOL Language Environment manual, and read up on the START verb. |
|
Back to top |
|
|
Satheeshkumar
New User
Joined: 20 Feb 2009 Posts: 51 Location: Chennai
|
|
|
|
I have the code as :
in FILE CONTROL.
SELECT FILE1 ASSIGN TO FILE1
ORGANIZATION IS INDEXED
ACCESS IS DYNAMIC
RECORD KEY IS RECORD-KEY1
FILE STATUS IS WS-FILE1-STAT.
in working storage
01 RECORD-KEY1
05 CF-TYPE PIC X(01)
05 CF-SK PIC 9(07)
05 CF-SK-NO PIX X(9)
05 CF-P-NUMBER PIC 9(007) COMP-3
05 CF-LI-NUMBER PIC 9(003).
In PROCEDURE DIVISION:
MOVE 'S' TO CF-TYPE .
MOVE 0000018 TO CF-SK.
START FILE1
KEY GREATER THAN OR EQUAL TO RECORD-KEY1
READ FILE1
When i move the full key value to the key files it is working
but I have moved the values to first two fileds then by using the START i am trying to read record from same KSDS file. It throw file status 23. matching record not found. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
1. What did you initialize the other fields of your RECORD-KEY1 to?
2. What was the file status for the START?
3. Why are you not using the VSAM file status extension?
4. Are you using a READ or READ NEXT in your program?
Depending upon your answers to these questions, a file status 23 could be the expected result of your code. |
|
Back to top |
|
|
abhishek.sun
New User
Joined: 22 Aug 2008 Posts: 2 Location: Gurgaon
|
|
|
|
I do agree with Robert.
Move LOW VALUES to rest of the key fields, prior to starting the file:
CF-SK-NO
CF-P-NUMBER
CF-LI-NUMBER
I think that should work.
~Abhi |
|
Back to top |
|
|
|