View previous topic :: View next topic
|
Author |
Message |
sanfel_karan
New User
Joined: 04 Jan 2006 Posts: 4
|
|
|
|
Hi,
I've a requirement where I'm supposed to read a VSAM file with a partial key only. Can you please give me some pointers about this and help me?
Thanks in anticipation,
Shiv |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Karan,
Do you want it in cics? |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Say the key is:
05 ws-key.
10 ws-partial-key pic x(10).
10 ws-rest pic x(20).
Then, in the code you can do START on the file using partial key and later read the file using READ filename NEXT RECORD.
MOVE 'XXXX' TO ws-partial-key.
START filename
KEY IS equal to ws-partial-key.
-Ajay |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Oh, skip sequential processing. Not good from a performance view with the buffer refreshes at access mode swap. |
|
Back to top |
|
|
sanfel_karan
New User
Joined: 04 Jan 2006 Posts: 4
|
|
|
|
Thanks for giving me hope by responding.
The COBOL program runs in a Batch environment (JCL). I would like to give a little more information on this. please see the situation below:
Records in my VSAM file looks like this.
Key fields Non key fields
---------------------------- -----------------
| || |
01 Location1 Part1 extra fields
02 Location2 Part2
03 Location1 Spaces
04 Location1 Part4
.
.
.
This VSAM file has a composite key containing 1st 3 fields (Record Type, Location_Id and Part_Number).
I read Record which has value as seen in 3rd record which means, there wont be a Part_Number field filled for Record type '03'.
I need to delete this Record Type '03'. but before doing this, I need to check for '04' record type and for the same location (in this case Location1) - need to do some updates in those records.
So in this case - I've Record type field (hard coded value of '04') and Location_Id field (getting the value from record type '03' record). But i dont have Part_Number field.
There are few more scenarios where i want some help. I'll get them once i get into office tomorrow. Until then, can any one please help me finding a solution for the above scenario?
Thanks,
Shiv |
|
Back to top |
|
|
|