Figure 2: Routines for initialization and cleanup

     D CEE4RAGE        PR

     D   procedure                     *   procptr const

     D   feedback                    12A   options(*omit)

     D Initialized     s              1N   inz(*ON)

        .

        .

     P cust_Init       B                   export

     D cust_Init       PI

      /free

         if (Initialized);

           return;

         endif;



         if not %open(CUSTFILE);

             open CUSTFILE;

         endif;

		
A
         



         CEE4RAGE( %paddr(Cust_Done): *omit );

		
B
         

         Initialized = *on;

      /end-free

     P                 E

        .

        .

     P cust_Done       B                   export

     D cust_Done       PI

      /free

         if %open(CUSTFILE);

           close CUSTFILE;

         endif;

         Initialized = *OFF;

      /end-free

     P                 E