Re: Alternative COBOL "telco" source program

From: Richard (riplin_at_Azonic.co.nz)
Date: 05/31/04


Date: 30 May 2004 20:49:23 -0700

robert.deletethis@wagner.net (Robert Wagner) wrote

> The other is the operating system or Cobol runtime handling of called programs.
> If the caller does a Cancel, Values will be there on the next Call. But if the
> caller forgets or abends or someone else calls your .dll, they probably won't
> be.

If the caller 'forgets' to cancel and expects initial values then it
is a program bug.

If the caller 'abends' then it is unlikely that they will notice if or
not the next call to a program has initial values or not - it won't
get there.

If 'someone else calls your .dll' and gets your data values then that
would be a serious issue, but what systems would this occur with ?
 
> A third, less common, problem is Local-Storage. As discussed here, Micro Focus
> used to leave it uninitialized. It didn't issue a warning about Value clauses,
> as it would in Linkage-Section,

MF has an extension that treat VALUE clauses in FDs, LINKAGE-SECTION
and LOCAL-STORAGE (depending on version) as documentary (except of
course on condition names where they are always valid).

> it just didn't use them. That's now fixed,

That wasn't a 'bug' to be fixed, it was defined behaviour.

> but
> there's a chance the shop's production compiler is older than its development
> version, or another shop is using an old one.

Or even a different compiler vendor.
 
> For these reasons, I put 'individual' variables under a group name (rather than
> using 77 or 01) and initialize it with 'move low-values to
> unqualified-variables'.

One assumes that you only use binary types for these variables.
Packed and display variables may be just as poorly initialised as
occurs with ascii zero characters on packed.

> FWIW, 'pic 1' seems like sufficient information for the compiler to define one
> bit. It is on the AS/400. If your compiler makes you also write 'binary-1', that
> seems redundant.

PIC 1 may (depending on version) be usage display or bit (or other).
Display may be the default usage, in which case specifying the
required usage is not redundant.



Relevant Pages

  • Re: inter subprogram in initial state, but only sometimes
    ... > But is there a way for the CALLED program to basically cancel itself once ... I want the sub-program to sometimes be ... Of course it could pass something back to the caller ... > Frank Swarbrick ...
    (comp.lang.cobol)
  • inter subprogram in initial state, but only sometimes
    ... But is there a way for the CALLED program to basically cancel itself once it ... I want the sub-program to sometimes be entered ... Of course it could pass something back to the caller ... Frank Swarbrick ...
    (comp.lang.cobol)
  • Re: Alternative COBOL "telco" source program
    ... > If the caller 'forgets' to cancel and expects initial values then it ... > is a program bug. ... Reminds me of an old saw, in which I still believe: ...
    (comp.lang.cobol)