Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
Hello shaham25,
New to the forum, and I think new to programming, at least COBOL. Welcome to the Forum, you will find many members with a wealth of knowledge and a willingness to help.
Before I get into your questions, I?d like to say one thing about programming that is hard learned by some people. The computer doesn?t necessarily do what you want it to do. It does what you tell it to do.
For your first question.
Add the following to the compile step:
//SYSTERM DD SYSOUT=*
The TERM option says to output diagnostic messaged to the SYSTERM dataset, and you didn't have one, so it changed to NOTERM.
Also check the changes I have made to your program. If you don?t understand why some of these changes were made, please ask. Or, if you have problems running this, also please come back.
*PROGRAM-BEGIN.
ACCEPT FIRST-NUMBER.
DISPLAY "THE FIRST NUMBER IS " FIRST-NUMBER.
ACCEPT SECOND-NUMBER.
DISPLAY "THE SECOND NUMBER IS " SECOND-NUMBER.
COMPUTE RESULT-NUMBER = FIRST-NUMBER + SECOND-NUMBER.
DISPLAY "THE RESULT IS " RESULT-NUMBER.
*PROGRAM-DONE.
STOP RUN.
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
Dave, as you may have read in other posts, I'm not a programmer, so I don't spend much time in the COBOL world. However, it struck me as odd when looking the original posted code that it wasn't even syntactically correct in the ISPF Editor, so I'm suprised that somone would have even atempted to compile it.
Also, whenever I've delved into the COBOL or Assembler world, I've always compiled the program in the foreground. Do modern programmers really submit batch compiles?
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
Superk,
I think one of shaham25's problems might be that he probably wasn't getting any diagnostic messages because the SYSTERM DD was missing. This program looks like it's akin to a 'HELLO WORLD' first program, and I give considerable latitude to beginning programmers, which the forum seems to be full of. But that?s the point right?
I thought about letting shaham25 struggle with the syntax alone, and sometimes that?s that best way, but I?ve also learned that correcting can be a learning experience also.
I?d like to think of myself as a modern programmer, though by many criteria I?d be considered an antique. (Maybe I can get one of those ?historical? license plates to wear on my back?) I do all of my compiles through ENDEVOR, so all are batch compiles.
On a personal note, I?d like to commend you and several of the other members on the breadth and depth of your knowledge. I?ve enjoyed my participation in the forum and have learned many tricks by reading the posts.