Figure 1 - Free-format RPG specification

*..1....+....2....+....3....+....4....+....5....+....6....+....7...+....8

/Free

 Monitor;
   Read Custfile;        // Get next customer record

   Dow Not %Eof(Custfile);  // Keep looping while we have
a record
    Chain(n) StateCode Stafmt Stadata;

    If %Found;
     Eval(h) Tax = TaxableAmount * TaxRate;
    Else;
     Tax = 0;
    Endif;

    If %Scan (ユ/ユ: Custname) > 0;
     Exsr Adjustname;
    Endif;

    UpdCustomer(Company:CustomerNbr);
    Read Custfile; ;            // Get next customer record
   Enddo;

On-error;
  Dsply 'An error occurred.';       // Error processing goes here
  *Inlr = *On;
  Return;
Endmon;

/End-free