View previous topic :: View next topic
|
Author |
Message |
kailas girase
New User
Joined: 20 Nov 2008 Posts: 6 Location: New Bombay
|
|
|
|
I have tried below program but given compiler error for CONSOLE word.
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID HELLO1.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 IN-VAR1 PIC X(10) VALUE 'KAILAS '.
PROCEDURE DIVISION.
FIRST-PARA.
DISPLAY "Hello World".
ACCEPT IN-VAR1 FROM CONSOLE.
DISPLAY "HELLO " IN-VAR1.
STOP RUN.
|
|
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
I can tell you that even if you get this program to work, you probably will get an annoying call from someone in your organisation for wasting peoples' time tying up the master console.
This kind of programming you can do for your pc - not for a mainframe. I guess you're not programming on a scrap s/370 you have set up in your garage? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
There is a link at the top of the page to manuals. Click on it, find the COBOL Language Reference manual, and read section 6.2.1.1 on the ACCEPT statement. You will find that, if you want to use the word CONSOLE in your ACCEPT statement, you must identify it elsewhere in your COBOL program.
Additionally, as Kjeld said, many (probably almost all) sites prohibit ACCEPT FROM CONSOLE due to the vast number of messages already routed to the console and not wanting to waste operator time attempting to find out how to reply to an application message. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
I guess you're not programming on a scrap s/370 you have set up in your garage? |
No a PC is more than enough, less floor space, no air conditioning, less... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Hmm. Compiled and ran just fine for me. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
superk wrote: |
Hmm. Compiled and ran just fine for me. |
Do you have access to the operator console at your site, or did you liason with an operator to run this program?
Or it might possibly execute from a TSO command prompt using your terminal as console unit? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Kjeld wrote: |
Do you have access to the operator console at your site...? |
I'm on the Enterprise Automation Team, so yes I do. I couldn't do a lot of the job without that access. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Kailas Girase,
If you are going to work on a mainframe, suggest you forget that there is a system CONSOLE. . .
Most organizations no longer permit application code to interact with the system console. . . |
|
Back to top |
|
|
kailas girase
New User
Joined: 20 Nov 2008 Posts: 6 Location: New Bombay
|
|
|
|
Now I can concluse that "Its never possible to give keyboard input for cobol program". |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
"Its never possible to give keyboard input for cobol program". |
Incorrect.
It is possible (i.e. the compiler will successfully compile the code).
Well managed organizations do not permit this. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
It is possible, but it should not be used in this form. If you want users to key in data you should be using a TP environment like CICS or IMS.
Also the ISPF environment in TSO provide terminal input and output possibilities. |
|
Back to top |
|
|
|