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


Please Help Members By Posting Answers For Below Questions

What are literals?

622


State the various causes of s0c1, s0c5 and s0c7.

655


explain sorting techniques in cobol program?

681


Why did you choose to work with ibm mainframe cobol programming?

623


How to print 10 to 1 if the input have only 10 digit number?

802






What kind of error is trapped by on size error option?

731


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

812


How do get the result of your program directly on your pc?

1871


What is the local-storage section?

669


For rewrite, why is it mandatory that file needs to be opened?

614


Define static linking and dynamic linking.

653


What type of SDLC u followed? Why?

1512


i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2095


Write a program to explain size error.

667


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

724