can we read in input the file with a variable length ?
please , how ..could you help me ?

Answers were Sorted based on User's Feedback



can we read in input the file with a variable length ? please , how ..could you help me ?..

Answer / anjiii

yes we can read input file with variable length.

while declaring a file in a file section, have two file
records declared at zero level... ex.

FD
01 Var-data-1 pic x().
05
05
.
.

01 Var-data-2 pic x().

Is This Answer Correct ?    2 Yes 0 No

can we read in input the file with a variable length ? please , how ..could you help me ?..

Answer / sandy

can some one elaborat more on this....

Is This Answer Correct ?    0 Yes 0 No

can we read in input the file with a variable length ? please , how ..could you help me ?..

Answer / 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

More COBOL Interview Questions

can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move 'xy' to b. display a,b.

10 Answers   IBM,


Describe the cobol database components?

0 Answers  


can we read in input the file with a variable length ? please , how ..could you help me ?

3 Answers   EDS,


diffrence between z(2) and z9(2)

4 Answers   Cap Gemini,


In a program, there are 2 sections defined say SECTION-A and SECTION-B. There is a paragraph say CALC-INT in both the sections. If this para has to be called directly for SECTION-A, then PERFORM CALC-INT will not work as it is present in both sections. How the PERFORM statement has to be coded here?

5 Answers  






how we can reverse the string in the cobol for example satheesh can be reveresed as hseehtas

3 Answers   IBM,


How is sign stored in a comp-3 field?

7 Answers  


which one is the best of com and com-3.using of real time ?

7 Answers   Cap Gemini,


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

0 Answers  


Difference between ps, esds

3 Answers  


how to code in cobol while using variable block file?

1 Answers  


Name the divisions, which are available in a cobol program?

0 Answers  


Categories