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

What is the difference between a DYNAMIC and STATIC call in COBOL?

2 Answers  


How to print 10 to 1 if the input have only 10 digit number?

0 Answers  


have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records...

2 Answers   ITC Indian Tobacco Company, PNP, TCS,


How to resolve the soc4 and soc7 errors?

5 Answers   IBM, RBS,


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

0 Answers  






why 02 level number can't be use as a separate level number like 01 or 77 ?

3 Answers  


wht happens if we dnt give scope terminator ?

4 Answers   TCS,


Can we move SPACES to numeric field and ZEROES to alphabetic field? If yes what are the way doing this?

6 Answers   T systems,


What is the difference between copy and include in cobol?

1 Answers  


01 a pic s9(5) value '-12345' how it will be stored

7 Answers   ACS,


How to increase the logical record length of existing PS file?

7 Answers  


What are the different ways to run a COBOL DB2 program using JCL?

2 Answers  


Categories