can we read in input the file with a variable length ?
please , how ..could you help me ?
Answer Posted / kotagiriramachandra
we can read an input rec of variable length.For that u need
to declare
01 main-rec
05 rec-data pic x(m) <== m should be max length of rec
specified in file declaration(avg length, max length).
05 rec-len pic s9(4) comp
precedure div...
.
.
.
read infile at end...
else move in-rec into main-rec.
I think in this way we can do.If i'm wrong plz let me know..
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
What are the access modes of START statement?
What is link edit in cobol?
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.
What is an in line perform? When would you use it? Anything else you wish to say about it.
What is the difference between next sentence and continue in cobol programing language?
What guidelines should be followed to write a structured cobol prgm?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
What kind of error is trapped by on size error option?
How do you reference the following file formats from cobol programs?
Write a program that uses move corresponding.
How do you differentiate between cobol and cobol-ii?
What is a report item?
State the various causes of s0c1, s0c5 and s0c7.