*—————————————————————-
* 得意先マスタ一覧表
*
* 080516 新規作成
*—————————————————————-
IDENTIFICATION DIVISION.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
*—————— Super Visual Formade ————————
special-names. call-convention 74 is WINAPI.
*—————————————————————-
WORKING-STORAGE SECTION.
*—————————————————————-
* Visual COBOL (WORKING-STORAGE SECTION の下に追加)
*—————————————————————-
01 pp procedure-pointer.
COPY \IJS10\CPBTRDT.CPY.
COPY \IJS10\CPIIIDT.CPY.
COPY KANRI.CPY.
COPY \IJS10\PRINTER.WOR.
COPY \IJS10\WFILE1.WOR.
COPY AAAFILE.CPY.
COPY TOKUI.CPY.
01 GLOVL-AREA.
02 SW-AREA.
03 CTL-SW PIC 9(002).
03 PGM-SW PIC 9(001) VALUE 1.
03 DAGA-SW PIC 9(001).
01 MESSAGE-AREA.
02 MES0.
03 PIC X(011) VALUE “System Err/”.
03 MES-0 PIC X(053).
77 GIYONO PIC 9(002) VALUE 35.
01 W-WORK.
02 PAGEX PIC 9(006).
02 GX PIC 9(002).
02 PAGEW PIC 9(006).
02 PGX PIC 9(006).
77 DX PIC 9(002).
01 W-MES.
02 W-MES1 PIC X(30) VALUE “PageUP:前ページ PageDown:次ペ”.
02 W-MES2 PIC X(30) VALUE “ージ Esc:終了 “.
02 W-MES3 PIC X(08) VALUE ” “.
*────────────────────────────────
* WFILE エリア
*────────────────────────────────
01 WW1-REC.
02 WW1-PAGE PIC 9(006).
02 WW1-GIYO PIC 9(002).
02 FILLER PIC X(056).
02 WW1-TCODE.
03 WW1-TC1 PIC 9(004).
03 WW1-TC2 PIC 9(004).
02 WW1-TNAME PIC X(040).
02 WW1-TEL PIC X(015).
02 WW1-FAX PIC X(015).
*────────────────────────────────
* プリント エリア
*────────────────────────────────
01 H1REC.
02 H1YTC1 PIC ZZZZ.
02 H1YTC2 PIC ZZZZ.
02 H1MTC1 PIC ZZZZ.
02 H1MTC2 PIC ZZZZ.
02 H1PAGE PIC ZZZZ.
02 H1ENDPAGE PIC ZZZZ.
01 I1REC.
02 I1TC1 PIC ZZZZ.
02 I1TC2 PIC ZZZZ.
02 I1TNAME PIC X(040).
02 I1TEL PIC X(015).
02 I1FAX PIC X(015).
*────────────────────────────────
* 画面フィールド
*────────────────────────────────
01 V2-REC.
02 V2-YTCODE.
03 V2-YTC1 PIC 9(004).
03 V2-YTC2 PIC 9(004).
02 V2-MTCODE.
03 V2-MTC1 PIC 9(004).
03 V2-MTC2 PIC 9(004).
02 V2-PAGE PIC 9(006).
02 V2-ENDPAGE PIC 9(006).
02 V2-YPAGE PIC 9(006).
02 V2-MPAGE PIC 9(006).
02 V2-K1 PIC 9(006).
02 V2-OK PIC X(001).
*────────────────────────────────
* 連 絡 節
*────────────────────────────────
LINKAGE SECTION.
01 LN-REC.
02 LN-KR PIC 9(002).
*────────────────────────────────
* 手続き部
*────────────────────────────────
PROCEDURE DIVISION USING LN-REC.
*—————————————————————-
* Visual COBOL (PROCEDURE DIVISION の下に追加)
*—————————————————————-
set pp to entry “MFFH”.
*────────────────────────────────
* プログラム 開始
*────────────────────────────────
PROC-EN.
PERFORM INIT-EN THRU INIT-EX UNTIL PGM-SW NOT = 1.
PERFORM MAIN-EN THRU MAIN-EX UNTIL PGM-SW NOT = 2.
PERFORM TERM-EN THRU TERM-EX UNTIL PGM-SW NOT = 3.
PROC-EX.
EXIT.
*────────────────────────────────
* プログラム 開始
*────────────────────────────────
INIT-EN.
PERFORM READKR-EN THRU READKR-EX.
PERFORM SCR-EN THRU SCR-EX.
PERFORM OPEN-TOKUI THRU OPEN-TOKUI-EX.
MOVE 1 TO CTL-SW.
MOVE 2 TO PGM-SW.
INIT-EX.
EXIT.
*────────────────────────────────
* メイン ループ
*────────────────────────────────
MAIN-EN.
PERFORM SUB1-EN THRU SUB1-EX UNTIL CTL-SW NOT = 1.
PERFORM SUB2-EN THRU SUB2-EX UNTIL CTL-SW NOT = 2.
PERFORM SUB3-EN THRU SUB3-EX UNTIL CTL-SW NOT = 3.
PERFORM SUB4-EN THRU SUB4-EX UNTIL CTL-SW NOT = 4.
PERFORM SUB5-EN THRU SUB5-EX UNTIL CTL-SW NOT = 5.
IF CTL-SW = 99 MOVE 3 TO PGM-SW.
MAIN-EX.
EXIT.
*────────────────────────────────
* プログラム 終了
*────────────────────────────────
TERM-EN.
PERFORM CLOSE-TOKUI THRU CLOSE-TOKUI-EX.
EXIT PROGRAM.
TERM-EX.
EXIT.
*────────────────────────────────
* 初 期 処 理
*────────────────────────────────
SUB1-EN.
MOVE 1 TO VR-MODE.
MOVE 1 TO PX.
DISPLAY “put|PORT|” KR-PORT(PX).
INITIALIZE V2-REC.
MOVE 2 TO CTL-SW.
SUB1-EX.
EXIT.
*────────────────────────────────
* 画 面 入 力
*────────────────────────────────
SUB2-EN.
DISPLAY “@input|/nextv”.
ACCEPT ITS-FUNC.
DISPLAY “@fnamef|/cur”.
ACCEPT ITS-NAME.
DISPLAY “@code|/cur”.
ACCEPT ITS-CODE.
DISPLAY “clear|MS”.
EVALUATE TRUE
*終了
WHEN ITS-FUNC = 111
MOVE 99 TO CTL-SW
WHEN ITS-NAME = “YTC1”
DISPLAY “@get|YTC1”
ACCEPT V2-YTC1
WHEN ITS-NAME = “YTC2”
DISPLAY “@get|YTC2”
ACCEPT V2-YTC2
IF ITS-FUNC = 121
DISPLAY “position|YTC1”
END-IF
WHEN ITS-NAME = “MTC1”
DISPLAY “@get|MTC1”
ACCEPT V2-MTC1
IF ITS-FUNC = 121
DISPLAY “position|YTC2”
END-IF
WHEN ITS-NAME = “MTC2”
DISPLAY “@get|MTC2”
ACCEPT V2-MTC2
IF ITS-FUNC = 121
DISPLAY “position|MTC1”
ELSE
MOVE 3 TO CTL-SW
END-IF
END-EVALUATE.
SUB2-EX.
EXIT.
*────────────────────────────────
* 初期処理
*────────────────────────────────
SUB3-EN.
DISPLAY “aclear|I1TC101|ENDPAGE|”
DISPLAY “put|MS|” “画面表示用ページ作成中”.
INITIALIZE V2-K1 W-WORK.
PERFORM W1-OPEN THRU W1-OPEN-EX.
INITIALIZE TO-REC.
MOVE V2-YTCODE TO TO-TCODE.
PERFORM GETGE-TOKUI THRU GETGE-TOKUI-EX.
MOVE B-STAT TO EOD.
PERFORM UNTIL 0 NOT = EOD
OR V2-MTCODE < TO-TCODE
ADD 1 TO V2-K1
DISPLAY “put|K1|” V2-K1
PERFORM WW1-EN THRU WW1-EX
PERFORM GETNEXT-TOKUI THRU GETNEXT-TOKUI-EX
MOVE B-STAT TO EOD
END-PERFORM.
DISPLAY “put|ENDPAGE|” V2-ENDPAGE.
DISPLAY “clear|K1”.
MOVE 1 TO PAGEW.
PERFORM WW1-DISP-EN THRU WW1-DISP-EX.
MOVE 4 TO CTL-SW.
SUB3-EX.
EXIT.
*────────────────────────────────
* 画面表示
*────────────────────────────────
SUB4-EN.
DISPLAY “@input|OK”.
ACCEPT ITS-FUNC.
EVALUATE TRUE
*終了
WHEN ITS-FUNC = 111
OR = 194
PERFORM W1-CLOSE THRU W1-CLOSE-EX
DISPLAY “clear|MS”
PERFORM SCR-EN THRU SCR-EX
MOVE 2 TO CTL-SW
*印刷
WHEN ITS-FUNC = 193
MOVE V2-PAGE TO V2-YPAGE
MOVE V2-ENDPAGE TO V2-MPAGE
PERFORM WINDOW-P-EN THRU WINDOW-P-EX
MOVE 5 TO CTL-SW
WHEN ITS-FUNC = 142
PERFORM PR-SELECT-EN THRU PR-SELECT-EX
WHEN ITS-FUNC = 121
OR = 191
IF 1 < V2-PAGE COMPUTE PAGEW = V2-PAGE – 1 PERFORM WW1-DISP-EN THRU WW1-DISP-EX ELSE DISPLAY “put|MS|” “最初のページです。 ” END-IF WHEN ITS-FUNC = 122 OR = 192 IF V2-ENDPAGE > V2-PAGE
COMPUTE PAGEW = V2-PAGE + 1
PERFORM WW1-DISP-EN THRU WW1-DISP-EX
ELSE
DISPLAY “put|MS|” “最後のページです。 “
END-IF
END-EVALUATE.
SUB4-EX.
EXIT.
*—————————————————————-
* 印刷ページ 入力
*—————————————————————-
SUB5-EN.
DISPLAY “@input|/nextv”.
ACCEPT ITS-FUNC.
DISPLAY “@fnamef|/cur”.
ACCEPT ITS-NAME.
DISPLAY “@code|/cur”.
ACCEPT ITS-CODE.
DISPLAY “clear|MS”.
EVALUATE TRUE
*終了
WHEN ITS-FUNC = 111
DISPLAY “restore”
MOVE 4 TO CTL-SW
WHEN ITS-NAME = “YPAGE”
DISPLAY “@get|YPAGE”
ACCEPT V2-YPAGE
WHEN ITS-NAME = “MPAGE”
DISPLAY “@get|MPAGE”
ACCEPT V2-MPAGE
IF ITS-FUNC = 121
DISPLAY “position|YPAGE”
ELSE
DISPLAY “put|OK|” “Y”
DISPLAY “put|MS|”
“印刷しますか? Y:はい N:いいえ”
DISPLAY “position|OK”
END-IF
WHEN ITS-NAME = “OK”
DISPLAY “@get|OK”
ACCEPT V2-OK
IF V2-OK = “Y”
OR V2-OK = “y”
DISPLAY “restore”
PERFORM PRINT-EN THRU PRINT-EX
PERFORM WINDOW-P-EN THRU WINDOW-P-EX
END-IF
DISPLAY “position|YPAGE”
END-EVALUATE.
SUB5-EX.
EXIT.
*────────────────────────────────
* 作業ファイル作成
*────────────────────────────────
WW1-EN.
PERFORM GIYO-COUNT-EN THRU GIYO-COUNT-EX.
INITIALIZE WW1-REC.
MOVE PAGEX TO WW1-PAGE.
MOVE GX TO WW1-GIYO.
MOVE TO-TC1 TO WW1-TC1.
MOVE TO-TC2 TO WW1-TC2.
MOVE TO-TNAME TO WW1-TNAME.
MOVE TO-TEL TO WW1-TEL.
MOVE TO-FAX TO WW1-FAX.
MOVE WW1-REC TO W1-REC.
PERFORM INSERT-WFILE1 THRU INSERT-WFILE1-EX.
IF 0 NOT = B-STAT
DISPLAY “put|MS|” “WFILE1 INSERT ERR”
DISPLAY “@input|OK”
ACCEPT ITS-FUNC
END-IF.
WW1-EX.
EXIT.
GIYO-COUNT-EN.
IF GIYONO > GX
ADD 1 TO GX
ELSE
MOVE 1 TO GX
END-IF.
IF 1 = GX
ADD 1 TO PAGEX
MOVE PAGEX TO V2-ENDPAGE
END-IF.
GIYO-COUNT-EX.
EXIT.
*────────────────────────────────
* ページ 表示
*────────────────────────────────
WW1-DISP-EN.
INITIALIZE WW1-REC.
MOVE PAGEW TO WW1-PAGE.
MOVE WW1-REC TO W1-REC.
PERFORM GETGE-WFILE1 THRU GETGE-WFILE1-EX.
MOVE B-STAT TO EOD.
MOVE W1-REC TO WW1-REC.
PERFORM DISP-HEAD-EN THRU DISP-HEAD-EX.
PERFORM UNTIL 0 NOT = EOD
OR PAGEW NOT = WW1-PAGE
PERFORM DISP-ITEM-EN THRU DISP-ITEM-EX
PERFORM GETNEXT-WFILE1 THRU GETNEXT-WFILE1-EX
MOVE B-STAT TO EOD
MOVE W1-REC TO WW1-REC
END-PERFORM.
ADD 1 TO GX.
PERFORM VARYING DX FROM GX BY 1 UNTIL DX > GIYONO
DISPLAY “aclear|I1TC1″DX”|I1FAX”DX”|”
END-PERFORM.
IF GIYONO > GX
DISPLAY “put|MS|” “最後のページです。 Esc:終了”
ELSE
DISPLAY “put|MS|” W-MES
END-IF.
WW1-DISP-EX.
EXIT.
*────────────────────────────────
* HEAD 表示
*────────────────────────────────
DISP-HEAD-EN.
DISPLAY “put|YTC1|” V2-YTC1.
DISPLAY “put|YTC2|” V2-YTC2.
DISPLAY “put|MTC1|” V2-MTC1.
DISPLAY “put|MTC2|” V2-MTC2.
DISP-HEAD-EX.
EXIT.
*────────────────────────────────
* ITEM 表示
*────────────────────────────────
DISP-ITEM-EN.
MOVE WW1-PAGE TO PAGEX.
MOVE WW1-GIYO TO GX.
IF 1 = GX
MOVE PAGEX TO V2-PAGE
DISPLAY “put|PAGE|” V2-PAGE
END-IF.
PERFORM WW1-I1-EN THRU WW1-I1-EX.
DISPLAY “put|I1TC1″GX”|” I1TC1.
DISPLAY “put|I1TC2″GX”|” I1TC2.
DISPLAY “put|I1TNAME”GX”|” I1TNAME.
DISPLAY “put|I1TEL”GX”|” I1TEL.
DISPLAY “put|I1FAX”GX”|” I1FAX.
DISP-ITEM-EX.
EXIT.
*—————————————————————–
* WW2 → I1
*—————————————————————–
WW1-I1-EN.
MOVE SPACE TO I1REC.
MOVE WW1-TC1 TO I1TC1.
MOVE WW1-TC2 TO I1TC2.
MOVE WW1-TNAME TO I1TNAME.
MOVE WW1-TEL TO I1TEL.
MOVE WW1-FAX TO I1FAX.
WW1-I1-EX.
EXIT.
*—————————————————————–
* 印刷
*—————————————————————–
PRINT-EN.
INITIALIZE V2-K1.
MOVE “AAA904A.FRM” TO P-FORM-NAME1.
PERFORM PR-INIT THRU PR-INIT-EX.
PERFORM VARYING PGX FROM V2-YPAGE BY 1 UNTIL PGX > V2-MPAGE
INITIALIZE WW1-REC
MOVE PGX TO WW1-PAGE
MOVE WW1-REC TO W1-REC
PERFORM GETGE-WFILE1 THRU GETGE-WFILE1-EX
MOVE B-STAT TO EOD
MOVE W1-REC TO WW1-REC
PERFORM HEAD-EN THRU HEAD-EX
PERFORM UNTIL 0 NOT = EOD
OR PGX NOT = WW1-PAGE
ADD 1 TO V2-K1
DISPLAY “put|K1|” V2-K1
MOVE WW1-GIYO TO CNT
PERFORM ITEM-EN THRU ITEM-EX
PERFORM GETNEXT-WFILE1 THRU GETNEXT-WFILE1-EX
MOVE B-STAT TO EOD
MOVE W1-REC TO WW1-REC
END-PERFORM
CALL WINAPI “VrEndPage” USING BY VALUE XHVRWIN
END-PERFORM.
PERFORM PR-END THRU PR-END-EX.
DISPLAY “clear|K1”.
PRINT-EX.
EXIT.
*—————————————————————-
* プリント処理
*—————————————————————-
HEAD-EN.
MOVE SPACE TO H1REC.
MOVE V2-YTC1 TO H1YTC1.
MOVE V2-YTC2 TO H1YTC2.
MOVE V2-MTC1 TO H1MTC1.
MOVE V2-MTC2 TO H1MTC2.
MOVE PGX TO H1PAGE.
MOVE V2-ENDPAGE TO H1ENDPAGE.
PERFORM H1-EN THRU H1-EX.
HEAD-EX.
EXIT.
ITEM-EN.
PERFORM WW1-I1-EN THRU WW1-I1-EX.
PERFORM I1-EN THRU I1-EX.
ITEM-EX.
EXIT.
*—————————————————————–
* Visual Formade CALL
*—————————————————————–
H1-EN.
MOVE SPACE TO FILD-BUF,DATA-BUF.
STRING “H1YTC1 “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING H1YTC1,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOut” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY REFERENCE DATA-BUF.
MOVE SPACE TO FILD-BUF,DATA-BUF.
STRING “H1YTC2 “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING H1YTC2,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOut” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY REFERENCE DATA-BUF.
MOVE SPACE TO FILD-BUF,DATA-BUF.
STRING “H1MTC1 “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING H1MTC1,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOut” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY REFERENCE DATA-BUF.
MOVE SPACE TO FILD-BUF,DATA-BUF.
STRING “H1MTC2 “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING H1MTC2,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOut” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY REFERENCE DATA-BUF.
MOVE SPACE TO FILD-BUF,DATA-BUF.
STRING “H1PAGE “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING H1PAGE,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOut” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY REFERENCE DATA-BUF.
MOVE SPACE TO FILD-BUF,DATA-BUF.
STRING “H1ENDPAGE “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING H1ENDPAGE,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOut” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY REFERENCE DATA-BUF.
H1-EX.
EXIT.
I1-EN.
MOVE SPACE TO FILD-BUF, DATA-BUF.
STRING “I1TC1 “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING I1TC1,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOutn” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY VALUE CNT,
BY REFERENCE DATA-BUF.
MOVE SPACE TO FILD-BUF, DATA-BUF.
STRING “I1TC2 “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING I1TC2,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOutn” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY VALUE CNT,
BY REFERENCE DATA-BUF.
MOVE SPACE TO FILD-BUF, DATA-BUF.
STRING “I1TNAME “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING I1TNAME,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOutn” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY VALUE CNT,
BY REFERENCE DATA-BUF.
MOVE SPACE TO FILD-BUF, DATA-BUF.
STRING “I1TEL “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING I1TEL,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOutn” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY VALUE CNT,
BY REFERENCE DATA-BUF.
MOVE SPACE TO FILD-BUF, DATA-BUF.
STRING “I1FAX “,X”00″ DELIMITED BY ” ” INTO FILD-BUF.
STRING I1FAX,X”00″ DELIMITED BY SIZE INTO DATA-BUF.
CALL WINAPI “VrsOutn” USING BY VALUE XHVRWIN,
BY REFERENCE FILD-BUF,BY VALUE CNT,
BY REFERENCE DATA-BUF.
I1-EX.
EXIT.
*—————————————————————–
* 画面 再表示
*—————————————————————–
ALL-DISP-EN.
DISPLAY “put|KANRI|” KR-KANRI(LN-KR).
DISPLAY “put|KRNAME|” KR-KRNAME(LN-KR).
ALL-DISP-EX.
EXIT.
*—————————————————————–
* 印刷ページ入力画面表示
*—————————————————————–
WINDOW-P-EN.
EVALUATE KR-GASW
WHEN 2 DISPLAY “window|AAA904Pb.SCR”
WHEN OTHER DISPLAY “window|AAA904Pb.SCR”
END-EVALUATE.
DISPLAY “put|YPAGE|” V2-YPAGE.
DISPLAY “put|MPAGE|” V2-MPAGE.
DISPLAY “put|MS|” “印刷範囲を入力してください。”
DISPLAY “position|YPAGE”.
WINDOW-P-EX.
EXIT.
*—————————————————————-
* 画面表示
*—————————————————————-
SCR-EN.
EVALUATE KR-GASW
WHEN 2 DISPLAY “screen|AAA904Ab.SCR|”
WHEN OTHER DISPLAY “screen|AAA904Ab.SCR|F”
END-EVALUATE.
DISPLAY “put|KANRI|” KR-KANRI(LN-KR).
DISPLAY “put|KRNAME|” KR-KRNAME(LN-KR).
SCR-EX.
EXIT.
*────────────────────────────────
* コピー句
*────────────────────────────────
COPY \IJS10\BTR.CPY.
COPY READKR.CPY.
COPY \IJS10\PRINTER.CPY.
COPY \IJS10\WFILE1.CPY.
COPY AAABTTO.CPY.
SOURCE-END.