To get the S0C4, something has to reference something outside the buffer 
maintained by QSAM.

I know no details of the internals of QSAM, but it seems reasonable to believe 
that it allocates storage for buffers which are equal in size to the BLKSIZE.

Although it would be possible to construct a scenario where the header is in a 
block of its own (file written by a COBOL program without APPLY WRITE ONLY or 
compiler option AWO, LRECL plus length of header exceeds BLKSIZE, so header 
written in a block of its own), it would not be possible to have the header 
"overdefined" in the program such that referencing the entire header would 
cause storage outside the buffer to be accessed. OK, it could be done with 
reference-modification with an erroneously calculated length, but I can't think 
how otherwise. If it was the 17th record, 23rd, 492nd, possible. With the 
first? I can't get that.

If the header is just shorter than its definition, that won't matter at all, 
because the data picked up will just be from the next record. With the header 
the only record in the block, the data will be just whatever was lying around, 
but it can be referenced without the S0C4. I doubt there is any protection from 
QSAM for "outside the block, but inside the buffer".


On Tue, 7 Feb 2017 14:22:42 -0700, Sri h Kolusu <skol...@us.ibm.com> wrote:

>>>> In this case, because it is the behavior of the header record  (which 
>for one I'm assuming is the first record), these would only  be potential 
>issues if the file only consisted of the header, no  other records.
>
>Bill,
>
>Not really.  Assuming that OP's program is indeed dealing with VB files, 
>the header might be a Short record and the MOVE resulted in moving the 
>full length than the actual short record length and hence the S0C4. The 
>detailed records following the Header record *may* be of full length and 
>MOVE statements worked fine. Skipping the short header record *might* have 
>solved the issue. (Just a guess)
>
>Kolusu
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to