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

in real time what is the suitable exp where in-stream procedure is better then catalog procedure.

1 Answers  


In an EVALUTE statement is the order of the WHEN clauses significant?

4 Answers  


i have two file, each file having : file1 is having 2 fields field1 field2 file2 is having 3 fields field1 field2 field3 my req is to make it one file like: field1 field2 field1 field2 field3 if anyone know please send me syntax, i tried this with DFSORT but could not succeed.

9 Answers   Syntel,


What are the divisions in a cobol program?

1 Answers  


What is the difference between CALL BY VALUE and CALL BY CONTENT?

7 Answers  






what is record label is empty or standard in file description of data division?

2 Answers   HCL,


How to read records from flat file in reverse order through COBOL program?

14 Answers   Accenture, Broadridge, IBM, MAT, Polaris, SPIC, Syntel, TCS, Wipro,


01 MOVE 10 TO N 05 PERFOM PARA1 TIMES STOP RUN WAT WILL HAPPEN?? WILL IT RUN INFINITELY OR AN ERROR WIL BE THER BECAUSE NO OF TIMES IS NOT GIVEN??

1 Answers  


How can we increase the size of an existing PDS to include more no. of modules.

3 Answers  


how to transfer the file from pc to mainframe??

5 Answers   TCS,


how many subpgms we can use in a main pgm ? how do u link sub pgm to main pgm ? how can i use the parameters declared in main pgm to sub pgm ?

2 Answers   TCS,


What will happen if we move SPACES to numeric field and ZEROES to alphabetic field?

2 Answers  


Categories