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.
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.
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
docdwarf@panix.com wrote:
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.'
I have never worked on a site where SEARCH or INSPECT REPLACING were >forbidden, that's ludicrous.
SORT is a bit different, some of the programs I wrote ran in Transaction >environments, and there were memory constraints. These programs did not >normally perform any sorting anyway, but in one case - sorting a table
in memory - I actually managed to get a C sorting library to work for me. >"Transaction environments" could be "Online" in your terminology.
Sysop: | Luis Silva |
---|---|
Location: | Lisbon |
Users: | 763 |
Nodes: | 10 (0 / 10) |
Uptime: | 181:04:06 |
Calls: | 111 |
Files: | 46,971 |
Messages: | 11,239 |