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
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 |
How do you submit JCL via a Cobol program?
what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.
Explain complete concept of table handling in COBOL with an example?
wht do u mean by (*,intrdr) wht is * used for ?
can I copy book which contain db2 statment in procedure divion?
what is redefines? where it can be effectively use for the purpose of memory utilization? give an example?
When can the USING phrase be included in the call statement ?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
How many maximum number of procedures can we write in one COBOL program?
hai friends ,i have HSBc exam on this sunday,my platform is Mainframe,i have 1 year exp,pls any one send me placement papers of Hsbc and technical questions on mainframe
6 Answers Citi Bank, CitiGroup, HSBC, iNautix, Wipro,
At the minimum, which division of COBOL is enough to be coded?
What is JOBLIB and STEPLIB in JCL? what is the purpose of using it?