Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie need some help

Status
Not open for further replies.

cobman

Programmer
Oct 27, 2004
4
NO
Hello!
Brand new to cobol. Trying to make a simple program. Get no compiler errors but "answer" shows nothing when i press the calculate button "mybutton".
Dont have any books yet, so im kind a lost here...
Can anyone help? :)

Thanks,
cobman



Source:

03 PK-S-NUMBER1 PIC 9(3).
03 PK-S-NUMBER2 PIC 9(3).
03 PK-S-ANSWER PIC 9(10).


50 MYBUTTON VALUE 66.


WHEN MYBUTTON
COMPUTE PK-S-ANSWER = PK-SNUMBER1 + PK-S-NUMBER2.
DISPLAY PK-S-ANSWER.
EXIT.



Screen:

05 PK-H-NUMBER1, ENTRY-FIELD, RIGHT
COL 20 LINE 19,50 LINES 1 SIZE 6
ID IS 31 BEFORE PROCEDURE IS VIS-KOMMENTAR
3-D, ENABLED 1 VALUE PK-S-NUMBER1.


05 PK-H-NUMBER2, ENTRY-FIELD, RIGHT
COL 20 LINE 21,50 LINES 1 SIZE 6
ID IS 32 BEFORE PROCEDURE IS VIS-KOMMENTAR
3-D, ENABLED 1 VALUE PK-S-NUMBER2.


05 PK-H-ANSWER, ENTRY-FIELD, RIGHT
COL 20 LINE 19,50 LINES 1 SIZE 6
3-D, ENABLED 0, ID IS 33, VALUE PK-S-ANSWER.



03 PK-H-PUSH-MYBUTTON PUSH-BUTTON “calculate”
COL 28 LINE 29,50 LINES 19 SIZE 17
ID IS 35 ENABLED = 1 SELF-ACT
TERMINATION-VALUE = MYBUTTON.
 
What compiler are you using? (The code is NOT very "standard" COBOL - but may well be allowed by some)

Bill Klein
 
Yes, its acuCobol. Didnt know it was any different from regular Cobol??...
A friend of mine is working as a Cobol programmer, so Im just borowing a laptop from him with a Cobol compiler. Compiler is AcuBench 5.2.. He is out of town for a while, so he cant help me at the moment.
I just wonder whats not "standard" Cobol in my code?? Actually I just looked at some of my friends code, and then try to make something.. I have never seen a cobol source before, so im just "guessing"..
I recive a book in a few days, so that should help..
Sams teach yourself Cobol in 24 days.. is it any good??
 
Cobman -

Basically any screen interaction is non-standard (at least through the 1985 standard). Each COBOL vendor handles it differently.

IIRC, Teach yourself COBOL in 24 days comes with a minimal version of the Fujitsu compiler so it won't help with the AcuCOBOL screen IO problems you've got.

It's likely that you're never getting to the compute statement. Have you tried setting breakpoints in the code and stepping through it?

Regards.

Glenn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top