Talk:FLOW-MATIC

Latest comment: 12 years ago by T-bonham in topic BIG FAT note

Untitled

edit

Possibly a link to UNIVAC manuals at [1] would be useful? T-bonham 08:09, 2 September 2007 (UTC)Reply

BIG FAT note

edit

Looks more like BASIC than COBOL actually. Said: Rursus 07:55, 24 April 2008 (UTC)Reply


71.112.94.157 (talk) 04:14, 17 June 2008 (UTC)Reply

This program does not appear like it would actually work, though it does show lots of interesting constructs

 0) INPUT  INVENTORY FILE=A
           PRICE FILE=B,
    OUTPUT PRICED-INV FILE=C
           UNPRICED-INV FILE=D,
    HSP D.
 1) COMPARE PRODUCT-NO(A) WITH PRODUCT-NO(B) <--- we never READ ITEM A ever
    IF GREATER GO TO OPERATION 10;
    IF EQUAL GO TO OPERATION 5;
    OTHERWISE GO TO OPERATION 2.
 2) TRANSFER A TO D.
 3) WRITE ITEM D.
 4) JUMP TO OPERATION 8.    <--- why go to 8 if A < B, we just want to read A not both

 5) TRANSFER A TO C.   <-- when equal we found a priced product
 6) MOVE UNIT-PRICE(B) TO UNIT-PRICE(C).   <--- copy the price
 7) WRITE ITEM C. <-- write a priced product
 8) READ ITEM B; IF END OF DATA GO TO OPERATION 12.
 9) JUMP TO OPERATION 1.  <--- once modified this will go to step 2, moving things from A to D, with no end of file check on A

10) READ ITEM B; IF END OF DATA GO TO OPERATION 12.
11) JUMP TO OPERATION 1.

12) SET OPERATION 9 TO GO TO OPERATION 2.   <--- note self modifying code
13) JUMP TO OPERATION 2.

14) TEST PRODUCT-NO(B) AGAINST ZZZZZZZZZZZZ;  <--- note this line is not reachable
    IF EQUAL GO TO OPERATION 16;
    OTHERWISE GO TO OPERATION 15.
15) REWIND B.
16) CLOSE-OUT FILES C, D.
17) STOP. (END)
I believe Flow-Matic handled the first input file ('driver' file) automatically; opening it, reading a record on each cycle, closing it at EOF and going to the end-of-job section. That would explain why some logic appears to be missing from this program. T-bonham (talk) 22:03, 27 December 2012 (UTC)Reply
  NODES
Note 5
Project 6