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

Partial Key - VSAM Read Issue


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

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Wed Mar 18, 2009 10:22 pm
Reply with quote

I have a file with below format, File is of 80 bytes Record Length and all 80 bytes is

Code:
01 WS-KEY.
   05 WS-FIELD1      PIC X(10)
   05 FILLER         PIC X(1)
   05 WS-FIELD2      PIC X(10)
   05 FILLER         PIC X(1)
   05 WS-FIELD3      PIC X(10)
   05 FILLER         PIC X(48)


which is having values as below
Code:

AAA     .1111111111.9999999999...........
ABCDF   .2222222222.9999999999...........
AB      .3333333333.9999999999...........


In my program, i don't have values for WS-FIELD1. I would need to read the 3rd record based on WS-FIELD2. I tried to use START and READ NEXT as below, but it didn't work.

Code:
 
MOVE LOW-VALUES TO WS-KEY
MOVE '333333333' TO WS-FIELD2     
START FILE-NAME KEY IS >= WS-KEY
NOT INVALID
 READ FILE-NAME NEXT
.
.


But this is actually not working. After the READ, we tried to put a display of the VSAM file REC, that is always the first record.

We tried with different values passed into WS-FIELD2.

Is there any way to satisfy our requirement ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Mar 18, 2009 10:52 pm
Reply with quote

Build an alternate index on WS-FIELD2. Read the file based on it.
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 Error to read log with rexx CLIST & REXX 11
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
Search our Forums:

Back to Top