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

How can you submit a job from COBOL programs?

2 Answers   ITC Infotech,


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

0 Answers  


how you read control card into array?

3 Answers   HCL,


consider the fallowing 77 stat pic 9. 88 male value 1,2,3. 88 female value 4 through7. what will be the value of stat a) set male to true. b) set female to true.

5 Answers  


hi, can you ppl tell me, how to check whether the rewrite we gave for the ksds file is successful or not in the program.? i gave rewrite, the rewrite code is executing and maxcc=0 but updation doenot happen in the file?

1 Answers   CGI,






how can you identify wheather the program is using search or search all in the cobol program?

5 Answers   iGate,


How many bytes will be allocated for the following record description entries? 01 REC-A. 05 A PIC S9(4). 05 B PIC XXXBXXX. 05 C PIC ____9.99. 05 D PIC S9(5) COMP-3. 05 E PIC 9(3) COMP.

16 Answers   IBM, TCS,


How to recover a deleted source physical file from library?

1 Answers   HCL,


1.What is the limit of linkage section?

4 Answers  


What COBOL construct is the COBOL II EVALUATE meant to replace?

1 Answers  


what is the coding difference between COBOL and CICS.

8 Answers   Cap Gemini,


What is different between variable length and fixed length?

2 Answers   TCS,


Categories