SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Typed (then erased and) copied in and ran this but (on Slackware-stable) got many errors and (on Slackware-current compiled but ran and got) segmentation fault: http://gnucobol.sourceforge.io/histo...lo-World-.html ... never though I'd try because dislike suits, but like BASIC & FORTRAN (similar) and heard one can get high wages with COBOL.
d@0.vanaheim:~$ cobc hello.cob
hello.cob:1: error: invalid indicator 'F' at column 7
hello.cob:2: error: invalid indicator 'M' at column 7
hello.cob:3: error: invalid indicator 'U' at column 7
hello.cob:4: error: invalid indicator 'Y' at column 7
hello.cob:5: error: invalid indicator 'U' at column 7
hello.cob:6: error: PROGRAM-ID header missing
If I can get this working, then I want to try '1+1' so I can know some bare minimum basics... would be good to learn subroutines/etc. but so far I tried just 'hello, world' and '1+1' in many languages and COBOL might not be first choice to go further.
Old school cobol code formatting was specified by column number (as in 80 column punch card). If you notice in the example the actual code does not start at the beginning of the line. To remove that syntax requirement use the -free compiler option.
I coded in both FORTRAN (IV) and COBOL, before I learned to grok Pascal. Code starts in character position 8, 7 is for flags, 1-6 is for labels with certain characters in position 1 having special meaning to some compilers. (Yeah, based on punchcards. Used those as well.)
Small machine COBOL is not where the money is. The opening is for Mainframe COBOL, especially on reverse endian EBCDIC systems. IT also helps to understand a bit of MF networking and DASD, and JES2 never hurts.
Be warned: the money is good, the opportunities are rare, and you will never have a manager who understands what it is you really do!
I used to code in COBOL and Assembly Language on EBCDIC mainframe computers, and I fully agree with your post. Just one little detail got me confused, though: your use of the term “reverse endian”; I guess you refer to the “big-endian” system, where the most significant byte of a numeric value is stored at the lowest memory address and the least significant byte is at the highest address. While this is “reversed” as compared to how the x86 family does it, it corresponds more naturally to how the digits of a number are written in, say, English: from most significant to least significant, left-to-right.
To me at least, “big-endian” (as the mainframe does it) feels like the natural order, while “litte-endian” (e.g., x86) feels reversed.
I used to code in COBOL and Assembly Language on EBCDIC mainframe computers, and I fully agree with your post. Just one little detail got me confused, though: your use of the term “reverse endian”; I guess you refer to the “big-endian” system, where the most significant byte of a numeric value is stored at the lowest memory address and the least significant byte is at the highest address. While this is “reversed” as compared to how the x86 family does it, it corresponds more naturally to how the digits of a number are written in, say, English: from most significant to least significant, left-to-right.
To me at least, “big-endian” (as the mainframe does it) feels like the natural order, while “litte-endian” (e.g., x86) feels reversed.
We agree. I did not want to go down the rabbit hole of explaining that whole thing to the PC crowd. You could make a 50 page thread on that alone without it actually serving any purpose. I spend a week of free time trying to prove to someone that there were other text options than ASCII and alphabet that took more bits than 7 once. ONCE! Never again. (Tech managers with only an MBA! )
I hear you… I once attempted to explain that “char” in C is just an integer type, and that you could do arithmetic on it just like on integers. (If I remember correctly, the discussion was a consequence of some code I had written that converted between numeric values and digits—I don’t even remember if it was about decimal or hexadecimal digits.) Even though I could demonstrate how trivial it was to “convert” between integers and characters, my code just couldn’t be correct, could it?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.