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 index and how to use two tables using index?

1 Answers  


how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?

4 Answers   TCS,


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

1 Answers  


What are the ways you can generate a copybook?

2 Answers  


What is an in line perform? When would you use it? Anything else you wish to say about it.

1 Answers  


What is a scope terminator give example?

1 Answers  


01 WS-NAME PIC X(10) OCCURES 2. by this we can get ws-name 2 times. My qustion is how can we access the second name

5 Answers   TCS,


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

1 Answers  


what is the use of outrecord?

1 Answers  


A cobol program to read a file , match it with other if. If match occurs then write it to an output file. If no match then no need to write it.Error log created by program to track any error.

1 Answers  


How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length

2 Answers   IBM, Wipro,


I have a File that has duplicate records. I need only those records that occur more than thrice.?

4 Answers   IBM, Wipro,


Categories