Re: CALL using OMITTED
- From: docdwarf@xxxxxxxxx ()
- Date: Sat, 27 Sep 2008 15:52:55 +0000 (UTC)
In article <p5hDk.137$J63.102@xxxxxxxxxxxx>,
James J. Gavan <jgavandeletethis@xxxxxxx> wrote:
[snip]
I'm fascinated that you always seem to go looking for problems that you
can create in COBOL. What's wrong with KISS ?
Come now, Mr Gavan... if 'a person's got to know their limits' then a
person must, at some point, test those limits to breaking. Likewise with
new tools and learning; on the way to becoming the Olde One who can say
'You can try that, sure, but when I did we brought down Prod for six
hours... then again, we were using IFOX and IKFCBL00 so maybe it's time to
see what's changed!'
So in both examples you have A, B, C and D as pic x(04). What's so
complicated about :-
move spaces to C and D, when appropriate, before you do the CALL
(or any other combination of the four parameters) ???
Complexity is in the mind of the beholder, Mr Gavan... consider the
following:
01 CALLING-DATA.
05 WS-CALLING-POSSIBILITY-NUM001 PIC S9(3) COMP-3 VALUE 1.
05 WS-CALLING-POSSIBILITY-DATA.
10 WS-CALLPOSS-FROMDT PIC 9(8) VALUE ZEROES.
10 WS-CALLPOS-TODT PIC 9(8) VALUE ZEROES.
10 FILLER PIC X(74) VALUE SPACES.
05 WS-CALLING-POSSIBILITY-NUM002 PIC S9(3) COMP-3 VALUE 2.
10 WS-CALLPOS-STOCK-OPEN PIC S9(5)V9(4) COMP-3 VALUE +0
10 WS-CALLPOS-STOCK-MID PIC S9(5)V9(4) COMP-3 VALUE +0
10 WS-CALLPOS-STOCK-CLOSE PIC S9(5)V9(4) COMP-3 VALUE +0
10 FILLER PIC X(85) VALUE SPACES.
05 WS-CALLING-POSSIBILITY-NUM003 PIC S9(3) COMP-3 VALUE 3.
10 WS-CALLPOSS-TEMP-FAHRENHEIT PIC S9(9)V9(4) COMP-3 VALUE +0.
10 WS-CALLPOSS-TEMP-CELSIUS PIC S9(9)V9(4) COMP-3 VALUE +0.
10 WS-CALLPOSS-TEMP-KELVIN PIC S9(9)V9(4) COMP-3 VALUE +0.
10 FILLER PIC X(75) VALUE SPACES.
....
01 REDEF REDEFINES CALLING-AREA.
05 CALLING-ITEM OCCURS 999.
10 CALLING-POSSIBILITIY-NUM PIC S9(3) COMP-3.
10 CALLING-ITEM-DATA PIC X(100).
.... and then the LINKAGE becomes a mere
01 WS-LINKAGE-DATA.
05 WS-LPARM-LEN PIC S9(4).
05 WS-LPARM-ITEM.
10 WS-LPARM-NUM PIC S9(3) COMP-3.
10 WS-LPARM-DATA PIC X(100).
.... and then a simple
MOVE CALLING-ITEM (SUB1) TO WS-LPARM-ITEM
CALL SUBRTN USING WS-LPARM-ITEM
.... and, of course, a subroutine that begins as All Good Subroutines
should:
PROCEDURE DIVISION USING LPARM-ITEM.
IF LPARM-NUM NOT NUMERIC
(set error flags/msgs)
GO TO 9998-BAD-DATA-RETURN.
IF LPARM-NUM = 0
(set error flags)
GO TO 9998-BAD-DATA-RETURN.
IF LPARM-NUM > (max errors handled)
(set error flags, message to increase table size)
GO TO 99980BAD-DATA-RETURN.
*
GO TO PROCESS-DATA-001,
PROCESS-DATA-002,
PROCESS-DATA-003
.... PROCESS-DATA-999
DEPENDING ON LPARM-NUM.
What's easier than that? Never mind that it is is cumbersome and relies
on the assumption that human time is less expensive than machine time...
it sure is simple *and* blindingly fast, too!
DD
.
- References:
- CALL using OMITTED
- From: Frank Swarbrick
- Re: CALL using OMITTED
- From: James J. Gavan
- CALL using OMITTED
- Prev by Date: Re: Here's one problem
- Next by Date: Re: Ping: Pete Dashwood
- Previous by thread: Re: CALL using OMITTED
- Next by thread: Re: CALL using OMITTED
- Index(es):