Closes a specified or default stream opened by an INPUT-OUTPUT THROUGH statement.
This procedure uses a C program to recalculate the price of each item in inventory. Specifically, the C program increases the price of each item by 3% or by 50 cents, whichever is greater. The INPUT-OUTPUT THROUGH statement tells the procedure to get its input from, and send its output to, the r-iothru.p procedure. The INPUT-OUTPUT CLOSE statement resets the input source to the terminal and the output destination to the terminal.
r-iothru.p
FOR EACH Item NO-LOCK WHERE Item.ItemNum < 10: DISPLAY Item.ItemNum Item.Price LABEL "Price before recalculation". END. INPUT-OUTPUT THROUGH r-iothru UNBUFFERED. FOR EACH Item WHERE Item.ItemNum < 10: EXPORT Item.Price. SET Item.Price. END. INPUT-OUTPUT CLOSE. FOR EACH Item WHERE Item.ItemNum < 10 WITH COLUMN 40: DISPLAY Item.ItemNum Item.Price LABEL "Price after recalculation". END. |