study the data discriptions and answer the questions given below
i)01 ORDER RECORD
05 OUT-HEADER PIC X(50)
05 ITEM-COUNT PIC 99
05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING
ON ITEM-COUNT
ii)01 NAME-AND-ADDRESS
05 N-AND-A-LINE OCCURES 5
05 LINE-LENGTH PIC P9
05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON
LINE-LENGTH
iii)01 SALES-LIST
05 SALESMAN-COUNT PIC 99
05 SALES PIC 9(6) OCCURS 1 TO 100
DEPENDING ON
SALESMAN-COUNT
iv)01 ORDER-RECORD
05 NO-OF-BRANDS PIC 99
05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON
NO-OF-BRANDS
which of the following is true?
a.i) and iii) are valid
b.i) and iv) are valid
c.i) and iii) are not valid
d.all are valid

Answers were Sorted based on User's Feedback



study the data discriptions and answer the questions given below i)01 ORDER RECORD ..

Answer / craig

Actually, none will compile because they are all missing
periods, and several have typos.

Assuming they all had periods where required, these are the
other errors...

i would not compile because ORDER RECORD needs a '-' ie.
ORDER-RECORD.

i)01 ORDER RECORD
05 OUT-HEADER PIC X(50)
05 ITEM-COUNT PIC 99
05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING
ON ITEM-COUNT

ii would not compile because LINE-LENGTH has a picture
clause of P9, which is invalid

ii)01 NAME-AND-ADDRESS
05 N-AND-A-LINE OCCURES 5
05 LINE-LENGTH PIC P9
05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON
LINE-LENGTH

iii will compile, but SALESMAN-COUNT cannot have a value
greater that 99

iii)01 SALES-LIST
05 SALESMAN-COUNT PIC 99
05 SALES PIC 9(6) OCCURS 1 TO 100
DEPENDING ON
SALESMAN-COUNT

iv will compile and has no errors other than missing
periods that I see.

iv)01 ORDER-RECORD
05 NO-OF-BRANDS PIC 99
05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON
NO-OF-BRANDS

Is This Answer Correct ?    3 Yes 1 No

study the data discriptions and answer the questions given below i)01 ORDER RECORD ..

Answer / suriya prakash

C IS THE ANSWER

Is This Answer Correct ?    0 Yes 0 No

study the data discriptions and answer the questions given below i)01 ORDER RECORD ..

Answer / ram.g

what's the wrong in option (i)? ...

Is This Answer Correct ?    0 Yes 0 No

study the data discriptions and answer the questions given below i)01 ORDER RECORD ..

Answer / prasanna

ORDER RECORD is not a valid declaration fo a group item. It
has to be ORDER-RECORD.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

how can we find total no of records in a file ....is there any utility......?

3 Answers   IBM,


Which of the following paragraphs is compulsory in every COBOL program? (a) SPECIAL-NAMES (b) PROGRAM-ID (c) FILE-CONTROL (d) OBJECT-COMPUTER

4 Answers  


What is the difference between perform … with test after and perform … with test before?

0 Answers  


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

2 Answers  


What will happen if we generate GDG +2 version instead of +1 version?

2 Answers   T systems,






I have a COBOL main program which is calling sub program, the number of calling parameters used in main program are 4 whereas in sub program it's 5. Sub program is passing 5 parameters back to main program Will there be any compilation error? Or main program parameters displays junk values?

1 Answers  


How is sign stored in Packed Decimal fields and Zoned Decimal fields?

6 Answers   ABC, HCL, TCS,


comp-3 field occupy?

5 Answers  


i have a variable block which is used in my cobol program as input file having records of 4080 after compilation while runing the program im getiing file attribut mismatch and it is saying tht the record length of the file is 4084 can any one knw the answer how to reslove it ?

2 Answers  


Is it possible to mutliply a comp variable with an comp-3 variable. Will there be any error if i do it?

3 Answers   IBM, UST,


consider the following two statements MOVE 10 TO N PERFORM PARA-X N TIMES STOP RUN PARA-X MOVE 5 TO N how many times PARA-X willbe exicuted? a.10 b.5 c.infinate d.execution error

6 Answers   ABCL, TCS,


How do you define a variable of COMP-1? COMP-2?

3 Answers  


Categories