Free Republic
Browse · Search
Bloggers & Personal
Topics · Post Article

To: 2ndDivisionVet

000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. HELLOWORLD.
000300
000400*
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SOURCE-COMPUTER. RM-COBOL.
000800 OBJECT-COMPUTER. RM-COBOL.
000900
001000 DATA DIVISION.
001100 FILE SECTION.
001200
100000 PROCEDURE DIVISION.
100100
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100400 DISPLAY “ “ LINE 1 POSITION 1 ERASE EOS.
100500 DISPLAY “Hello world!” LINE 15 POSITION 10.
100600 STOP RUN.
100700 MAIN-LOGIC-EXIT.
100800 EXIT.


6 posted on 06/19/2014 8:07:52 PM PDT by ClearCase_guy ("Harvey Dent, can we trust him?" http://www.youtube.com/watch?v=HBsdV--kLoQ)
[ Post Reply | Private Reply | To 1 | View Replies ]


To: ClearCase_guy

10 goto 10

Programming is fun.


19 posted on 06/19/2014 8:25:09 PM PDT by FXRP
[ Post Reply | Private Reply | To 6 | View Replies ]

To: ClearCase_guy

A guy in our fortran class made this interesting comment (Which I agree with):

The difference between Fortran , Cobol, and Assembler is...

In Assembler you tell the machine what to do.
In Fortran you ask it.
And in Cobol, you get on your knees and beg.


32 posted on 06/19/2014 8:55:23 PM PDT by UCANSEE2 (Lost my tagline on Flight MH370. Sorry for the inconvenience.)
[ Post Reply | Private Reply | To 6 | View Replies ]

To: ClearCase_guy

and it is as easy as that

and Hello back at ya


36 posted on 06/19/2014 9:01:35 PM PDT by Nifster
[ Post Reply | Private Reply | To 6 | View Replies ]

To: ClearCase_guy

About 27 years ago I bumped into McFarland while on vacation in Australia. (The M of RM-COBOL).

Nice guy.


39 posted on 06/19/2014 9:18:01 PM PDT by FreedomPoster (Islam delenda est)
[ Post Reply | Private Reply | To 6 | View Replies ]

To: ClearCase_guy

COBOL?

My god, what’s next? BAL?


47 posted on 06/19/2014 11:08:24 PM PDT by EQAndyBuzz ("Heck of a reset there, Hillary")
[ Post Reply | Private Reply | To 6 | View Replies ]

To: ClearCase_guy

Now that I think about it, COBOl should be taught. With global warming, all those Y2K programmers frozen in time will be long thawed out and dead by Y3K.


48 posted on 06/19/2014 11:09:51 PM PDT by EQAndyBuzz ("Heck of a reset there, Hillary")
[ Post Reply | Private Reply | To 6 | View Replies ]

To: ClearCase_guy
For the real men on the thread:


**************************************************************
** HELLO - Program to print "Hello, World" on device 009 **
**************************************************************

HELLO CSECT
STM R14,R12,12(R13) Save Registers
LR R12,R15 Load Base Register
USING HELLO,R12 Establish Addressability
SSM =X'00' Disable Interrupts
SPKA 0(0) Disable storage protection
LA R2,CCWS Store pointer to CCW chain
ST R2,CAW ... in Channel Address Word
LA R2,9 Put device address in R2
CLEARIO TIO 0(R2) Test for device busy
BC CC1+CC2,CLEARIO Wait until device not busy
BC CC3,IOERROR Abort if device error
STARTIO SIO 0(R2) Start I/O to the console
BC CC1,CSWSTORE A CSW Has been stored
BC CC2,CLEARIO Device busy. Wait until clear
BC CC3,IOERROR Abort if device error
TESTIO TIO 0(R2) Wait for I/O completion
BC CC2,TESTIO Busy, Wait for completion
BC CC3,IOERROR Abort if device error
CSWSTORE CLI CSW+4,CE Channel End w/o Device End?
BE TESTIO Yes - wait for Device End too
TM CSW+4,BY Channel Busy?
BO TESTIO Yes - Keep Waiting
TM CSW+4,DE Device End?
BNO IOERROR No - The CSW is bad
SUCCESS SSM =X'FF' Reenable Interrupts
LM R14,R12,12(R13) Restore Caller's Registers
XR R15,R15 Clear Return Code
BR R14 Return to Caller
IOERROR SSM =X'FF' Reenable Interrupts
LM R14,R12,12(R13) Restore Caller's Registers
LA R15,4 Set Return Code 4
BR R14 Return to Caller
DS 0D CCW must be doubleword aligned
CCWS CCW X'09',MESSAGE,X'20' ,L'MESSAGE
MESSAGE DC C'Hello, World'
CSW EQU X'40' Addre ss of Channel Status Word
BY EQU X'10' Chann el Busy
CE EQU X'08' Chann el End
DE EQU X'04' Devic e End
CAW EQU X'48' Addre ss of Channel Address Word
R2 EQU 2 Regis ter 2
R12 EQU 12 Regis ter 12
R13 EQU 13 Regis ter 13
R14 EQU 14 Regis ter 14
R15 EQU 15 Regis ter 15
CC0 EQU 8 Condi tion Code 0
CC1 EQU 4 Condi tion Code 1
CC2 EQU 2 Condi tion Code 2
CC3 EQU 1 Condi tion Code 3
END

54 posted on 06/19/2014 11:24:39 PM PDT by FredZarguna (Das ist nicht nur nicht richtig, es ist nicht einmal falsch!)
[ Post Reply | Private Reply | To 6 | View Replies ]

To: ClearCase_guy

oh sweet lord baby Jesus...have not seen Cobol for years! LOL

never ever did get the whole envorinment division bit...always seemed to be more free text...

thanks for the trip down memory lane!!!


56 posted on 06/20/2014 12:11:46 AM PDT by Irishguy
[ Post Reply | Private Reply | To 6 | View Replies ]

Free Republic
Browse · Search
Bloggers & Personal
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson