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 |
The disposition parameter in the jcl is share ( DISP+SHR ) and the program opens file in extend mode what will happen?
What guidelines should be followed to write a structured cobol prgm?
How arrays can be defined in COBOL?
how do u indetify files succesfully executed or not ?
How can you add a particular field/coloumn in copybook?
What is the difference between Structured COBOL Programming and Object Oriented COBOL ?
Which Search verb is equivalent to PERFORM…VARYING?
What is the maximum length of a field you can define using COMP-3?
4 Answers Complex System, Infosys,
The hierarchy of the execution of logical operators is (a) NOT AND OR (b) AND OR NOT (c) OR AND NOT (d) OR NOT AND
10 Answers Huawei, IBM, TCS,
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,
what is S04E error in jcl?
11 Answers IBM, L&T,
What are the two search techniques ?