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



I have a source program compiled with Cobol-2. The output file has a record length of 100 defined ..

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

I have a source program compiled with Cobol-2. The output file has a record length of 100 defined ..

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

I have a source program compiled with Cobol-2. The output file has a record length of 100 defined ..

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

I have a source program compiled with Cobol-2. The output file has a record length of 100 defined ..

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

I have a source program compiled with Cobol-2. The output file has a record length of 100 defined ..

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

Post New Answer

More COBOL Interview Questions

Which division and paragraphs are mandatory for a COBOL program?

0 Answers  


What is difference between static and dynamic call in cobol?

0 Answers  


What does the INITIALIZE verb do?

1 Answers  


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

0 Answers  


what is meaning by design document? who can repared for this?

5 Answers   TCS,






A cobol program to read a file , match it with other if. If match occurs then write it to an output file. If no match then no need to write it.Error log created by program to track any error.

1 Answers  


IF I mention stop run in CICS what happens?

0 Answers   IBM,


WORKING-STORAGE SECTION. 01 VAR1 COMP-2 VALUE 0. PROCEDURE DIVISION. MOVE 10.2115 TO VAR1. DISPLAY 'VAR1 =' VAR1. GOBACK. 10.2115 is stored as .10211499999999996E 02 in OS VS Cobol 10.2115 is stored as .10211500000000000E 02 in ecobol. Any reason why?

3 Answers   TCS,


What happens in the background of spool when we submit a job for compilation and execution... This is a recent question in ibm...Kindly help me.....

3 Answers   IBM,


hw to create 3 dimensional array & hw to access it?

1 Answers  


what is the result of the following? DIVIDE A INTO B GIVING C. a.C=A/B b.the reminder of B/A is stored in C c.C=B/A d.the reminder of A/B is stored in C

3 Answers   TCS,


How many sections are there in data division?.

10 Answers   Amdocs, TCS,


Categories