Category : Miscellaneous Language Source Code
Archive   : COBOL85.ZIP
Filename : XSUBSAM.COB

 
Output of file : XSUBSAM.COB contained in archive : COBOL85.ZIP
IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE.
* EXAMPLE OF MAIN PROGRAM CALLING EXTERNAL SUB PROGRAMS
* THE MAIN AND SUB PROGRAMS MUST BE COMPILED SEPARARELY
* AND THEN LINKED TOGETHER....
* COBOL XSUBSAM
* COBOL XSUB1
* COBOL XSUB2
* LINK XSUBSAM,XSUB1,XSUB2
* RUN XSUBSAM
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INTER-PROGRAM-VARIABLES.
05 A-NUMBER PIC 9(5) COMP-3.
05 ROOT-1 COMP-1.
05 ROOT-2 PIC 99V99 COMP-3.
PROCEDURE DIVISION.
000-MAIN.
MOVE 1000 TO A-NUMBER.
*
* CALL TO A FUNCTION SUB PROGRAM
*
CALL 'SQUARE-ROOT-FUNCTION' USING A-NUMBER GIVING ROOT-1.
*
DISPLAY ROOT-1 WITH CONVERSION.
*
* CALL TO A STANDARD SUB PROGRAM
*
CALL 'SQUARE-ROOT' USING A-NUMBER ROOT-2.
*
DISPLAY ROOT-2 WITH CONVERSION.
STOP RUN.
END PROGRAM SAMPLE.


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : COBOL85.ZIP
Filename : XSUBSAM.COB

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/