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
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 |
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 |
what is index and how to use two tables using index?
how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?
How to remove 2 duplicate records and copy only one using job control language?
What are the ways you can generate a copybook?
What is an in line perform? When would you use it? Anything else you wish to say about it.
What is a scope terminator give example?
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
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
what is the use of outrecord?
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.
How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length
I have a File that has duplicate records. I need only those records that occur more than thrice.?