Re: COBOL is dynamic (depends)
- From: "Richard" <riplin@xxxxxxxxxxxx>
- Date: 26 Oct 2006 16:32:10 -0700
HeyBub wrote:
Your solution is simple, compact, and easy to understand.
You're lucky to have a compiler that permits field names after an ODO. For
those of us with conforming compilers, your solution can't be used. If faced
with the same problem, I'd have to march an index down the input record
moving individual bytes to their prescribed destinations.
Or use reference notation, perhaps table driven:
01 Tspec PIC X(36) VALUE
"001004005002007049056004060049109001".
01 Uspec PIC X(36) VALUE
"001004005002007033040004044033077001".
etc
01 FieldSpec.
03 AStart PIC 999.
03 ALen PIC 999.
03 BStart PIC 999.
03 BLen PIC 999.
etc
MOVE TSpec TO FieldSpec
EVALUATE Data-In(CStart:1)
WHEN "U"
MOVE Uspec TO FieldSpec
WHEN OTHER
etc
MOVE Data-In(AStart:ALen) TO A
MOVE Data-In(BStart:BLen) TO B
etc
.
- Follow-Ups:
- Re: COBOL is dynamic (depends)
- From: Frank Swarbrick
- Re: COBOL is dynamic (depends)
- References:
- COBOL is dynamic (depends)
- From: Frank Swarbrick
- Re: COBOL is dynamic (depends)
- From: HeyBub
- COBOL is dynamic (depends)
- Prev by Date: Re: COBOL is dynamic (depends)
- Next by Date: INSPECT BEFORE/AFTER phrase 2002/2008
- Previous by thread: Re: COBOL is dynamic (depends)
- Next by thread: Re: COBOL is dynamic (depends)
- Index(es):