input:- A 10 20 30 40 B 5 7 10 14 C 8 12 14 16....
output:- A = 100,B=36,C=50.
Here spaces are considered between numbers.
When we give input as above, the numbers should be added n
displayed.So please help me out.
Answers were Sorted based on User's Feedback
Answer / lalitha
Use Delimiter option in STRING function - COBOL to unstring
the numbers to variables and then sum it up.
| Is This Answer Correct ? | 2 Yes | 0 No |
lalitha can u just make it clear ...... n can u type the program if its possible.thanks anyways..
and dineshj ur answer is 50% correct n its not fully correct.I want to display the output at once.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / naba kishore
I am not clear this questions. Please clarify your question.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / dineshj
coding for that Here.
W-S SEC.
01 A.
05 FILLER PIC X(80) VALUES SPACES.
05 NUM1 PIC 9(3).
05 FILLER PIC X(80) VALUE SPACES.
05 NUM2 PIC 9(3).
05 FILLER PIC X(80) VALUE SPACES.
05 NUM3 PIC 9(3).
05 FILLER PIC X(80) VALUE SPACES.
05 NUM4 PIC 9(3).
05 FILLER PIC X(80) VALUE SPACES.
01 NUM5 PIC 9(4).
PRO-DIV.
ACCEPT NUM1.
ACCEPT NUM2.
ACCEPT NUM3.
ACCEPT NUM4.
COMPUTE NUM5 = NUM1 + NUM2 + NUM3 + NUM4 .
DISPLAY A.
This is the coding for your answer plese check it out
If it is wrong. Pls do let me know...
| Is This Answer Correct ? | 1 Yes | 6 No |
what is SYNCHRONIZATION?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
how many divisions are there in cobol
TYPES OF SORTINGS. which is more prefarable.
how can u redefine picx(10) with pic 9(6).
How does IDMS communicate with CICS?
How to open and see copy book ?
What is XDC ?
how do you reference the variable unblock file formats from cobol programs
What is SET TO TRUE all about, anyway?
what is rediffine clause?in what situation it can use?give me real time example?
What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'. 01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'. What will happen I want Display WS-VARX and WS-VARN?