"Frank Swarbrick" <[email protected]> wrote in message
news:<listserv%[email protected]>...
> On Fri, 15 May 2009 09:27:42 -0400, Thompson, Steve 
> <[email protected]> wrote:
<snip>
> It depends on if the file is "pre-defined".  If it is not, and I don't
include DCB 
> stuff on the DD, then it does what Cobol tells it to do (because there is
no 
> other place to get that information!).
> 
> However if the file *is* predefined then *that* information appears (for 
> blocking only, not for RECFM (V vs B) or LRECL) to override what Cobol 
> states.  
> 
> Examples...
> 
> If I predefine a file as RECFM=VB, BLKSIZE=10000, LRECL=4004 then
> 1) If Cobol says "BLOCK CONTAINS 10000" it works (of course).
> 2) If Cobol says "BLOCK CONTAINS 0" it works.
> 3) If Cobol says "BLOCK CONTAINS 12345" it works (!!!)
> 4) If Cobol does not have a BLOCK CONTAINS clause it works (!!!)
> 
> This is the case no matter if I am reading from the file or writing to it.
> 
> I am glad it works "no matter what".  But the documentation seems to me to

> indicate that conditions 3 and 4 should not work, even though they do.
That 
> is where I am getting confused.
> 
<snip>

Frank,
  (Some private email also sent on this),

I think that the current COBOL documentation *ASSUMES* (possibly
erroneously) that for OUTPUT files
A) For QSAM, that they are NOT pre-defined and that the combination of the
COBOL FD information and the JCL information will CREATE the file
B) For VSAM (KSDS, ESDS, *and* RRDS) that the file IS predefined (e.g.
IDCAMS).

The statement at:
  http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/igy3pg40/1.9.4.3.2 

that says,
 "If your COBOL program writes records to a new file that will be made
available before the program runs, ensure that the file attributes in the DD
statement, the environment variable, or the allocation do not conflict with
the attributes in the program."

seems to be saying that if you do predefine QSAM files that you should make
certain that the attributes match.  The UNSTATED implication (or my
inference) is that your "case 3 and 4" may work today and it may work
tomorrow, but there is no GUARANTEE that they will work with the next
release or even service level.  My guess is that they will, but I certainly
do not see any place in the existing COBOL documentation that "guarantees"
this.

>From my experience (and as a personal opinion), I would NOT pre-allocate
QSAM files - but instead would use BLOCK CONTAINS 0 in the COBOL program.  I
can't think of when this would ever "hurt" and I can certainly see lots of
times that it would "help". 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to