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 |
I have sequential file recl 1000 i want to add another 15 bytes to it. The record length should not change..How?
What is the difference between a binary search and a sequential search?
Explain what you understand by passing by value.
Why we should use cursor ?
How to Pass table from a cobol program to another cobol program and how to use that table in called program
consider the following piece of code 01 GROSS-PAY 05 BASIC-PAY PIC 9(5) 05 ALLOWENCES PIC 9(3) if BASIC-PAY has a value 1000 and ALLOWENCES has a value of 250,what will be displayed by the statement DISPLAY GROSS-PAY a.1250 b.01000250 c.01250 d.1.250
what are the limitations of Inline Perform?
In COBOL programming, what is PERFORM? What is VARYING?
01 b pic +9(4) How many bytes it will take for storage???
have in 100 records in a flat file i want to move records like 1,3,5,7,9,11,.. to Output file1 and 2,4,6,8,10,12,14 .. records moved to Output file2..Pls Provide real time answer..
i need a small 3d program using inline and outline.
What guidelines should be followed to write a structured Cobol program?