Hi everyone,
The final part of our lab deals with order entry. We are using variable length records to allow for up to 10 items to be ordered in a single transaction. There is no stipulation on quantity of each item (well, actually 9(4)), just that no more than 10 items can be ordered. Here is the order-file rec:
(THESE ARE NOT MY DATA-NAMES)
01 ORDER-REC
05 ORD-DATE PIC X(8)
05 ORD-PO PIC X(6)
05 ORD-CUST-ID PIC X(5)
05 ORD-TOTAL-COST PIC 9(5)V99
05 NUM-OF-PRODUCTS PIC 9(2)
05 ORDERED-ITEMS
OCCURS 1 TO 10 TIMES
DEPENDING ON NUM-OF-PRODUCTS
10 ITEM-PROD-ID PIC X(5)
10 ITEM-QUANTITY PIC 9(4)
10 ITEM-UNIT-COST PIC 9(3)V99
10 ITME-TOTAL-COST PIC 9(4)V99
Since our book doesn't cover variable length records, I'm just wondering how this is handled.
I need the screen to show up to 10 lines of orders, entered one at a time. Does this get read in like a table and I display INFORMATION (SUB) for each line? I don't want the previous oreder line to dissappear when the next on is being accepted. Does the table get loaded after each order line is complete and the record only get written once to the order-file when the order is complete?
I'm also wondering how DEPENDING ON NUM-OF-PRODUCTS
works because the number of products (1 - 10) isn't known until after the order is complete...
I'm not looking for any code because I haven't really begun it myself, just a direction to go in. I think I'm on the right track, just not too sure. Thanks!
-Tyler
The final part of our lab deals with order entry. We are using variable length records to allow for up to 10 items to be ordered in a single transaction. There is no stipulation on quantity of each item (well, actually 9(4)), just that no more than 10 items can be ordered. Here is the order-file rec:
(THESE ARE NOT MY DATA-NAMES)
01 ORDER-REC
05 ORD-DATE PIC X(8)
05 ORD-PO PIC X(6)
05 ORD-CUST-ID PIC X(5)
05 ORD-TOTAL-COST PIC 9(5)V99
05 NUM-OF-PRODUCTS PIC 9(2)
05 ORDERED-ITEMS
OCCURS 1 TO 10 TIMES
DEPENDING ON NUM-OF-PRODUCTS
10 ITEM-PROD-ID PIC X(5)
10 ITEM-QUANTITY PIC 9(4)
10 ITEM-UNIT-COST PIC 9(3)V99
10 ITME-TOTAL-COST PIC 9(4)V99
Since our book doesn't cover variable length records, I'm just wondering how this is handled.
I need the screen to show up to 10 lines of orders, entered one at a time. Does this get read in like a table and I display INFORMATION (SUB) for each line? I don't want the previous oreder line to dissappear when the next on is being accepted. Does the table get loaded after each order line is complete and the record only get written once to the order-file when the order is complete?
I'm also wondering how DEPENDING ON NUM-OF-PRODUCTS
works because the number of products (1 - 10) isn't known until after the order is complete...
I'm not looking for any code because I haven't really begun it myself, just a direction to go in. I think I'm on the right track, just not too sure. Thanks!
-Tyler