Talk:Programming Fundamentals/Conditions/COBOL

Difficulties running this on the suggested development environments edit

I ran this program on each of the three suggested development environments.

Both jDoodle and TutorialsPoint, returned syntax errors at line 30, and for each subsequent line that attempted to use SET to assign a string to the variable.

Example diagnostic output is:

jdoodle.cobc: in paragraph 'MAIN':
jdoodle.cobc:30: error: SET target 'LABEL-IN' is not numeric, an INDEX or a POINTER
jdoodle.cobc:31: error: SET target 'LABEL-OUT' is not numeric, an INDEX or a POINTER
...

The program did compile and execute in paiza.IO, however I could not figure out how to enter the inputs. Entering F and 20 alone on separate lines in the input tab window did not work. Thanks! --Lbeaumont (discusscontribs) 15:15, 14 April 2020 (UTC)Reply

@Lbeaumont: Apparently, SET should only be used for numeric values. MOVE is used for text. Now corrected. For input, use something like:
F
100
F
100
The input is used twice, once in the IF example and once in the EVALUATE example. Tested on all three environments. -- Dave Braunschweig (discusscontribs) 16:11, 14 April 2020 (UTC)Reply
Thanks! --Lbeaumont (discusscontribs) 15:44, 15 April 2020 (UTC)Reply
Return to "Programming Fundamentals/Conditions/COBOL" page.