Skip to content

PRAGMA Statement

The PRAGMA statement provides internal compiler control, for profiling. The first literal is the command sent to the compiler.

Format 1

PRAGMA “PROFILING” { literal-1 } ...

Format 2

PRAGMA “DUMP” { literal-1 } ...

Syntax:

literal-n is a character string.

General Rules:

  1. The PRAGMA “PROFILING” statement causes programs compiled with -fprofiling to report time measurements from the current PRAGMA statement to the next PRAGMA, or to the end of the program.
  2. The PRAGMA “PROFILING” statement should be entered in column 8, as in the Code Sample below.
  3. The PRAGMA “DUMP” statement causes a profiling report to be generated when executed. Profiling reports produced by the PRAGMA “DUMP” statement will overwrite previous PRAGMA “DUMP” files with the same name.

PRAGMA “PROFILING” Code Sample:

       PROCEDURE DIVISION. 
       . . . 
       PRAGMA "PROFILING" "STEP1". 
       . . . 
       PRAGMA "PROFILING" "STEP2".

PRAGMA “DUMP” Code Sample:

       PROCEDURE DIVISION. 
       . . . 
       PRAGMA "DUMP" "REPORT". 
       . . .
Back to top