01 x pic s9(8) comp.
How will the following value be internally allocated
'18787'

Answers were Sorted based on User's Feedback



01 x pic s9(8) comp. How will the following value be internally allocated '18787' ..

Answer / kapil arya

Basically Comp Makes the word boundary.
(0 - 4) 2 Bytes (Half Word boundary)
(5-9) 4 Bytes (Full Word Boundary)
(10-18) 8 byte Double word Boundary

Because it is s9(8) Comp..
So I will take 4 byte to store the date.
And it will allocated like:
01 87 87 , will store in 3 byte and one byte will be free
or unused..



Guys or Girls i have one question...
Related to JCL
I have a jcl where in a step i have one DD statement where
i am concatinating the 3 dataset..so in next step i want to
override the 3rd dataset only.. So how can i override the
3rd dataset.. Please let me know the answer...
Thanks to All..

Is This Answer Correct ?    9 Yes 0 No

01 x pic s9(8) comp. How will the following value be internally allocated '18787' ..

Answer / santhosh vayathuri

Guys or Girls i have one question...
Related to JCL
I have a jcl where in a step i have one DD statement where
i am concatinating the 3 dataset..so in next step i want to
override the 3rd dataset only.. So how can i override the
3rd dataset.. Please let me know the answer...
Thanks to All..


FOR ABOVE QUESTION ANSER IS

//S1 EXEC PGM=PROG1
//DD1 DD DSN = X.Y.Z
// DD DSN = A.B.C
// DD DSN = M.N.O

//S2 EXEC PGM= PROG2
//S1.DD1 DD
// DD
// DD DSN =SAN.THO.SH


PLEASE LET ME KNOW IF I AM WRONG

Is This Answer Correct ?    4 Yes 0 No

01 x pic s9(8) comp. How will the following value be internally allocated '18787' ..

Answer / krishna chaitanya

the answer one is correct . he asked a question , how to
override 3 rd step .

we can do lik ths

step3.ddname which will override the DS .

if any wrong correct me .

Is This Answer Correct ?    0 Yes 1 No

01 x pic s9(8) comp. How will the following value be internally allocated '18787' ..

Answer / sheeba

hey acording to me...its 4 bytes.... if we convert the
above value to binary format dats how it stores rite
so...2power4(1
)+2p3(8)+2p2(7)+2p1(8)+2p0(7)=131....so 3 bytes...and 1
unused... totally 4 bytes......

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More COBOL Interview Questions

how you read control card into array?

3 Answers   HCL,


how to move the records from file to array table. give with code example

0 Answers   ADP, Syntel,


I have a occurs for 100 times but it has executed 101 time what could be the reason?

4 Answers  


What is 66 level number and where it is used in real time by software developers?

2 Answers   ITC Indian Tobacco Company, TCS,


How many maximum number of procedures can we write in one COBOL program?

5 Answers  






How many bytes S(8) comp field occupy and its maximum value?

0 Answers  


What is the difference between goback, stop run and exit program in cobol?

0 Answers  


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

0 Answers  


How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?

1 Answers  


Can the OCCURS clause be at the 01 level?

2 Answers  


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

2 Answers  


How you can characterize tables in cobol?

0 Answers  


Categories