Re: Alternative COBOL "telco" source program
From: Robert Wagner (robert.deletethis_at_wagner.net)
Date: 05/30/04
- Previous message: Donald Tees: "Re: win98 to XP"
- In reply to: LX-i: "Re: Alternative COBOL "telco" source program"
- Next in thread: William M. Klein: "GROUP-USAGE (was Alternative COBOL "telco" source program"
- Reply: William M. Klein: "GROUP-USAGE (was Alternative COBOL "telco" source program"
- Reply: Jeffery Swagger: "Re: Alternative COBOL "telco" source program"
- Reply: LX-i: "Re: Alternative COBOL "telco" source program"
- Reply: Richard: "Re: Alternative COBOL "telco" source program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 May 2004 11:55:20 GMT
LX-i <lxi0007@netscape.net> wrote:
> when I
>discovered that I could put a value clause on a group item, it changed
>the way I defined tables (and other 01-level items). With my compiler,
>there is a caveat (not sure if it's standard-imposed or not) - you can't
>use a usage clause under a group level item with a value clause. So,
>for my bit-switches, I can't say...
>
>01 MySwitches value zeroes.
> 12 pic 1 binary-1.
>
>...which kind of stinks, but I can understand the limitation as well.
Group names are implicitly pic x. It's an error to initialize bit/binary/packed
variables with F0 (EBCDIC) or 30 (ASCII). It's common for compilers to disallow
that value while permitting 'move zeroes to MySwitches'. Go figure.
I use Value only to initialize constants i.e. fields that will never change.
With regular variables, there are at least two potential bugtraps. One is the
Initialize verb which, according to the '85 Standard, does not use your Values.
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.
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, it just didn't use them. That's now fixed, but
there's a chance the shop's production compiler is older than its development
version, or another shop is using an old one.
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'.
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.
- Previous message: Donald Tees: "Re: win98 to XP"
- In reply to: LX-i: "Re: Alternative COBOL "telco" source program"
- Next in thread: William M. Klein: "GROUP-USAGE (was Alternative COBOL "telco" source program"
- Reply: William M. Klein: "GROUP-USAGE (was Alternative COBOL "telco" source program"
- Reply: Jeffery Swagger: "Re: Alternative COBOL "telco" source program"
- Reply: LX-i: "Re: Alternative COBOL "telco" source program"
- Reply: Richard: "Re: Alternative COBOL "telco" source program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|