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 |
How To move a value to an array using move verb?
what is the advantage of using redefines instead of delaring the variables ?
can we read records in a file from botom to top. if possible how can we read
Are you comfortable in cobol or jcl?
What is SET TO TRUE all about, anyway?
What is the difference between external and global variables in COBOL?
which certifications r 4 cobol,jcl,db2,cics what is format of xam n what is importance of these certifications... plz post answer only if u r sure... thanks
What was removed from COBOL in the COBOL II implementation?
What is R-mode and A-mode?
If you were passing a table via linkage, which is preferable - a subscript or an index?
i have the job which has written updated 100 records into the table and for 101th record it got abended and i want to start the job again and should wirte from 101th record not from 1st record..how to do it..?
I have a sequential file of 100 records. How do I load the records into a two dimensional array ?