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 many times the loop runs here 01 a pic 9(2) value 10. perform para1 a times stop run. para1: move 20 to a.
what is the difference between Plan & package?
What is the local-storage section?
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
how to convert vsam table into DB2 table?
How to use the same cobol program in Batch and CICS onlines ? Please expalin with an example. Thanks in advance.
What is report-item?
whats the disadvantage of search all over search?
what is the minimum number of lines a Cobol program should have to successfully compile and run
11 Answers ABC, Societe Generale,
How do you define a sort file in JCL that runs the COBOL program?
How you can characterize tables in cobol?
What are the different ways to run a COBOL DB2 program using JCL?