Groups | Search | Server Info | Login | Register


Groups > comp.lang.cobol > #12863

Re: Need an example CALL USING RETURNING

From "Vincent Coen" <VBCoen@gmail.com>
Newsgroups comp.lang.cobol
Subject Re: Need an example CALL USING RETURNING
Date 2024-04-06 23:27 +0100
Organization A noiseless patient Spider
Message-ID <1712442473@f1.n250.z2.fidonet.ftn> (permalink)
References <uuq9i9$1n5b8$1@dont-email.me>

Show all headers | View raw


Hello Bruce!

Saturday April 06 2024 02:46, Bruce Axtens wrote to All:

Does not the 2nd element need :

 FUNCTION-ID.  SOURCE.

Instead of PROGRAM-ID
 for a function definition but there again 2nd is a module so does not
matter as you defined it by PROGRAM-ID.


Change the name as well as SOURCE is a reserved word.


The interesting thing about Cobol is there is always multi. ways of doing
almost anything even for HELLO WORLD and I have seen a few :)


 > 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.



Vincent

Back to comp.lang.cobol | Previous | NextPrevious in thread | Find similar


Thread

Need an example CALL USING RETURNING Bruce Axtens <snetxa@hotmail.com> - 2024-04-06 09:46 +0800
  Re: Need an example CALL USING RETURNING Arnold Trembley <arnold.trembley@att.net> - 2024-04-06 04:38 -0500
  Re: Need an example CALL USING RETURNING R Daneel Olivaw <Danny@hyperspace.vogon.gov> - 2024-04-06 13:47 +0200
  Re: Need an example CALL USING RETURNING Bruce Axtens <snetxa@hotmail.com> - 2024-04-06 20:29 +0800
    Re: Need an example CALL USING RETURNING docdwarf@panix.com () - 2024-04-06 13:04 +0000
      Re: Need an example CALL USING RETURNING Bruce Axtens <snetxa@hotmail.com> - 2024-04-06 21:11 +0800
        Re: Need an example CALL USING RETURNING docdwarf@panix.com () - 2024-04-06 17:04 +0000
      Re: Need an example CALL USING RETURNING R Daneel Olivaw <Danny@hyperspace.vogon.gov> - 2024-04-06 22:06 +0200
        Re: Need an example CALL USING RETURNING docdwarf@panix.com () - 2024-04-07 01:42 +0000
  Re: Need an example CALL USING RETURNING "Vincent Coen" <VBCoen@gmail.com> - 2024-04-06 23:27 +0100

csiph-web