Getting Started with TRANSACT (32247-90007)

Chapter 2 45
Using Character Mode I/O
Adding Data to a Dataset
Figure 2-11. Program to Change a Key Field Value
8 The DELETE statement removes the old customer record.
9 This DATA statement overrides the default prompt for a data field,
substituting the prompt enter new cust-no. It also verifies that this new
customer does not already exist.
10 The temporary storage area still contains the values for the old customer
that we just deleted. The user may change any of these values or leave
them as is by pressing [[RETURN]] to any of the prompts.
11 The new customer record is added to the dataset.
1 system ex13,base=orders(";");
2 set(delimiter) "/";
3 list(auto) customer;
4 level;
5 data cust-no,check=customer;
6 get(current) customer;
7 display;
8 delete(current) customer;
9 data cust-no ("enter new cust-no"),checknot=customer;
10 data(set) name:
street-addr:
city-state:
zipcode;
11 put customer;
12 end;