IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is Partial Key Generic read possible in a VSAM file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sanfel_karan

New User


Joined: 04 Jan 2006
Posts: 4

PostPosted: Wed Jan 23, 2008 4:45 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Jan 23, 2008 6:02 pm
Reply with quote

Karan,

Do you want it in cics?
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Wed Jan 23, 2008 9:03 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jan 23, 2008 11:56 pm
Reply with quote

Oh, skip sequential processing. Not good from a performance view with the buffer refreshes at access mode swap.
Back to top
View user's profile Send private message
sanfel_karan

New User


Joined: 04 Jan 2006
Posts: 4

PostPosted: Thu Jan 24, 2008 12:02 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top