How to remove the spaces at end of each record in the
output file Via COBOL program?
note: The file has a VB length

Answers were Sorted based on User's Feedback



How to remove the spaces at end of each record in the output file Via COBOL program? note: The fi..

Answer / rajesh

U can declare a copybook for the output file without spaces
and this will do.

Is This Answer Correct ?    2 Yes 2 No

How to remove the spaces at end of each record in the output file Via COBOL program? note: The fi..

Answer / mvramesh

I will explain this with an example. Lest assume the Maximum record length for VB file is 4000.

For every record you write, Move the actual record length value to RECORD-LENGTH, this would trim off the entire record beyond that length. If the data is populated only till 3000 bytes, move 3000 to RECORD-LENGTH which would trim off the last 1000 bytes.

I hope i answered your question.

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More COBOL Interview Questions

How do you reference the fixed block file formats from cobol programs

0 Answers  


wht is the difference between goto and perform stmts

7 Answers   DELL,


In my table having 3000 Records. How can I delete the 500th row? (we don't know what is data inside the table)

3 Answers   Keane India Ltd,


How many bytes do a s9 (7) comp-3 field occupy?

1 Answers  


S9(5)V9(2) occupies how many bytes memory ?

6 Answers   Cap Gemini,


If by mistake we MOVE a working storage variable into LINKAGE area. What will happen??

4 Answers   Accenture,


How to find How Many Lines in Sysin DD * Parameter Thru Cobol Coding? If any one knows the Answer Please Reply .....Thanks From Shree

3 Answers   Merrill Lynch,


Can anybody give me example of subscript and index

5 Answers  


If a file has 1000 records.. if i have to replace the first and last characters of the file with another character. how it can be done....

1 Answers   HCL,


Write a program to explain size error.

0 Answers  


for an INITIALIZE and what keyword allows for an override of the default.

2 Answers  


How To move a value to an array using move verb?

3 Answers   IBM,


Categories