I have a KSDS file with alternate key ALT-KEY (21 bytes) as:
Now on screen user can enter :
First three digits of ALtkey-part1 and ALtkey-part2
Suppose user has entered ABC__ and DEFG
And In file we have records e.g ABC__DEFG09864754765, ABCXYZDEFG09864754875, ABCMNODEFG09864754765 etc...
Currently I am passing
ABC to ALTKEY-PART1(1:3)
SPaces to ALTKEY-PART1(4:2)
DEFG to ALtkey-Part2
I am browsing as:
STARTBR FILE('file name')
and Read Next until ALTKEY-PART1(1:3) or ALtkey-Part2 changes
EXEC CICS READNEXT
DATASET (file name')
But using this command I am getting only those records e.g ABC__DEFG09864754765 and not ABCMNODEFG09864754765.
Pls suggest how to browse and read the file so that i get all the records whose first three digits of ALtKey part 1 + ALtkey-Part2 are matching... the last two digits of ALtkey part1 in fetched records can be anything spaces or some value.!
Joined: 06 Jun 2008 Posts: 8057 Location: East Dubuque, Illinois, USA
You are getting exactly what you asked for. The records that match ABC<space><space> in your ALTKEY-PART1 are the only ones to be retrieved with your browse. If you want all matches, you'll need to do a generic key read on just the first 3 bytes of the key, then look at the ALTKEY-PART2 for matching fields. CICS does not allow wild card matching so there's no other way to find all matching ALTKEY-PART1 records.