Advertisement
justin_hanekom

cobol source skeleton

Feb 1st, 2025 (edited)
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 3.10 KB | None | 0 0
  1.       *> SPDX-License-Identifier: Unlicense
  2.  
  3.       *> ***************************************************************
  4.       *> outfile can be specified by setting any of the environment
  5.       *> variables:
  6.       *>     dd_outfile; or
  7.       *>     DD_outfile.
  8.       *>
  9.       *> If these environment variables do not exist then GnuCobol
  10.       *> searches for the file named by the literal outfile.
  11.       *>
  12.       *> If none of these methods return a valid file then the file
  13.       *> outfile will be used.
  14.  
  15.       *> ***************************************************************
  16.       *>  Date  Change Description
  17.       *> ====== ==================
  18.       *> xxyymm Initial release
  19.       *>
  20.       *> ***************************************************************
  21.        identification division.
  22.        program-id. main.
  23.  
  24.        environment division.
  25.        configuration section.
  26.        source-computer. posix.
  27.        object-computer. posix.
  28.        special-names.
  29.        repository.
  30.            function all intrinsic.
  31.  
  32.        input-output section.
  33.        file-control.
  34.  
  35.       *>     select
  36.       *>     assign to
  37.       *>     organization is
  38.       *>     .
  39.  
  40.        i-o-control.
  41.  
  42.        data division.
  43.        file section.
  44.  
  45.       *>     fd .
  46.       *>         01  .
  47.  
  48.        working-storage section.
  49.  
  50.        01  xxx constant as 42.
  51.  
  52.       *> 01  work-areas.
  53.  
  54.       *> 01  tables.
  55.  
  56.       *> 01  accumulators.
  57.  
  58.       *> 01  flags.
  59.  
  60.       *> copybooks
  61.  
  62.        local-storage section.
  63.  
  64.       *> ***************************************************************
  65.        linkage section.
  66.  
  67.        screen section.
  68.       /
  69.       *> ***************************************************************
  70.        procedure division.
  71.  
  72.        declaratives.
  73.        end declaratives.
  74.  
  75.       *> ===============================================================
  76.       *> The **mainline** section is the program entry point.
  77.       *> ===============================================================
  78.        mainline section.
  79.            goback.
  80.  
  81.       /
  82.       *> ===============================================================
  83.       *> Provide details of warnings and abends.
  84.       *> ===============================================================
  85.        display-exception section.
  86.  
  87.        display-soft-exception.
  88.            >>IF DEBUG DEFINED
  89.                reset trace
  90.                display
  91.                    "Exception-file: " exception-file upon syserr
  92.                end-display
  93.                display
  94.                    "Exception-status: " exception-status upon syserr
  95.                end-display
  96.                display
  97.                    "Exception-location: " exception-location
  98.                    upon syserr
  99.                end-display
  100.                display
  101.                    "Exception-statement: " exception-statement
  102.                    upon syserr
  103.                end-display
  104.                ready trace
  105.                .
  106.            >>END-IF
  107.  
  108.        display-hard-exception.
  109.            perform display-soft-exception
  110.            stop run returning 127
  111.            .
  112.  
  113.        end program main.
  114.  
Tags: cobol
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement