| CLOSE PRINTER | 
 | (logical-printer-name) | 
 | 
| (printer-number) | 
This document covers the following topics:
For explanations of the symbols used in the syntax diagram, see Syntax Symbols.
Related Statements: AT END OF
                            PAGE | AT TOP OF
                            PAGE |DEFINE PRINTER |
                      DISPLAY |
                      EJECT |
                      FORMAT |
                      NEWPAGE |
                      PRINT |
                      SKIP |
                      SUSPEND IDENTICAL SUPPRESS
                      | WRITE |
                      WRITE TITLE |
                      WRITE TRAILER
Belongs to Function Group: Creation of Output Reports
The CLOSE PRINTER statement is used to close a specific
                       printer. With this statement, you explicitly specify in a program that a
                       printer is to be closed.
               
A printer is also closed automatically in one of the following cases:
when a DEFINE PRINTER
                               statement in which the same printer is defined again is executed;
                     
when command mode is reached.
| Syntax Element | Description | 
|---|---|
| logical-printer-name |  Logical Printer Name:  With the
                                         Naming conventions for the
                                         | 
| printer-number |  Printer Number: Alternatively to the
                                         The  Printer number 0 indicates the hardcopy printer. | 
** Example 'CLPEX1': CLOSE PRINTER                                      
************************************************************************
DEFINE DATA LOCAL                                                       
1 EMP-VIEW VIEW OF EMPLOYEES                                            
  2 PERSONNEL-ID                                                        
  2 NAME                                                                
  2 FIRST-NAME                                                          
  2 BIRTH                                                               
*                                                                       
1 #I-NAME (A20)                                                         
END-DEFINE                                                              
*                                                                       
DEFINE PRINTER (PRT01=1)                                                
*                                                                       
REPEAT                                                                  
  INPUT 'SELECT PERSON' #I-NAME                                         
  IF #I-NAME = ' '                                                      
    STOP                                                                
  END-IF                                                                
  FIND EMP-VIEW WITH NAME = #I-NAME                     
    WRITE (PRT01) 'NAME         :' NAME ',' FIRST-NAME  
           /      'PERSONNEL-ID :' PERSONNEL-ID         
           /      'BIRTH        :' BIRTH (EM=YYYY-MM-DD)
  END-FIND                                              
  /*                                                    
  CLOSE PRINTER (PRT01)                                 
  /*                                                    
END-REPEAT                                              
END