Re: Variable Length Input File



On Sun, 24 Dec 2006 01:13:42 +0000 (UTC), docdwarf@xxxxxxxxx () wrote:

In article <lairo250619raljqhu1d545id7c5rbsan0@xxxxxxx>,
Clark F Morris <cfmpublic@xxxxxxxxxxxxxxx> wrote:
On Sat, 23 Dec 2006 15:33:32 +0000 (UTC), docdwarf@xxxxxxxxx () wrote:

In article <1166881498.301512.7030@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Alistair <alistair@xxxxxxxxxxxxxxxxxxxxx> wrote:

docdwarf@xxxxxxxxx wrote:
In article <1166790950.351244.67040@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Alistair <alistair@xxxxxxxxxxxxxxxxxxxxx> wrote:

[snip]

ALTERNATIVELY (and I like this one): set the FD to contain a record of
one character length fixed blocked and read repeatedly, building the
record in working storage.

I can't believe that no-one came up with that one before me.

Perhaps they did, Mr Maclean, and discarded it as being of... questionable
utility on an IBM-style mainframe.

[snip]

... the job ABENDs with IEF450I WSXSKEL0 STEP020 - ABEND=S000 U4038
REASON=00000001 and the following messages in the SYSOUT:

IGZ0201W A file attribute mismatch was detected. File INFILE in program
SKELPROG had a record length of 1 and the file specified in the ASSIGN
clause had a record length of 30.
IGZ0035S There was an unsuccessful OPEN or CLOSE of file TESTA in program
SKELPROG at relative location X'0358'. Neither FILE STATUS nor an ERROR
declarative were specified. The status code was 39. From compile unit
SKELPROG at entry point SKELPROG at statement 19 at compile unit offset
+00000358 at entry offset +00000358 at address 000082C8.

How about over-riding the DCB?

I'm not quite sure what technique you might use to accomplish this, Mr
Maclean. If you would be so kind as to post an example it might help
clarify the matter.

Assuming that you have BLOCK 0 and RECORD VARYING FROM 1 TO 32760 (or
maximum record size expected) in the COBOL program and assuming the
file is actually VB or VBS (RECORDING S needed in the COBOL program),
you would then code RECFM=VB,LRECL='cobol TO LENGTH +4' in the JCL and
thus be able to read any file regardless of length.

No problems with that, Mr Morris... that's part of the nature of VB
datasets on Big Iron. I noticed that the original poster has yet to
respond to questions about the DCB; it might be that the time
for this assignment has gone past 'due date'.

For FB code the
maximum size 01 level expected for the FD and RECORD 0 in addition to
BLOCK 0 and the actual record length will be determined at run time.
Unfortunately this only works for INPUT. I don't think that you can
use RECORD 0 VARYING DEPENDING ON for fixed length records.

I'm not sure how this 'over-rides the DCB', as Mr Maclean suggested... but
perhaps sometime next week, if I remember, I'll cobble together some code
and see if this flies.

If RECORD 0 is coded, then filling in of the field in the DCB is
deferred to the OPEN. Since LRECL in the program's DCB normally
overrides both JCL supplied LRECL and tape or disk label DCB, the
coding of RECORD 0 allows the program to use an external source for
the record length and eliminates the need for checking the program
supplied value against the external source.

DD
.



Relevant Pages

  • Re: Variable Length Input File
    ... Alistair wrote: ... SKELPROG had a record length of 1 and the file specified in the ASSIGN ... No problems with that, Mr Morris... ...
    (comp.lang.cobol)
  • Re: Variable Length Input File
    ... Alistair wrote: ... SKELPROG had a record length of 1 and the file specified in the ASSIGN ... maximum record size expected) in the COBOL program and assuming the ...
    (comp.lang.cobol)
  • Re: Variable Length Input File
    ... Alistair wrote: ... SKELPROG had a record length of 1 and the file specified in the ASSIGN ... SKELPROG at entry point SKELPROG at statement 19 at compile unit offset ...
    (comp.lang.cobol)
  • Re: WaitCommEvent() problem
    ... Here's a snip from one of my projects: ... void OpenPort() ... DCB dcb; ... SetCommMask (hCommPort, EV_RXCHAR); ...
    (microsoft.public.windowsce.embedded.vc)