View previous topic :: View next topic |
Author |
Message |
Milind Beginner
Joined: 29 Dec 2004 Posts: 26 Topics: 20
|
Posted: Tue Jul 12, 2005 12:21 am Post subject: Parameter passing to cobol program |
|
|
If there r 5 lines in SYSIN DD * and if use 6 accept stmts im my COBOL pgm whHat will Happend??
Will the program execute successfully or will it terminate?
Thanks and Regards,
Milind Deshmukh. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Jul 12, 2005 5:39 am Post subject: |
|
|
Milind,
Milind,
You are slowly getting on my nerves. Most of your questions are already answered and can be found doing a simple search. You will not recieve any more answers unless you follow the rules of this forum.
Code: |
1. Search before posting! Use meaningful topics (don't use the Forum name for the topic). Avoid putting "urgent" in your topics.
2. Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.
3. Provide feedback to members who try to help you.
|
Fyi.. Your program runs fine even when you have the accept verb 6 times when your sysin has only 5 lines. The last accept will have the value from line 5
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Wed Jul 13, 2005 4:01 am Post subject: |
|
|
Kolusu,
I tried with the following code. the last ACCEPT STATMENT IS READING SPACE. As you said the last accept will have the value from previous read it is not happening in my shop. is it compiler dependent? pls. clarify.
COBOL
IDENTIFICATION DIVISION.
PROGRAM-ID. CONDITIO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PIC X(1).
01 B PIC X(1).
01 C PIC X(1).
01 D PIC X(1).
01 E PIC X(1).
PROCEDURE DIVISION.
MAIN.
ACCEPT A.
ACCEPT B.
ACCEPT C.
ACCEPT D.
ACCEPT E.
DISPLAY 'A : ' A.
DISPLAY 'B : ' B.
DISPLAY 'C : ' C.
DISPLAY 'D : ' D.
DISPLAY 'E : ' E.
STOP RUN.
JCL
//STEP1 EXEC PGM=CONDITIO
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
A
B
C
D
/*
//
nadh |
|
Back to top |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Wed Jul 13, 2005 5:45 am Post subject: |
|
|
Code this a total of 5 times and see what happens
Code: |
ACCEPT A FROM SYSIN.
DISPLAY "A : " A.
|
_________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
 |
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Fri Jul 15, 2005 1:23 am Post subject: |
|
|
Hi
Even then it is same displaying space for last accept statment.
nadh. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Jul 27, 2005 7:45 am Post subject: |
|
|
Quote: |
Even then it is same displaying space for last accept statment.
|
nadh,
Are you sure ? try this code and tell me if you are displaying a space?
Code: |
PROCEDURE DIVISION.
ACCEPT A.
DISPLAY 'FIRST ACCEPT VALUE OF A : ' A.
ACCEPT A.
DISPLAY 'SECOND ACCEPT VALUE OF A : ' A.
ACCEPT A.
DISPLAY 'THIRD ACCEPT VALUE OF A : ' A.
ACCEPT A.
DISPLAY 'FOURTH ACCEPT VALUE OF A : ' A.
ACCEPT A.
DISPLAY 'FIFTH ACCEPT VALUE OF A : ' A.
STOP RUN.
|
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|