Figure 6: Getter and setter for a data structure
D Cust_Address_t ds qualified D based(Template) D Street 25A D City 15A D State 2A D Zip 10A . . P cust_getAddress... P B export D cust_getAddress... D PI likeds(Cust_Address_t) D Addr ds likeds(Cust_Address_t) /free Addr.Street = %trimr(InCust.Street); Addr.City = %trimr(InCust.City ); Addr.State = %trimr(InCust.State ); Addr.Zip = %trimr(InCust.Zip ); return Addr; /end-free P E P cust_setAddress... P B export D cust_setAddress... D PI 1N D Addr likeds(Cust_Address_t) const /free . . . Code to Validate Address Goes Here . . . InCust.Street = Addr.Street; InCust.City = Addr.City; InCust.State = Addr.State; InCust.Zip = Addr.Zip; return *ON; /end-free P E