Re: START KEY EQUAL TO
- From: docdwarf@xxxxxxxxx
- Date: 28 Jun 2005 14:18:31 -0400
In article <1119981727.326090.83230@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<cblkid@xxxxxxxxx> wrote:
>
>
>docdwarf@xxxxxxxxx wrote:
>> In article <1119973385.735390.239950@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
>> <cblkid@xxxxxxxxx> wrote:
>>
>> [snip]
>>
>> >They supply values for PK-KEY1 and do a START on it (START filename KEY
>> >IS EQUAL TO PF-KEY1). They say this works on the mainframe. In the PC
>> >environment we are receiving an error (file status '23': Record not
>> >found). We agree with the PC version and have asked for a mainframe
>> >output to show this working.
>>
>> Is the record in question actually there? Can you step through a debugger
>> to verify it?
>>
>
>I tried it both ways in the debugger, with a valid partial key and an
>invalid partial key. In both instances the result is status '23' which
>implies to me this is a partial key and since this is an EQUAL TO will
>not be found. But then I feel I'm tainted. Would this be your
>interpretation of the same status code?
According to
<http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr10/6.1.8.9.1?SHELF=&DT=20020920180651&CASE=&FS=TRUE>
a File Status of 23 indicates 'An attempt was made to randomly access a
record that does not exist in the file, or a START or random READ
statement was attempted on an optional input file that was not present.'
Unless the key on which you are STARTing EQUAL TO exists on the file the
START will fail. If you have:
01 FILEREC.
05 PRIMARY-KEY.
10 FIRST-HALF PIC X(05).
10 OTHER-HALF PIC X(05).
....
01 A-FIELD PIC X(05) VALUE 'ABCDE'.
.... and you code:
MOVE SPACES TO PRIMARY-KEY.
MOVE A-FIELD TO FIRST-HALF.
START filnam KEY = PRIMARY-KEY
INVALID KEY PERFORM INVALID-KEY-RITUAL.
.... then unless you have a record on the file with the key of 'ABCDE '
(five trailing spaces) my experience tells me that you will get a 23.
Once again: on the file which you are attempting to access is there a
record which contains the full key on which you are STARTing?
DD
.
- Follow-Ups:
- Re: START KEY EQUAL TO
- From: Chuck Stevens
- Re: START KEY EQUAL TO
- References:
- START KEY EQUAL TO
- From: cblkid
- Re: START KEY EQUAL TO
- From: docdwarf
- Re: START KEY EQUAL TO
- From: cblkid
- START KEY EQUAL TO
- Prev by Date: Re: START KEY EQUAL TO
- Next by Date: Re: START KEY EQUAL TO
- Previous by thread: Re: START KEY EQUAL TO
- Next by thread: Re: START KEY EQUAL TO
- Index(es):