home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv6.zip / vac22os2 / ibmcobol / samples / helloapp / helloapp.cbl next >
Text File  |  1997-12-18  |  1KB  |  39 lines

  1.       * ---------------------------------------------------
  2.       *    Visual Age for COBOL Sample Program
  3.       * ---------------------------------------------------
  4.        Identification Division.
  5.        Program-ID.  HELLOAPP.
  6.  
  7.        Data Division.
  8.        Working-Storage Section.
  9.  
  10.        01 Program-Work-Fields.
  11.           05 Input-name         Pic x(30).
  12.           05 Output-name        Pic x(37).
  13.  
  14.        01 Program-flags.
  15.           05 Loop-flag          Pic 9(01).
  16.              88 Loop-done       Value 1.
  17.  
  18.        Procedure Division.
  19.  
  20.            Initialize Program-work-fields
  21.                       Program-flags.
  22.  
  23.            Perform until Loop-done
  24.                Display " "
  25.                Display "Enter a name or Q to quit:"
  26.                Accept Input-name
  27.                If function upper-case (Input-name) = "Q"
  28.                   Set Loop-done to true
  29.                Else
  30.                   Move spaces to Output-name
  31.                   Move "Hello, " to Output-name (1:7)
  32.                   Move Input-name to Output-name (8:30)
  33.                   Display Output-name
  34.                End-if
  35.            End-perform.
  36.  
  37.            Goback.
  38.  
  39.