Covid is stealing my sleep and my intelligence
FRAME.COB copybook's in the source of SOURCE.COB. It's something I saw
in the FAQ.
I'm trying to demonstrate to myself how to do user-defined functions.
--- FRAME.COB
IDENTIFICATION DIVISION.
PROGRAM-ID. frame.
DATA DIVISION.
working-storage SECTION.
01 FOO PIC XXX VALUE "FOO".
01 OOF PIC XXX.
PROCEDURE DIVISION.
CALL "SOURCE" USING FOO returning into oof.
IF OOF NOT = "OOF"
DISPLAY "FAIL"
ELSE
DISPLAY "PASS"
END-IF.
STOP RUN.
COPY "SOURCE.COB".
END PROGRAM frame.
--- SOURCE.COB
PROGRAM-ID. SOURCE.
DATA DIVISION.
linkage SECTION.
01 RES PIC XXX.
01 FOO PIC XXX.
PROCEDURE DIVISION USING FOO res.
display foo.
MOVE FUNCTION REVERSE(FOO) TO RES.
EXIT PROGRAM.
END PROGRAM SOURCE.
Can someone please point out the screamingly obvious?
The context for this is that there are some things about CobolCheck that
are really good and some that suck and this is at the end of one
rabbithole looking for different ways of testing student code.
Covid is stealing my sleep and my intelligence
FRAME.COB copybook's in the source of SOURCE.COB. It's something I saw
in the FAQ.
I'm trying to demonstrate to myself how to do user-defined functions.
--- FRAME.COB
IDENTIFICATION DIVISION.
PROGRAM-ID. frame.
DATA DIVISION.
working-storage SECTION.
01 FOO PIC XXX VALUE "FOO".
01 OOF PIC XXX.
PROCEDURE DIVISION.
CALL "SOURCE" USING FOO returning into oof.
IF OOF NOT = "OOF"
DISPLAY "FAIL"
ELSE
DISPLAY "PASS"
END-IF.
STOP RUN.
COPY "SOURCE.COB".
END PROGRAM frame.
--- SOURCE.COB
PROGRAM-ID. SOURCE.
DATA DIVISION.
linkage SECTION.
01 RES PIC XXX.
01 FOO PIC XXX.
PROCEDURE DIVISION USING FOO res.
display foo.
MOVE FUNCTION REVERSE(FOO) TO RES.
EXIT PROGRAM.
END PROGRAM SOURCE.
Can someone please point out the screamingly obvious?
The context for this is that there are some things about CobolCheck that
are really good and some that suck and this is at the end of one
rabbithole looking for different ways of testing student code.
I don’t have any COBOL industry experience. I learned COBOL in 1983and loved it but never got to do anything constructive with it until I
What???s the usual deal out there
in the ???real world???? Do people write standalones or do they learn early >how to write callables? What should we be teaching?
Find where they keepWhich is essentially what I tell the mentees somewhere in the
their skels ('templates'), read the code and learn their songs.'
On 6/4/24 21:04, docdwarf@panix.com wrote:
Find where they keepWhich is essentially what I tell the mentees somewhere in the
their skels ('templates'), read the code and learn their songs.'
discussions I have with them.
Yeah, "real world" is an unreal term, I grant you that.
In article <uurf6i$22csg$1@dont-email.me>,
Bruce Axtens <snetxa@hotmail.com> wrote:
[snip]
What???s the usual deal out there
in the ???real world???? Do people write standalones or do they learn early >> how to write callables? What should we be teaching?
You should be teaching what the language is capable of using. I'm not
sure where this 'real world' is but im my experience every shop has its standards - or waves of standards, and just like each wave leaves its own
bit of jetsam on the shore each wave of New Standard leaves... stuff in
the code - and it's up to a Senior Programmer to tell the New Guy 'sure,
it can be done that way... but the Way We Do It Here is...'
I've sorked in shops where the SEARCH verb was forbidden, spit out by pre-compiling tools, because 'people get confused by it' (or Chief Senior Programmer didn't understand it). Same with SORT. Same with INSPECT REPLACING because 'you Never Know when the subroutine will be wanted in
the Online region and that's a Bad Thing.'
It's frustrating but... their shop, their rules. Find where they keep
their skels ('templates'), read the code and learn their songs.'
DD
Covid is stealing my sleep and my intelligence
FRAME.COB copybook's in the source of SOURCE.COB. It's something I saw
in the FAQ.
I'm trying to demonstrate to myself how to do user-defined functions.
- --- FRAME.COB
IDENTIFICATION DIVISION.
PROGRAM-ID. frame.
DATA DIVISION.
working-storage SECTION.
01 FOO PIC XXX VALUE "FOO".
01 OOF PIC XXX.
PROCEDURE DIVISION.
CALL "SOURCE" USING FOO returning into oof.
IF OOF NOT = "OOF"
DISPLAY "FAIL"
ELSE
DISPLAY "PASS"
END-IF.
STOP RUN.
COPY "SOURCE.COB".
END PROGRAM frame.
- --- SOURCE.COB
PROGRAM-ID. SOURCE.
DATA DIVISION.
linkage SECTION.
01 RES PIC XXX.
01 FOO PIC XXX.
PROCEDURE DIVISION USING FOO res.
display foo.
MOVE FUNCTION REVERSE(FOO) TO RES.
EXIT PROGRAM.
END PROGRAM SOURCE.
Can someone please point out the screamingly obvious?
The context for this is that there are some things about CobolCheck
that are really good and some that suck and this is at the end of one rabbithole looking for different ways of testing student code.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 920 |
Nodes: | 10 (1 / 9) |
Uptime: | 111:21:21 |
Calls: | 12,192 |
Calls today: | 1 |
Files: | 186,527 |
Messages: | 2,237,678 |