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
Answer Posted / 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 |
Post New Answer View All Answers
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
Write a program to enter and display the names of students in a class using the occurs clause.
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
Why occurs cannot be used in 01 level in COBOL?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
Have you used comp and comp-3 in your project? And how?
what is the use of outrecord?
Explain what you understand by passing by value.
What are the different rules for performing sort operation?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
how to move the records from file to array table. give with code example
1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?
How you can read the file from bottom?