COBOL/S言語コンバージョン・サービス

NEC・COBOL/S言語をCOBOLに変換します。(System−i版はWeb化対応も可能です)

以下にCOBOL/S言語をCOBOL言語に変換した例を掲載します。

プログラム例

変換前 COBOL/Sソース

      
       NOTE:
           発注業務 メイン処理
       NEND:

       :MACROB01 (TST040G,,)

           SELECT  TEST-FILE     ASSIGN  TEST-DS.

       :MACROB03 (TST040G)

       01  WK-SYORI-RITU    PIC 9(03).

       :MACROB04

       NOTE:
           開始処理
       NEND:

       PROC:   FILE-OPEN
           ENTRY:

           OPEN  INPUT  TEST-FILE.

           CALL:   READ-TEST

           WK-SYORI-RITU  := 0
           WHILE: (END-SW = 0)
               IF: (TEST-SYORI-RITU NOT = 0)
                   WK-SYORI-RITU  := TEST-SYORI-RITU
                   DISPLAY "##  RITU ## " TEST-SYORI-RITU
               END:
               CALL:   READ-TEST
           END:

           CLOSE TEST-FILE.
           END-SW  := 0
           OPEN I-O TEST-FILE.

           CALL:   READ-TEST

           EXIT:

       PROC:   READ-TEST
           ENTRY:

           READ TEST-FILE AT END MOVE 1 TO END-SW.

           EXIT:

       PROC:   FILE-CLOSE
           ENTRY:

           CLOSE       TEST-FILE.

           EXIT:

       PROC:   FUNC-MAIN
           ENTRY:

           TEST-SYORI-RITU   := WK-SYORI-RITU

           REWRITE TEST-REC

           CALL:   READ-TEST

           EXIT:

      
    

このページのトップへ戻る

変換後 COBOLソース(一部割愛)

      
      *NOTE:
      *    発注業務 メイン処理
      *NEND:
      *:MACROB01 (TST040G,,)
      *--- MACRO : MACROB01 ------------------------------------------
       IDENTIFICATION  DIVISION.
       PROGRAM-ID.     TST040G INITIAL.
       DATE-WRITTEN.   86-01-01.
       DATE-COMPILED.
      *
      *****************************************************************
       ENVIRONMENT     DIVISION.
       CONFIGURATION   SECTION.
       SOURCE-COMPUTER. IBM-I-SERIES.
       OBJECT-COMPUTER. IBM-I-SERIES.
      *
       INPUT-OUTPUT    SECTION.
      *--- MACRO-END : MACROB01 --------------------------------------
           SELECT TEST-FILE ASSIGN TO DATABASE-TEST.
      *****************************************************************
       DATA            DIVISION.
       FILE            SECTION.
       FD  TEST-FILE.
       01 TEST-FILE-REC.
           COPY   FDTEST
      *--- MACRO-END : MACROB02 --------------------------------------
      *****************************************************************
       WORKING-STORAGE SECTION.

           中略

       01  WK-SYORI-RITU    PIC 9(03).

      *****************************************************************
       PROCEDURE       DIVISION.
           中略

      *NOTE:
      *    開始処理
      *NEND:

       FILE-OPEN SECTION.
       FILE-OPEN-ENTRY.

           OPEN INPUT TEST-FILE.

           PERFORM READ-TEST.

           MOVE 0 TO WK-SYORI-RITU.
           PERFORM UNTIL NOT (END-SW = 0)
               IF (TEST-SYORI-RITU NOT = 0)
                   MOVE TEST-SYORI-RITU TO WK-SYORI-RITU
                   DISPLAY "##  RITU ## " TEST-SYORI-RITU
               END-IF
               PERFORM READ-TEST
           END-PERFORM.

           CLOSE TEST-FILE.
           MOVE 0 TO END-SW.
           OPEN I-O TEST-FILE.

           PERFORM READ-TEST.

       FILE-OPEN-EXIT. EXIT.


       READ-TEST SECTION.
       READ-TEST-ENTRY.

           READ TEST-FILE AT END MOVE 1 TO END-SW.

       READ-TEST-EXIT. EXIT.


       FILE-CLOSE SECTION.
       FILE-CLOSE-ENTRY.

           CLOSE TEST-FILE.

       FILE-CLOSE-EXIT. EXIT.

           以下省略



      
    

このページのトップへ戻る