Getting Started with TRANSACT (32247-90007)

44 Chapter2
Using Character Mode I/O
Adding Data to a Dataset
Figure 2-10. Program Using a Record Already Retrieved
6 We know that Transact already retrieved the record in order to do the
validation check in step 5. Therefore, by using the CURRENT option to get
the record out of the temporary storage area, we save both the physical
time of retrieving the record a second time and also simplify the program.
What if we need to change the cust-no to another value. Since this is a key item to IMAGE,
we have to treat it differently. One way is to delete the old record and add a new. The next
example shows this method.
1 system ex12,base=orders(";");
2 set(delimiter) "/";
3 list(auto) customer;
4 level;
5 data cust-no,check=customer;
6 get(current) customer;
7 display;
8 data(set) name:
street-addr:
city-state:
zipcode;
9 update customer;
10 end;