I have a source program compiled with Cobol-2. The output
file has a record length of 100 defined in the program but
a record of 60 bytes getting written into it. i.e. The rest
of 40 bytes I am not Writing anything. But it by default
puts some values into the last 40 bytes. However it does
not impact anything. But when Compiled the module with
Enterprise Cobol the last 40 bytes were spaces as fillers.
Can anyone explain?
Answers were Sorted based on User's Feedback
Answer / ram.g
hi
Before writing into the output file, just explicitly give
move spaces to rest of fields..
eg: ww-filler pic x(40) value spaces.
move ww-filler to ww-out-rec(61:40)
write ww-out-rec.
i hope the above code will resovle your problem.
Happy coding,
Ram.G
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / ramanujam
it may be filled with null values. Junk charecters.
Due to before writing data it has to initialize.
That is the reason it is showing junk charecters.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / prashanth
IN THE CASE OF FB , IT WILL FILL SPACE I.E, FILLER, BUT IN
VARAIBLE MODE YOU CAN'T SEE SPACE OR FILLER.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / vish
I think you ppl are hitting on wrong direction for
answering this question. The question doesn't seem to be
asking how to resolve a junk character, instead it's asking
about the different behaviour of the same program in two
different versions of Cobol - COBOLII and Enterprise COBOL.
One is placing junk characters in the last 40 bytes and the
other one intialized it to spaces. Any possible answer from
anyone now...?
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sivakumar sekharannair
I will try to answer as per my understanding on the
behaviour.
With cobol-2 junk values- This is because the the 40 bytes
are not properly initialized and so the system puts some
junk values.
With enterprise cobol - spaces- I beleive that the
enterprise cobol before using an work arean intialize it by
itself and then use it. that is the reason why the unused
40 bytes had spaces.
My answer is just an assumption
| Is This Answer Correct ? | 1 Yes | 0 No |
What is the difference between goback, stop run and exit program in cobol?
Why we need to use redefine clause when we can define the variable seperately... what is actual need....
What is the difference between binary search and sequential search?
how many maximum no of variables can be declared in linkage section ?
How many times the loop runs here 01 a pic 9(2) value 10. perform para1 a times stop run. para1: move 20 to a.
If I want to increase the Limit in GDG. What should I do?
how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
HOW TO MOVE REDEFINES CLAUSE FROM INPUT TO OUTPUT ?
What is a subscript ?
How many maximum number of procedures can we write in one COBOL program?
what is rediffine clause?in what situation it can use?give me real time example?