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

What is the difference between comp and comp-3 usage? Explain other COBOL usage?s.

3 Answers   IBM, Xansa,


how will u find out 3rd week's 2nd day using occurs ?

3 Answers   L&T,


how will u retreive value from a table.write it with syntex. 01 ws-table 05 ws-table1 occurs 10 times. 05 ws-table2 occurs 10 times. the above is 2 dimensional array..how will u retrieve 1st element of an array

3 Answers   ADP,


What is static and dynamic call in cobol?

0 Answers  


In an EVALUTE statement is the order of the WHEN clauses significant?

4 Answers  






what is call by value and call by reference ?

3 Answers   Infosys, ITC Indian Tobacco Company,


what is filler and what is use of filler

3 Answers   Syntel,


77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value zeros. move a to b what is the answers for both cases? IS it possible? Give me elementary move rules briefly......

8 Answers  


How to increase the logical record length of existing PS file?

7 Answers  


how would find total records in files using seqientional

1 Answers   HSBC,


How do u know what version of cobol u are using?

3 Answers  


How to remove 2 duplicate records and copy only one using job control language?

0 Answers  


Categories