INIT:
        /*  Call the module that opens the data set  */
        /*  and opens an SCL list for manipulating   */
        /*  the customer information.                */
     call method('company.customer.methods.scl','OPEN',
                  custlistid);
     call notify('newname','_gray_');
 return;

 NAME:
       /*  Call the module that searches for the  */
       /*  observation containing the name that   */
       /*  is specified.                          */
    call method('company.customer.methods.scl',
                'FIND',custlistid,name,sysrc);

       /*  Call the module that updates the values */
       /*  in the list.                            */
    link update;

       /*  If no customer was found by that name, then  */
       /*  display a message and do not allow the user  */
       /*  to try and rename the customer.              */
    if (sysrc = %sysrc(_sweof)) or (sysrc > 0) then
       do;
          call notify('newname','_gray_');
          _msg_='No customer found with that name.';
       end;
    else
       call notify('newname','_ungray_');
 return;

 NEWNAME:
         /*  Call the module that renames the customer. */
    call method('company.customer.methods.scl','RENAME',
       custlistid,newname,sysrc);

       /*  Call the module that updates the values */
       /*  in the list.                            */
    link update;

       /*  If the update was not successful, then print  */
       /*  an error message and reset the value of name. */
    if sysrc then
       _msg_ =
        'The customer could not be updated at this time.';

       /*  After the attempt to rename the customer,  */
       /*  clear the current new name value.          */
    newname = ' ';
 return;

 UPDATE:
       /*  Copy the values of the other variables  */
       /*  into the list.                          */
    name    = getnitemc(custlistid,'NAME');
    custnum = getnitemc(custlistid,'CUSTNUM');
    city    = getnitemc(custlistid,'CITY');
    state   = getnitemc(custlistid,'STATE');
    zipcode = getnitemc(custlistid,'ZIPCODE');
    phone   = getnitemc(custlistid,'PHONE');
    ord1dte = getnitemn(custlistid,'ORD1DTE');
 return;

 TERM:
        /*  Call the module that closes the data set.  */
     call method('company.customer.methods.scl','CLOSE',custlistid);
 return;