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!

PIC X and ACCEPT Problem. Please Help!! 1

Status
Not open for further replies.

marc79

Programmer
Apr 5, 2005
18
PH
Hi,
I'm a COBOL newbie and i'm stuck on what seems to be a simple problem. I'm currently using "SAMS teach yourself COBOL in 21 days", which uses MicroFocus code. But i use the free Fujitsu compiler with it. Anyways, the following code snippet doesn't behave properly:

...

DATA DIVISION.
WORKING-STORAGE SECTION.
01 THE-NAME PIC X(10).

PROCEDURE DIVISION.

PROGRAM-BEGIN.
DISPLAY "Enter your name".
ACCEPT THE-NAME.
DISPLAY "Hello " THE-NAME.
STOP RUN.

--------
For example, if enter my name 'Marc' and then press the ENTER key, it wont accept the output yet. Instead i have to type 10 characters until it will show the output. Obviously, this isn't how i want it to run.

Any suggestions? Does it have to do with the compiler?
 
I use version 7 of the Fujitsu compiler and have the same problem with the Accept verb. I have never tried to solve the problem since I rarely use the accept verb do to most of my programming is in Powercobol.

In reading the documentation it indicates that the following may solve your problem:

ACCEPT THE-NAME FROM CONSOLE.

Let me know how it goes.

etom
 
compile your program with option "WINMAIN"

Fujitsu COBOL is not very good with char mode.

If you wish to do it in char mode then use screen section instead.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Etom,
Thanks a lot for taking time to reply. I tried it out and it works. =)

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top