Home > Archive > Cobol > June 2007 > Re: ATTN: DD
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| In article <1180822006.061423.92230@o5g2000hsb.googlegroups.com>,
Alistair <alistair@ld50macca.demon.co.uk> wrote:
>Just thought you might like to know:
>
>My booz'm chum (this is a Saturday night) says that he likes your
>solution to the two simultaneous reads of one file problem and that he
>is now extending it to read three invocations of the same file
>simultaneously. He thinks it is rather neat.
>
>Me, I'm too pissed to remember what the original solution was!
I didn't remember it either until you just mentioned it now... I believe
it had to do with addressing the same dataset by two different internal
names, as in
SELECT FILE01 ASSIGN TO FILE01.
SELECT FILE02 ASSIGN TO FILE02.
.... and the JCL (or however that platform related internal to external
names) would be along the lines of:
//FILE01 DD DSN=SOME.DATASET.NAME,DISP=SHR
//FILE02 DD DSN=SOME.DATASET.NAME,DISP=SHR
.... so that when, say, SOME.DATASET.NAME contained the following records:
0010
0020
0030
0040
0050
.... then code similar to:
PERFORM 4 TIMES
READ FILE01
END-READ
END-PERFORM
READ FILE02
END-READ
DISPLAY 'FILE01-REC = ', FILE01-REC
DISPLAY 'FILE02-REC = ', FILE02-REC
.... would (assuming a bunch of other stuff, such as FDs and the like) give
output of
FILE01-REC = 0040
FILE02-REC = 0010
.... where both records came out of the same dataset.
Now, it seems, he wants to do it again... and this reinforces Yet Another
Prejudice of mine, similar to the one against solutions which are prefaced
by 'All ya gotta do is...' ... and that Prejudice is against someone who
tells me 'We'll only need this once, just this once...'
.... because - especially with computers, being the kind of devices they
are - If Something Can Be Done Once Then That Something Can Be Done
Forever. An ugly, wretched, cobbled-together 'do it just this one time,
no matter how' chunk of code becomes a part of the Production System...
and then, as the System grows, this chunk of code is stretched beyond its
design limits and starts to do Bad Things... and someone is sure to say
'Who wrote this crap, *anyone* can see it isn't fit to run...' ... when
the circumstances of its current running are far, far different than those
for which it was originally designed... which were to be '... once, just
this once.'
DD
| |
|
|
|
|
|
|
|