WHY LRECL NEEDS TO BE 4 EXTRA THEN THE COBOL FILE LENGTH &
WHAT IT CONTAIN IN THAT LENGTH

Answers were Sorted based on User's Feedback



WHY LRECL NEEDS TO BE 4 EXTRA THEN THE COBOL FILE LENGTH & WHAT IT CONTAIN IN THAT LENGTH..

Answer / mainframe.rahulz

First thing is we can see this kind of differece only in VB
files not in fixed block files.

LRECL of VB file will contain the maximum record length of
a file + 4 bytes RDW(Record Descriptor Word) field which
gives the length of the record as the file contains
variable record lengths.

Example : if we have EMP-FILE VB file which contains 80
THRU 100 CHARECTERS

So the LRECL of this file is going to be 100+4 which is 104
bytes.

Please do let me know in case of any comments/queries.

Is This Answer Correct ?    18 Yes 3 No

WHY LRECL NEEDS TO BE 4 EXTRA THEN THE COBOL FILE LENGTH & WHAT IT CONTAIN IN THAT LENGTH..

Answer / narinder

In JCL, LRECL NEEDS TO BE 4 EXTRA THAN THE COBOL FILE LENGTH in case of Variable Block File. Since length of each record varies in the file, the first 4 bytes contains the length of the corresponding record.

Please correct me if I am wrong.

Is This Answer Correct ?    8 Yes 2 No

Post New Answer

More COBOL Interview Questions

What is the difference between a subscript and an index in a table definition?

3 Answers   TCS,


Can we move X(9) to 9(9). If yes what are the ways for doing this?

3 Answers  


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

0 Answers   HCL,


i have a file which contains records like 10,30,90,50,20,40,80,60,70 i want to display these records in reverse order like 70,60,80,40,20,50,90,30,10 please give me the cobol code (do not sort the records)

3 Answers   Cap Gemini, Mind Tree,


Difference between lrecl, blksize among PS, PDS issues? i.e in jcl at dcb

1 Answers  






what happens of we dont give time stamp in precompilation process

2 Answers  


Difference between file status codes 02 and 22.... since both are for duplicate key detection.

1 Answers  


Suppose, file A has 100 records and file B has 500 records. We want to write records common to both A and B into file C and records which are present only in either A or B into another file D. What should be the logic of Cobol program to achieve this?

7 Answers   Bank Of America, Mind Tree,


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

2 Answers   IBM, Steria,


01 A pic 9(100) find record length of it

6 Answers   TCS,


What is the Purpose of Pointer in the string?

0 Answers  


I hv ten records in ps file and i hv say some 15 records in vsam file .i hv empno and age in ps file n empno,empname,dept n desig in vsam file. i hv 2 read the ps file n check wid matching empno in vsam file and then insert all fields from ps and vsam into db2 table....plz help in writin the procedure division

1 Answers  


Categories