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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

HOw can I get the negative sign while deduct high value from low value

1790


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

3717


what is the difference between COBOL2 AND COBOL390?

2453


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

823


Give some examples of command terminators?

758






i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

1771


What are all the divisions of a COBOL program?

663


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

2730


Are you comfortable in cobol or jcl?

643


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

700


What is the default value(s) for an initialize? What keyword will allow for an override of the default?

661


What type of SDLC u followed? Why?

1520


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1906


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

748


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

1937