text
stringlengths
1.18k
92.5k
lang
stringclasses
39 values
NOT = SPACES) STRING NAW-SPLIT-LAST DELIMITED BY " " INTO NAW-NAME-WORK WITH POINTER NAW-TALLY ADD 1 TO NAW-TALLY. * IF (NAW-SPLIT-POST NOT = SPACES) IF (NAW-TALLY < 2) STRING NAW-SPLIT-POST DELIMITED BY " " INTO NAW-NAME-WORK WITH POINTER NAW-TALLY ELSE SUBTRACT 1 FROM NAW-TALLY STRING ", " DELIMITED BY SIZE NAW-SPLIT-POST DELIMITED BY " " INTO NAW-NAME-WORK WITH POINTER NAW-TALLY. * 006100-EXIT. EXIT. <|end_of_text|>#include <cmath> #include "../build/rmkit.h" #include "../shared/string.h" // display height from 261.62mm diagonal (10.3 inch) and 4:3 ratio, // seems to be quite accurate... const double MILLIMETER = 1872/209.296 namespace shape: class DragHandle: public ui::Widget: public: int shape = 0 DragHandle(int x, int y, int w, int h): ui::Widget(x, y, w, h) {} void set_shape(int s): shape = s bool ignore_event(input::SynMotionEvent &syn_ev): return input::is_touch_event(syn_ev) void render(): if shape == 0: r := min(w/2, h/2) fb->draw_circle(x+r, y+r, r, 5, GRAY, true) else: for i := 0; i < 5; i++: fb->draw_rect(x+i, y+i, w-i*2, h-i*2, GRAY, false) class Shape; static vector<Shape*> to_draw = {} class Shape: public ui::Widget: private: static double snapping tuple<int, int> last_move_snap = tuple<int, int>(0, 0) public: string name; DragHandle *handle_one, *handle_two static bool snap_enabled static void set_snapping(int mm): Shape::snapping = MILLIMETER * mm debug "SET SNAPPING TO", Shape::snapping Shape(int x, y, w, h, ui::Scene scene) : ui::Widget(x, y, w, h): scene->add(self) shape::to_draw.push_back(self) self->add_drag_handles(scene) Shape() : ui::Widget(x, y, w, h): return int snap_position(int position): return snapping * round(position / snapping) void snap_handle(ui::Widget *handle): if snap_enabled: x, y := get_handle_coords(handle) handle->x = snap_position(x) - handle->w/2 handle->y = snap_position(y) - handle->h/2 void add_drag_handles(ui::Scene scene): sz := 25 handle_one = new DragHandle(x, y, sz, sz) handle_two = new DragHandle(x+w, y+h, sz, sz) snap_handle(handle_one) snap_handle(handle_two) handle_two->set_shape(1) scene->add(handle_one) scene->add(handle_two) handle_one->mouse.move += PLS_LAMBDA(auto &ev) { if not handle_one->mouse_down: return ev.stop_propagation() ox := handle_one->x oy := handle_one->y handle_one->x = ev.x - handle_one->w/2 handle_one->y = ev.y - handle_one->h/2 dx := handle_one->x - ox dy := handle_one->y - oy handle_two->x += dx handle_two->y += dy draw_movement(handle_one) } handle_two->mouse.move += PLS_LAMBDA(auto &ev) { if handle_one->mouse_down: return ev.stop_propagation() handle_two->x = ev.x - handle_two->w/2 handle_two->y = ev.y - handle_two->h/2 draw_movement(handle_two) } handle_one->mouse.up += PLS_LAMBDA(auto &ev) { snap_handle(handle_one) snap_handle(handle_two) self->redraw(ev) } handle_two->mouse.up += PLS_LAMBDA(auto &ev) { snap_handle(handle_two) self->redraw(ev) } handle_one->mouse.leave += PLS_DELEGATE(self.redraw) handle_two->mouse.leave += PLS_DELEGATE(self.redraw) void redraw(input::SynMotionEvent &ev): redraw() void redraw(bool skip_shape=false): ui::MainLoop::full_refresh() void draw_movement(ui::Widget *w1): if snap_enabled: x, y := get_handle_coords(w1) x = snap_position(x) y = snap_position(y) last_x, last_y := self->last_move_snap if x!= last_x || y!= last_y: draw_pixel(last_x, last_y, WHITE) draw_pixel(x, y, BLACK) last_move_snap = tuple<int, int>(x, y) else: draw_pixel(w1) void draw_pixel(ui::Widget *w1): x, y := get_handle_coords(w1) draw_pixel(x, y, color::GRAY_9) void draw_pixel(int x, int y, int color): fb->draw_line(x-1, y-1, x+1, y+1, 3, color) tuple<int, int> get_handle_coords(ui::Widget *w1) return (w1->x + w1->w/2), (w1->y + w1->h/2) virtual string to_lamp(): return "" virtual void render(): return double Shape::snapping = MILLIMETER * 5 bool Shape::snap_enabled = false class Line : public Shape: public: const string name = "Line" Line(int x, y, w, h, ui::Scene scene) : Shape(x, y, w, h, scene): handle_two->y = handle_one->y void render(): handle_one->render() handle_two->render() x1, y1 := get_handle_coords(handle_one) x2, y2 := get_handle_coords(handle_two) w := x2 - x1 h := y2 - y1 r := int(sqrt(w * w + h * h)) fb->draw_line(x1, y1, x2, y2, 3, color::GRAY_8) string to_lamp(): x1, y1 := get_handle_coords(handle_one) x2, y2 := get_handle_coords(handle_two) return "pen line " + str_utils::join(%{ to_string(x1), to_string(y1), to_string(x2), to_string(y2)},'') class HLine: Line: public: HLine(int x, y, w, h, ui::Scene scene) : Line(x, y, w, h, scene): handle_two->x = handle_one->x + w void before_render(): handle_one->y = handle_two->y class VLine: Line: public: VLine(int x, y, w, h, ui::Scene scene) : Line(x, y, w, h, scene): handle_two->y = handle_one->y + h void before_render(): handle_one->x = handle_two->x class Circle : public Shape: public: const string name = "Circle" Circle(int x, y, w, h, ui::Scene scene) : Shape(x, y, w, h, scene): return void render(): handle_one->render() handle_two->render() x1, y1 := get_handle_coords(handle_one) x2, y2 := get_handle_coords(handle_two) w := x2 - x1 h := y2 - y1 r := int(sqrt(w * w + h * h)) fb->draw_circle(x1, y1, r, 3, color::GRAY_8, /* fill */ false) string to_lamp(): x1, y1 := get_handle_coords(handle_one) x2, y2 := get_handle_coords(handle_two) w := abs(x2 - x1) h := abs(y2 - y1) r := int(sqrt(w * w + h * h)) return "pen circle " + str_utils::join(%{ to_string(x1), to_string(y1), to_string(r), to_string(r)},'') class Rectangle : public Shape: public: const string name = "Rectangle" Rectangle(int x, y, w, h, ui::Scene scene) : Shape(x, y, w, h, scene): return void render(): handle_one->render() handle_two->render() x1, y1 := get_handle_coords(handle_one) x2, y
COBOL
2 := get_handle_coords(handle_two) w := x2 - x1 h := y2 - y1 a1 := min(x1, x2) b1 := min(y1, y2) for i := 0; i < 3; i++: fb->draw_rect(a1+i, b1+i, abs(w)-i*2, abs(h)-i*2, color::GRAY_8, /* fill */ false) string to_lamp(): x1, y1 := get_handle_coords(handle_one) x2, y2 := get_handle_coords(handle_two) return "pen rectangle " + str_utils::join(%{ to_string(x1), to_string(y1), to_string(x2), to_string(y2)},'') class Bezier : public Shape: public: bool is_attached = false DragHandle *control_one, *control_two Bezier(int x, y, w, h, ui::Scene scene): Shape(): name = "Bezier" scene->add(self) control_one_x := x+w/4 control_one_y := y-h if to_draw.size() > 0: last_shape := to_draw.back() if last_shape->name == "Bezier": obj := (Bezier *)last_shape x = obj->handle_two->x y = obj->handle_two->y // Mirror control two of last shape control_one_x = 2*x-obj->control_two->x control_one_y = 2*y-obj->control_two->y obj->is_attached = true is_attached = true if x+w > DISPLAYWIDTH: w = DISPLAYWIDTH-x-10 sz := 25 handle_one = new DragHandle(x, y, sz, sz) handle_two = new DragHandle(x+w, y, sz, sz) control_one = new DragHandle(control_one_x, control_one_y, sz, sz) control_two = new DragHandle(x+w-w/4, y+h, sz, sz) shape::to_draw.push_back(self) handle_one->set_shape(1) handle_two->set_shape(1) scene->add(handle_one) scene->add(handle_two) scene->add(control_one) scene->add(control_two) handle_one->mouse.move += PLS_LAMBDA(auto &ev) { if not handle_one->mouse_down: return if!is_attached: ev.stop_propagation() ox := handle_one->x oy := handle_one->y handle_one->x = ev.x - handle_one->w/2 handle_one->y = ev.y - handle_one->h/2 dx := handle_one->x - ox dy := handle_one->y - oy control_one->x += dx control_one->y += dy draw_pixel(handle_one) } handle_two->mouse.move += PLS_LAMBDA(auto &ev) { if handle_one->mouse_down: return ev.stop_propagation() ox := handle_two->x oy := handle_two->y handle_two->x = ev.x - handle_two->w/2 handle_two->y = ev.y - handle_two->h/2 dx := handle_two->x - ox dy := handle_two->y - oy control_two->x += dx control_two->y += dy draw_pixel(handle_two) } control_one->mouse.move += PLS_LAMBDA(auto &ev) { if not control_one->mouse_down: return ev.stop_propagation() control_one->x = ev.x - control_one->w/2 control_one->y = ev.y - control_one->h/2 draw_pixel(control_one) } control_two->mouse.move += PLS_LAMBDA(auto &ev) { if control_one->mouse_down: return ev.stop_propagation() control_two->x = ev.x - control_two->w/2 control_two->y = ev.y - control_two->h/2 draw_pixel(control_two) } handle_one->mouse.up += PLS_DELEGATE(self.redraw) handle_two->mouse.up += PLS_DELEGATE(self.redraw) control_one->mouse.up += PLS_DELEGATE(self.redraw) control_two->mouse.up += PLS_DELEGATE(self.redraw) handle_one->mouse.leave += PLS_DELEGATE(self.redraw) handle_two->mouse.leave += PLS_DELEGATE(self.redraw) control_one->mouse.leave += PLS_DELEGATE(self.redraw) control_two->mouse.leave += PLS_DELEGATE(self.redraw) void render(): handle_one->render() handle_two->render() control_one->render() control_two->render() x1, y1 := get_handle_coords(handle_one) x2, y2 := get_handle_coords(control_one) x3, y3 := get_handle_coords(control_two) x4, y4 := get_handle_coords(handle_two) fb->draw_bezier(x1, y1, x2, y2, x3, y3, x4, y4, 3, color::GRAY_8) fb->draw_line(x1, y1, x2, y2, 3, color::GRAY_8) fb->draw_line(x3, y3, x4, y4, 3, color::GRAY_8) string to_lamp(): x1, y1 := get_handle_coords(handle_one) x2, y2 := get_handle_coords(control_one) x3, y3 := get_handle_coords(control_two) x4, y4 := get_handle_coords(handle_two) return "pen bezier " + str_utils::join(%{ to_string(x1), to_string(y1), to_string(x2), to_string(y2), to_string(x3), to_string(y3), to_string(x4), to_string(y4)},'') <|end_of_text|> ****************************************************************** * Author: LISA YE * Date: * Purpose: ****************************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. PRG02. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT INPUT-FILE ASSIGN "TABLE1.TXT" ORGANIZATION LINE SEQUENTIAL. SELECT PRINT-FILE ASSIGN TO "DATA.TXT". DATA DIVISION. FILE SECTION. FD INPUT-FILE. 01 INPUT-REC PIC X(80). FD PRINT-FILE. 01 PRINT-REC PIC X(80). WORKING-STORAGE SECTION. 01 SWITCHES. 05 END-OF-DATA PIC XXX. 01 PC-PAGE-CONTROLS. 05 PC-PAGE-NUM PIC S99 VALUE 00. 05 PC-LINES-USED PIC S99 VALUE 00. 05 PC-LINES-PER-PAGE PIC S99 VALUE 27. 01 WS-DATE. 05 WS-YY PIC 99. 05 WS-MM PIC 99. 05 WS-DD PIC 99. 01 SS-SUBSCRIPS. 05 SUB PIC S99. 01 TC-TOTAL-CALCS. 05 TC-RECORD-NUM PIC 99. 05 TC-TOTALS PIC 9999. 05 TL-HIGHEST PIC 99. 01 ET-EXCUSES. 05 PIC X(15) VALUE "COMPUTER CRASH". 05 PIC X(15) VALUE "DRAKE SAID NO". 05 PIC X(15) VALUE "I DIED". 05 PIC X(15) VALUE "GOD SAID STOP". 05 PIC X(15) VALUE "CAT PEED ON IT". 05 PIC X(15) VALUE "NOYNAERT CRIES". 05 PIC X(15) VALUE "TRUMP". 05 PIC X(15) VALUE "WATCHING MOVIE". 05 PIC X(15) VALUE "I AM SAD". 05 PIC X(15) VALUE "RUSSIANS". 01 ET-EXCUSE-TABLE REDEFINES ET-EXCUSES. 05 ET-EXCUSE OCCURS 10 PIC X(15). 01 IR-INPUT-REC. 05 IR-EXCUSE-NUM PIC 99. 88 IR-VALID VALUE 1 THRU 10. 05 PIC XXX. 05 IR-NUM-COUNT PIC S99. 05 PIC X(9). 01 SR-STAR-REC. 05 SR-EXCUSE-NUMBER PIC XX. 05 SR-NUM-USING PIC XX. 01 SR-SUMMARY-REPORT. 05 SR-TABLE OCCURS 10 PIC 9(4) VALUE 0. 01 HL-HEADING
COBOL
-LINE. 05 PIC X(20). 05 HL-DATE. 10 HL-MM PIC Z9/. 10 HL-DD PIC 99/. 10 HL-YY PIC 99. 05 PIC X(26). 05 HL-PAGE PIC Z9. 05 PIC X(20). 01 DL-DETAIL-LINE. 05 PIC X(30). 05 DL-RECORD-NUM PIC Z9. 05 PIC XX. 05 DL-INPUT-REC PIC X(16). 05 PIC X(30). 01 DL-DETAIL-LINE-X. 05 PIC X(27). 05 DL-RECORD-NUM-X PIC Z9. 05 PIC XX. 05 DL-EXCUSE-NAME-X PIC X(15). 05 PIC XX. 05 DLT-NUM-USING PIC ZZZ9-. 05 PIC X(27). 01 CH-COLUMN-HEADING. 05 PIC X(30). 05 CH-RECORD-NUM PIC X(3) VALUE "RC#". 05 PIC X(6). 05 CH-IMAGE PIC X(5) VALUE "IMAGE". 05 PIC X(36). 01 HL-HEADING-LINE-X. 05 PIC X(30). 05 TH-TEN-TERRIFIC-EXCUSES PIC X(20) VALUE "TEN TERRIFIC EXCUSES". 01 SL-STAR-LINE. 05 PIC X(34). 05 SL-EXCUSE-NUMBER PIC XX. 05 PIC XXX. 05 SL-NUM-USING PIC XX. 05 PIC X(9). 01 TL-TOTAL-LINE. 05 PIC X(21). 05 TL-TOTAL-N PIC X(14) VALUE "TOTAL:". 05 TL-TOTAL PIC ZZZ9. 05 PIC X(4). 05 TL-HIGHEST-TOTAL-N PIC X(14) VALUE "HIGHEST:". 05 TL-HIGHEST-TOTAL PIC Z9. PROCEDURE DIVISION. 000-MAINLINE. *INITIALIZATION SECTION OPEN INPUT INPUT-FILE OUTPUT PRINT-FILE PERFORM 100-INITIALIZE PERFORM 850-HEADINGS *PROCESSING SECTION PERFORM UNTIL END-OF-DATA = "YES" READ INPUT-FILE INTO IR-INPUT-REC AT END MOVE "YES" TO END-OF-DATA NOT AT END PERFORM 200-PROCESSING END-READ END-PERFORM PERFORM 800-SUMMARY-HEADING PERFORM 300-SUMMARY VARYING SUB FROM 1 BY 1 UNTIL SUB > 10 PERFORM 700-TOTALS *TERMINATION SECTION CLOSE INPUT-FILE PRINT-FILE STOP RUN. * 100-INITIALIZE. MOVE "NO " TO END-OF-DATA *DATE ACCEPT WS-DATE FROM DATE MOVE WS-MM TO HL-MM MOVE WS-DD TO HL-DD MOVE WS-YY TO HL-YY *INITIALIZE INITIALIZE TC-TOTAL-CALCS MOVE SPACES TO PRINT-REC. 200-PROCESSING. INSPECT IR-NUM-COUNT CONVERTING SPACES TO ZEROS INITIALIZE DL-DETAIL-LINE ADD 1 TO TC-RECORD-NUM IF IR-VALID AND IR-EXCUSE-NUM NUMERIC AND IR-NUM-COUNT NUMERIC PERFORM 220-VALID ELSE PERFORM 210-INVALID END-IF *TOTALS IF PC-LINES-USED > PC-LINES-PER-PAGE MOVE ZEROS TO PC-LINES-USED PERFORM 850-HEADINGS END-IF. 210-INVALID. MOVE TC-RECORD-NUM TO DL-RECORD-NUM MOVE IR-INPUT-REC TO DL-INPUT-REC *STAR LINE IF NOT IR-VALID OR IR-EXCUSE-NUM NOT NUMERIC MOVE ALL "*" TO SR-EXCUSE-NUMBER ELSE MOVE SPACES TO SR-EXCUSE-NUMBER END-IF IF IR-NUM-COUNT NOT NUMERIC MOVE ALL "*" TO SR-NUM-USING ELSE MOVE SPACES TO SR-NUM-USING END-IF *WRITE PRINT REC MOVE SR-EXCUSE-NUMBER TO SL-EXCUSE-NUMBER MOVE SR-NUM-USING TO SL-NUM-USING WRITE PRINT-REC FROM DL-DETAIL-LINE AFTER 2 WRITE PRINT-REC FROM SL-STAR-LINE AFTER 1 ADD 3 TO PC-LINES-USED. 220-VALID. ADD IR-NUM-COUNT TO SR-TABLE(IR-EXCUSE-NUM) ADD IR-NUM-COUNT TO TC-TOTALS. 300-SUMMARY. MOVE SUB TO DL-RECORD-NUM-X MOVE ET-EXCUSE(SUB) TO DL-EXCUSE-NAME-X MOVE SR-TABLE(SUB) TO DLT-NUM-USING WRITE PRINT-REC FROM DL-DETAIL-LINE-X AFTER 1 ADD 1 TO PC-LINES-USED IF SR-TABLE(SUB) > TL-HIGHEST MOVE SR-TABLE(SUB) TO TL-HIGHEST END-IF. 700-TOTALS. MOVE TC-TOTALS TO TL-TOTAL MOVE TL-HIGHEST TO TL-HIGHEST-TOTAL ADD 1 TO PC-LINES-USED MOVE SPACES TO PRINT-REC WRITE PRINT-REC FROM TL-TOTAL-LINE AFTER 2. 800-SUMMARY-HEADING. PERFORM 850-HEADINGS WRITE PRINT-REC FROM HL-HEADING-LINE-X AFTER 1 MOVE SPACES TO PRINT-REC ADD 1 TO PC-LINES-USED. 850-HEADINGS. ADD 1 TO PC-PAGE-NUM MOVE PC-PAGE-NUM TO HL-PAGE WRITE PRINT-REC FROM HL-HEADING-LINE AFTER PAGE WRITE PRINT-REC FROM CH-COLUMN-HEADING AFTER 2 MOVE SPACES TO PRINT-REC WRITE PRINT-REC AFTER 1 ADD 5 TO PC-LINES-USED. <|end_of_text|>(defun @foo ((x (String Unicode))) (String Unicode) (start beginning: (print x) (jump next:)) (defblock next: (print x) (return x))) <|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. DATAMANIPULATION. DATA DIVISION. WORKING-STORAGE SECTION. 01 some-data PIC 9(6). 01 othr-data PIC X(6). 01 table1. 03 table1-row PIC 9(2) OCCURS 3 TIMES. 01 table2. 02 table2-row OCCURS 4 TIMES. 04 row2-data-opt PIC A(1) VALUE 'e'. 04 table2-col PIC 9(2) OCCURS 5 TIMES. PROCEDURE DIVISION. DISPLAY '|'some-data'|'othr-data'|'. MOVE 12 TO some-data. MOVE 'A1' TO othr-data. DISPLAY '|'some-data'|'othr-data'|'. DISPLAY some-data(5:2). DISPLAY othr-data(1:2). MOVE 'B2' TO othr-data(4:1). DISPLAY '|'some-data'|'othr-data'|'. DISPLAY table1. DISPLAY table2. DISPLAY table1-row(3). DISPLAY table2-row(3). DISPLAY table2-col(3,4). MOVE 11 TO table1-row(3). MOVE 19 TO table2-col(3,4). DISPLAY table1. DISPLAY table2. DISPLAY table1-row(3). DISPLAY table2-row(3). DISPLAY table2-col(3,4). STOP RUN. <|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. EX03. AUTHOR. LEANDRO FERNANDES & EDEL CORADI. INSTALLATION. FATEC-SP. DATE-WRITTEN. 20/11/2013. DATE-COMPILED. SECURITY. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. IBM-PC. OBJECT-COMPUTER. IBM-PC. SPECIAL-NAMES. DECIMAL-POINT
COBOL
IS COMMA. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT CADMERC ASSIGN TO DISK ORGANIZATION IS LINE SEQUENTIAL. SELECT MOVMERC ASSIGN TO DISK ORGANIZATION IS LINE SEQUENTIAL. SELECT ATUMERC ASSIGN TO DISK ORGANIZATION IS LINE SEQUENTIAL. SELECT RELERRO ASSIGN TO DISK ORGANIZATION IS LINE SEQUENTIAL. SELECT RELMERC ASSIGN TO DISK ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD CADMERC LABEL RECORD ARE STANDARD VALUE OF FILE-ID IS "CADMERC.DAT". 01 REG-CADMERC. 02 CODIGO-CADMERC PIC 9(03). 02 DESCRICAO-CADMERC PIC X(30). 02 ESTOQ-MIN-CADMERC PIC 9(03). 02 QTD-ESTOQ-CADMERC PIC 9(03). 02 PRECO-UNIT-CADMERC PIC 9(04)V9(02). FD MOVMERC LABEL RECORD ARE STANDARD VALUE OF FILE-ID IS "MOVMERC.DAT". 01 REG-MOVMERC. 02 CODIGO-MOVMERC PIC 9(03). 02 DESCRICAO-MOVMERC PIC X(30). 02 ESTOQ-MIN-MOVMERC PIC 9(03). 02 QTD-ESTOQ-MOVMERC PIC 9(03). 02 PRECO-UNIT-MOVMERC PIC 9(04)V9(02). 02 TIPO-ATUALIZACAO-MOVMERC PIC X(01). FD ATUMERC LABEL RECORD ARE STANDARD VALUE OF FILE-ID IS "ATUMERC.DAT". 01 REG-ATUMERC. 02 CODIGO-ATUMERC PIC 9(03). 02 DESCRICAO-ATUMERC PIC X(30). 02 ESTOQ-MIN-ATUMERC PIC 9(03). 02 QTD-ESTOQ-ATUMERC PIC 9(03). 02 PRECO-UNIT-ATUMERC PIC 9(04)V9(02). FD RELERRO LABEL RECORD IS OMITTED. 01 REL-ERRO PIC X(80). FD RELMERC LABEL RECORD IS OMITTED. 01 REL-MERC PIC X(80). WORKING-STORAGE SECTION. 77 CH-CADMERC PIC X(04) VALUE SPACES. 77 CH-MOVMERC PIC X(04) VALUE SPACES. 77 CT-PAG-RELERRO PIC 9(03) VALUE 0. 77 CT-PAG-RELMERC PIC 9(03) VALUE 0. 77 CT-LIN-RELERRO PIC 9(02) VALUE 41. 77 CT-LIN-RELMERC PIC 9(02) VALUE 41. 01 CAB-01-RELERRO. 02 FILLER PIC X(29) VALUE SPACES. 02 FILLER PIC X(22) VALUE "RELAÇÃO DE MERCADORIAS". 02 FILLER PIC X(15) VALUE SPACES. 02 FILLER PIC X(05) VALUE "PAG. ". 02 VAR-PAG-RELERRO PIC ZZ9. 02 FILLER PIC X(06) VALUE SPACES. 01 CAB-02-RELERRO. 02 FILLER PIC X(30) VALUE SPACES. 02 FILLER PIC X(20) VALUE "ERROS DE ATUALIZACAO". 02 FILLER PIC X(30) VALUE SPACES. 01 CAB-03-RELERRO. 02 FILLER PIC X(03) VALUE SPACES. 02 FILLER PIC X(06) VALUE "CODIGO". 02 FILLER PIC X(10) VALUE SPACES. 02 FILLER PIC X(09) VALUE "DESCRIÇÀO". 02 FILLER PIC X(26) VALUE SPACES. 02 FILLER PIC X(08) VALUE "MENSAGEM". 02 FILLER PIC X(18) VALUE SPACES. 01 DETALHE-RELERRO. 02 FILLER PIC X(04) VALUE SPACES. 02 CODIGO-RELERRO PIC 999. 02 FILLER PIC X(04) VALUE SPACES. 02 DESCRICAO-RELERRO PIC X(30). 02 FILLER PIC X(03) VALUE SPACES. 02 MENSAGEM-RELERRO PIC X(31). 02 FILLER PIC X(08) VALUE SPACES. 01 CAB-01-RELMERC. 02 FILLER PIC X(29) VALUE SPACES. 02 FILLER PIC X(22) VALUE "RELAÇÃO DE MERCADORIAS". 02 FILLER PIC X(15) VALUE SPACES. 02 FILLER PIC X(05) VALUE "PAG. ". 02 VAR-PAG-RELMERC PIC ZZ9. 02 FILLER PIC X(06) VALUE SPACES. 01 CAB-02-RELMERC. 02 FILLER PIC X(32) VALUE SPACES. 02 FILLER PIC X(15) VALUE "ESTOQUE CRÍTICO". 02 FILLER PIC X(32) VALUE SPACES. 01 CAB-03-RELMERC. 02 FILLER PIC X(02) VALUE SPACES. 02 FILLER PIC X(06) VALUE "CODIGO". 02 FILLER PIC X(04) VALUE SPACES. 02 FILLER PIC X(09) VALUE "DESCRIÇÀO". 02 FILLER PIC X(20) VALUE SPACES. 02 FILLER PIC X(07) VALUE "ESTOQUE". 02 FILLER PIC X(05) VALUE SPACES. 02 FILLER PIC X(10) VALUE "QUANTIDADE". 02 FILLER PIC X(06) VALUE SPACES. 02 FILLER PIC X(05) VALUE "PREÇO". 02 FILLER PIC X(06) VALUE SPACES. 01 CAB-04-RELMERC. 02 FILLER PIC X(42) VALUE SPACES. 02 FILLER PIC X(06) VALUE "MÍNIMO". 02 FILLER PIC X(06) VALUE SPACES. 02 FILLER PIC X(07) VALUE "ESTOQUE". 02 FILLER PIC X(07) VALUE SPACES. 02 FILLER PIC X(08) VALUE "UNITARIO". 02 FILLER PIC X(04) VALUE SPACES. 01 DETALHE-RELMERC. 02 FILLER PIC X(03) VALUE SPACES. 02 CODIGO-RELMERC PIC 999. 02 FILLER PIC X(02) VALUE SPACES. 02 DESCRICAO-RELMERC PIC X(30). 02 FILLER PIC X(06) VALUE SPACES. 02 ESTOQ-MIN-RELMERC PIC 999. 02 FILLER PIC X(09) VALUE SPACES. 02 QTD-ESTOQ-RELMERC PIC 999. 02 FILLER PIC X(09) VALUE SPACES. 02 PRECO-UNIT-RELMERC PIC Z.Z99,99. 02 FILLER PIC X(04) VALUE SPACES. PROCEDURE DIVISION. PROGRAM03. PERFORM INICIO. PERFORM PRINCIPAL UNTIL CH-CADMERC EQUAL CH-MOVMERC AND CH-MOVMERC EQUAL HIGH-VALUES. PERFORM FIM. STOP RUN. INICIO. OPEN INPUT CADMERC MOVMERC OUTPUT ATUMERC RELERRO RELMERC. PERFORM LER-CADMERC. PERFORM LER-MOVMERC. LER-CADMERC. READ CADMERC AT END MOVE HIGH-VALUES TO CH-CADMERC. IF CH-CADMERC EQUAL HIGH-VALUES NEXT SENTENCE ELSE MOVE CODIGO-CADMERC TO CH-CADMERC END-IF. LER-MOVMERC. READ MOVMERC AT END MOVE HIGH-VALUES TO CH-MOVMERC. IF CH-MOVMERC EQUAL HIGH-VALUES NEXT SENTENCE ELSE MOVE CODIGO-MOVMERC
COBOL
TO CH-MOVMERC END-IF. PRINCIPAL. IF CT-LIN-RELERRO GREATER THAN 40 PERFORM CABECALHO-RELERRO END-IF IF CT-LIN-RELMERC GREATER THAN 40 PERFORM CABECALHO-RELMERC END-IF *IGUAL IF CH-CADMERC EQUAL CH-MOVMERC IF TIPO-ATUALIZACAO-MOVMERC EQUAL "A" PERFORM GRAVA-MOVMERC END-IF IF TIPO-ATUALIZACAO-MOVMERC EQUAL "I" MOVE CODIGO-MOVMERC TO CODIGO-RELERRO MOVE DESCRICAO-MOVMERC TO DESCRICAO-RELERRO MOVE "INCLUSÃO P/REG. JÁ EXISTENTE" TO MENSAGEM-RELERRO WRITE REL-ERRO FROM DETALHE-RELERRO AFTER ADVANCING 1 LINE PERFORM GRAVA-CADMERC END-IF PERFORM LER-CADMERC PERFORM LER-MOVMERC ELSE *CADANT IF CH-CADMERC LESS CH-MOVMERC PERFORM GRAVA-CADMERC PERFORM LER-CADMERC *CADMOV ELSE MOVE CODIGO-MOVMERC TO CODIGO-RELERRO MOVE DESCRICAO-MOVMERC TO DESCRICAO-RELERRO IF TIPO-ATUALIZACAO-MOVMERC EQUAL "A" MOVE "ALTERAÇÃO P/REG. INEXISTENTE" TO MENSAGEM-RELERRO END-IF IF TIPO-ATUALIZACAO-MOVMERC EQUAL "E" MOVE "EXCLUSÃO P/REG. INEXISTENTE" TO MENSAGEM-RELERRO END-IF IF TIPO-ATUALIZACAO-MOVMERC EQUAL "I" PERFORM GRAVA-MOVMERC ELSE WRITE REL-ERRO FROM DETALHE-RELERRO AFTER ADVANCING 1 LINE END-IF PERFORM LER-MOVMERC END-IF END-IF. GRAVA-MOVMERC. MOVE CODIGO-MOVMERC TO CODIGO-ATUMERC. MOVE DESCRICAO-MOVMERC TO DESCRICAO-ATUMERC. MOVE ESTOQ-MIN-MOVMERC TO ESTOQ-MIN-ATUMERC. MOVE QTD-ESTOQ-MOVMERC TO QTD-ESTOQ-ATUMERC. MOVE PRECO-UNIT-MOVMERC TO PRECO-UNIT-ATUMERC. WRITE REG-ATUMERC. PERFORM CARIMBA-DETALHE-RELMERC. GRAVA-CADMERC. MOVE CODIGO-CADMERC TO CODIGO-ATUMERC. MOVE DESCRICAO-CADMERC TO DESCRICAO-ATUMERC. MOVE ESTOQ-MIN-CADMERC TO ESTOQ-MIN-ATUMERC. MOVE QTD-ESTOQ-CADMERC TO QTD-ESTOQ-ATUMERC. MOVE PRECO-UNIT-CADMERC TO PRECO-UNIT-ATUMERC. WRITE REG-ATUMERC. PERFORM CARIMBA-DETALHE-RELMERC. CARIMBA-DETALHE-RELMERC. IF QTD-ESTOQ-ATUMERC NOT GREATER THAN ESTOQ-MIN-ATUMERC MOVE CODIGO-ATUMERC TO CODIGO-RELMERC MOVE DESCRICAO-ATUMERC TO DESCRICAO-RELMERC MOVE ESTOQ-MIN-ATUMERC TO ESTOQ-MIN-RELMERC MOVE QTD-ESTOQ-ATUMERC TO QTD-ESTOQ-RELMERC MOVE PRECO-UNIT-ATUMERC TO PRECO-UNIT-RELMERC WRITE REL-MERC FROM DETALHE-RELMERC ADD 1 TO CT-LIN-RELMERC END-IF. FIM. CLOSE CADMERC MOVMERC ATUMERC RELERRO RELMERC. CABECALHO-RELERRO. ADD 1 TO CT-PAG-RELERRO. MOVE CT-PAG-RELERRO TO VAR-PAG-RELERRO. MOVE 0 TO CT-LIN-RELERRO. MOVE SPACES TO REL-ERRO. WRITE REL-ERRO AFTER ADVANCING PAGE. WRITE REL-ERRO FROM CAB-01-RELERRO AFTER ADVANCING 1 LINE. WRITE REL-ERRO FROM CAB-02-RELERRO AFTER ADVANCING 2 LINES. WRITE REL-ERRO FROM CAB-03-RELERRO AFTER ADVANCING 2 LINES. MOVE SPACES TO REL-ERRO. WRITE REL-ERRO AFTER ADVANCING 1 LINE. CABECALHO-RELMERC. ADD 1 TO CT-PAG-RELMERC. MOVE CT-PAG-RELMERC TO VAR-PAG-RELMERC. MOVE 0 TO CT-LIN-RELMERC. MOVE SPACES TO REL-MERC. WRITE REL-MERC AFTER ADVANCING PAGE. WRITE REL-MERC FROM CAB-01-RELMERC AFTER ADVANCING 1 LINE. WRITE REL-MERC FROM CAB-02-RELMERC AFTER ADVANCING 2 LINES. WRITE REL-MERC FROM CAB-03-RELMERC AFTER ADVANCING 2 LINES. WRITE REL-MERC FROM CAB-04-RELMERC AFTER ADVANCING 1 LINE. MOVE SPACES TO REL-MERC. WRITE REL-MERC AFTER ADVANCING 1 LINE.<|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. VOS050R. ********************************************** Z-WIN-RPG2 **** * PROGRAM.......: VOS045, SANERING MEKANIKER STATISTIKK. * * PROGRAMMERER..: MORTEN TUVRØNNINGEN * * KJØRES I JOBB.: VOS02A * * LAGET DATO....: 10.10.96 * * ENDRET........: * * INPUT......: DAGENS VERKSTEDORDRE, * * ORDRENR MASTER. * * BEHANDLING.: MERKER ORDRENR MASTER MED AT ORDRE ER TATT MED * * PÅ MEKANIKER-STATISTIKK. * * OUTPUT.....: LISTE, * * ORDRENR MASTER. * ***************************************************************** * ** armrpg: RPG to COBOL/VSE Version - 2018/09/26 2.5 R0 0362 ** : Inglenet Business Solutions : ** options: -mv ** Source: VOS050.rpg * ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. UPSI-0 ON STATUS IS U-1-ON OFF STATUS IS U-1-OFF UPSI-1 ON STATUS IS U-2-ON OFF STATUS IS U-2-OFF UPSI-2 ON STATUS IS U-3-ON OFF STATUS IS U-3-OFF UPSI-3 ON STATUS IS U-4-ON OFF STATUS IS U-4-OFF UPSI-4 ON STATUS IS U-5-ON OFF STATUS IS U-5-OFF UPSI-5 ON STATUS IS U-6-ON OFF STATUS IS U-6-OFF UPSI-6 ON STATUS IS U-7-ON OFF STATUS IS U-7-OFF UPSI-7 ON STATUS IS U-8-ON OFF STATUS IS U-8-OFF DECIMAL-POINT IS COMMA. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT DAGMEKI ASSIGN TO UT-S-DAGMEKI ACCESS MODE IS SEQUENTIAL ORGANIZATION IS SEQUENTIAL STATUS IS DAGMEKI-STATUS. SELECT ORDNRM ASSIGN TO ORDNRM ACCESS MODE IS DYNAMIC ORGANIZATION IS INDEXED STATUS IS ORDNRM-STATUS RECORD KEY IS ORDNRM-KEY1. SELECT LISTE ASSIGN TO SYS020-UR-3203-SYSLST ACCESS MODE IS SEQUENTIAL ORGANIZATION IS SEQUENTIAL STATUS IS LISTE-STATUS. DATA DIVISION. FILE SECTION. FD DAGMEKI BLOCK CONTAINS 600 RECORD CONT
COBOL
AINS 60. 01 DAGMEKI-IO-AREA. 05 DAGMEKI-IO-AREA-X PICTURE X(60). FD ORDNRM RECORD CONTAINS 100. 01 ORDNRM-IO-AREA. 05 ORDNRM-IO-AREA-X. 10 ORDNRM-KEY1 PICTURE X(9). 10 FILLER PICTURE X(91). *BUGFILO O F 80 80 PRINTERSYSLST FD LISTE BLOCK CONTAINS 133 RECORD CONTAINS 133. 01 LISTE-IO-PRINT. 05 LISTE-IO-AREA-CONTROL PICTURE X VALUE''. 02 LISTE-IO-AREA. 05 LISTE-IO-AREA-X PICTURE X(132). WORKING-STORAGE SECTION. 01 ACCEPT-COMMAND-LINE PICTURE X(80). 01 FILE-STATUS-TABLE. 10 DAGMEKI-STATUS PICTURE 99 VALUE 0. 10 ORDNRM-STATUS PICTURE 99 VALUE 0. 10 LISTE-STATUS PICTURE 99 VALUE 0. 01 WORK-AREA-BATCH. 05 FILLER PIC X VALUE '0'. 88 DAGMEKI-EOF-OFF VALUE '0'. 88 DAGMEKI-EOF VALUE '1'. 05 FILLER PIC X VALUE '0'. 88 DAGMEKI-READ-OFF VALUE '0'. 88 DAGMEKI-READ VALUE '1'. 05 FILLER PIC X VALUE '0'. 88 DAGMEKI-PROCESS-OFF VALUE '0'. 88 DAGMEKI-PROCESS VALUE '1'. 05 FILLER PIC X VALUE '1'. 88 DAGMEKI-LEVEL-INIT-OFF VALUE '0'. 88 DAGMEKI-LEVEL-INIT VALUE '1'. 05 ORDNRM-KEY-NUM PICTURE 9 VALUE 1 BINARY. 05 LISTE-DATA-FIELDS. 10 LISTE-AFTER-SPACE PICTURE 9(4) BINARY VALUE 0. 10 LISTE-AFTER-SKIP PICTURE 9(4) BINARY VALUE 0. 10 LISTE-BEFORE-SPACE PICTURE 9(4) BINARY VALUE 0. 10 LISTE-BEFORE-SKIP PICTURE 9(4) BINARY VALUE 0. 10 LISTE-MAX-LINES PICTURE 9(4) BINARY VALUE 0. 10 LISTE-LINE-COUNT PICTURE 9(4) BINARY VALUE 0. 10 LISTE-CLR-IO PICTURE X VALUE 'Y'. 05 DAGMEKI-LEVEL-01. 10 DAGMEKI-01-L1. 15 DAGMEKI-01-L1-DMFNR PICTURE X(3). 05 DAGMEKI-DATA-FIELDS. 10 DMFNR PICTURE X(3). 10 DMONR PICTURE X(6). 05 ORDNRM-DATA-FIELDS. 10 FILLER PICTURE X. 05 THE-PRIOR-LEVEL. 10 THE-PRIOR-L1 PICTURE X(3). 05 TEMPORARY-FIELDS. 10 TIDSP-IO. 15 TIDSP PICTURE S9(6). 10 ANTORD-IO. 15 ANTORD PICTURE S9(6). 10 ONRKEY PICTURE X(9). 10 TOTORD-IO. 15 TOTORD PICTURE S9(6). 05 EDITTING-FIELDS. 10 XO-60YN9R PICTURE ZZZZZ9-. 01 WORK-AREA. 05 INDICATOR-TABLE. COPY TCRPGIN. 05 SYSTEM-DATE PICTURE 9(6). 05 SYSTEM-DATE-ALPHA REDEFINES SYSTEM-DATE. 10 SYSTEM-YEAR PICTURE 99. 10 SYSTEM-MONTH PICTURE 99. 10 SYSTEM-DAY PICTURE 99. 05 SYSTEM-TIME-X. 10 SYSTEM-TIME PICTURE 9(6). 10 FILLER PICTURE 99. 05 LR-CHECK PICTURE 9(4) BINARY. 05 UDATE PICTURE 9(6). 05 UDATE-DDMMYY. 10 UDAY PICTURE 99. 10 UMONTH PICTURE 99. 10 UYEAR PICTURE 99. 05 EDIT-DATE PICTURE 99.99.99.99.99. 05 TID PICTURE X(8). 05 FILLER PICTURE X. 88 NOT-SET-I-OF VALUE '0'. 88 SET-I-OF VALUE '1'. 05 FILLER PICTURE X. 88 NOT-IN-DETAIL-OUTPUT VALUE '0'. 88 IN-DETAIL-OUTPUT VALUE '1'. 05 FILLER PICTURE X. 88 RECORD-SELECTED-OFF VALUE '0'. 88 RECORD-SELECTED VALUE '1'. 05 E-R-R-O-R PICTURE X(12). 05 BW-A PICTURE 9(4) USAGE BINARY. 05 FILLER REDEFINES BW-A. 10 BW-A-1 PICTURE X. 10 BW-A-2 PICTURE X. 05 BW-B PICTURE 9(4) USAGE BINARY. 05 FILLER REDEFINES BW-B. 10 BW-B-1 PICTURE X. 10 BW-B-2 PICTURE X. PROCEDURE DIVISION. MAIN-LINE. PERFORM INITIALIZATION PERFORM HEADING-OUTPUT SET IN-DETAIL-OUTPUT TO TRUE PERFORM DETAIL-OUTPUT SET NOT-IN-DETAIL-OUTPUT TO TRUE SET NOT-I-1P TO TRUE. MAINLINE-LOOP. PERFORM HEADING-OUTPUT SET IN-DETAIL-OUTPUT TO TRUE PERFORM DETAIL-OUTPUT SET NOT-IN-DETAIL-OUTPUT TO TRUE IF NOT-SET-I-OF SET NOT-I-OF TO TRUE END-IF SET NOT-SET-I-OF TO TRUE PERFORM HALT-INDICATOR-CHECK SET NOT-I-01 TO TRUE SET NOT-I-02 TO TRUE PERFORM SETOFF-I-L PERFORM SETOFF-I-H IF I-LR PERFORM SETON-I-L9 GO TO MAINLINE-TOTAL-CALCS END-IF SET RECORD-SELECTED-OFF TO TRUE IF DAGMEKI-PROCESS SET DAGMEKI-PROCESS-OFF TO TRUE SET DAGMEKI-READ TO TRUE END-IF IF DAGMEKI-READ AND RECORD-SELECTED-OFF PERFORM DAGMEKI-GET SET DAGMEKI-READ-OFF TO TRUE IF NOT DAGMEKI-EOF SET DAGMEKI-PROCESS TO TRUE SET RECORD-SELECTED TO TRUE END-IF END-IF IF LR-CHECK < 1 SET I-LR TO TRUE PERFORM SETON-I-L9 GO TO MAINLINE-TOTAL-CALCS END-IF IF DAGMEKI-PROCESS PERFORM DAGMEKI-IDSET END-IF IF DAGMEKI-PROCESS PERFORM DAGMEKI-CHK-LEVEL END-IF IF I-1ST GO TO LR-INDICATOR-TEST END-IF. MAINLINE-TOTAL-CALCS. PERFORM TOTAL-OUTPUT. LR-INDICATOR-TEST. IF I-LR GO TO MAINLINE-TERMINATION END-IF PERFORM HEADING-OVERFLOW IF DAGMEKI-PROCESS PERFORM DAGMEKI-FLDSET END-IF PERFORM DET
COBOL
AIL-CALCS IF DAGMEKI-PROCESS SET NOT-I-1ST TO TRUE END-IF GO TO MAINLINE-LOOP. MAINLINE-TERMINATION. PERFORM TERMINATION MOVE ZERO TO RETURN-CODE STOP RUN. DETAIL-CALCS SECTION. DETAIL-CALCS-P. IF (I-99) SET NOT-I-99 TO TRUE END-IF IF (NOT-I-98) SET I-98 TO TRUE SET I-99 TO TRUE END-IF IF (I-99) ACCEPT SYSTEM-TIME-X FROM TIME MOVE SYSTEM-TIME TO TIDSP (1:6) END-IF IF (I-L1) SUBTRACT ANTORD FROM ANTORD END-IF SET NOT-I-60 TO TRUE MOVE DMFNR TO ONRKEY (1:3) MOVE DMONR TO ONRKEY (4:6) MOVE ONRKEY TO ORDNRM-KEY1 READ ORDNRM RECORD KEY IS ORDNRM-KEY1 INVALID KEY SET I-61 TO TRUE NOT INVALID KEY SET NOT-I-61 TO TRUE PERFORM ORDNRM-IDSET END-READ IF (NOT-I-61 AND I-02) SET I-60 TO TRUE END-IF IF (I-60) ADD 1 TO ANTORD ADD 1 TO TOTORD * MOVE "ONRKEY "BUGFL1 8 DISPLAY FIELD * BUGFL1 DEBUGBUGFILO ONRKEY VIS INDIKATOR END-IF . DAGMEKI-GET SECTION. DAGMEKI-GET-P. IF DAGMEKI-EOF-OFF READ DAGMEKI AT END SET DAGMEKI-EOF TO TRUE SUBTRACT 1 FROM LR-CHECK END-READ END-IF. DAGMEKI-FLDSET SECTION. DAGMEKI-FLDSET-P. EVALUATE TRUE WHEN ANY MOVE DAGMEKI-IO-AREA (1:3) TO DMFNR (1:3) MOVE DAGMEKI-IO-AREA (16:6) TO DMONR (1:6) END-EVALUATE. DAGMEKI-IDSET SECTION. DAGMEKI-IDSET-P. SET I-01 TO TRUE. DAGMEKI-CHK-LEVEL SECTION. DAGMEKI-CHK-LEVEL-P. EVALUATE TRUE WHEN ANY MOVE LOW-VALUES TO DAGMEKI-LEVEL-01 MOVE DAGMEKI-IO-AREA (1:3) TO DAGMEKI-01-L1-DMFNR IF DAGMEKI-LEVEL-INIT EVALUATE TRUE WHEN DAGMEKI-01-L1 NOT = THE-PRIOR-L1 PERFORM SETON-I-L1 END-EVALUATE END-IF MOVE DAGMEKI-01-L1 TO THE-PRIOR-L1 SET DAGMEKI-LEVEL-INIT TO TRUE END-EVALUATE. ORDNRM-IDSET SECTION. ORDNRM-IDSET-P. SET I-02 TO TRUE. LISTE-PRINT-LINE SECTION. LISTE-PRINT-LINE-P. IF LISTE-BEFORE-SKIP > 0 PERFORM LISTE-SKIP-BEFORE END-IF IF LISTE-BEFORE-SPACE > 0 PERFORM LISTE-SPACE-BEFORE IF LISTE-AFTER-SKIP > 0 PERFORM LISTE-SKIP-AFTER END-IF IF LISTE-AFTER-SPACE > 0 PERFORM LISTE-SPACE-AFTER END-IF ELSE IF LISTE-AFTER-SKIP > 0 PERFORM LISTE-SKIP-AFTER END-IF PERFORM LISTE-SPACE-AFTER END-IF IF LISTE-LINE-COUNT NOT < LISTE-MAX-LINES SET I-OF TO TRUE IF IN-DETAIL-OUTPUT SET SET-I-OF TO TRUE END-IF END-IF. LISTE-SKIP-BEFORE SECTION. LISTE-SKIP-BEFORE-P. WRITE LISTE-IO-PRINT AFTER ADVANCING PAGE MOVE 1 TO LISTE-LINE-COUNT MOVE 0 TO LISTE-BEFORE-SKIP INITIALIZE LISTE-IO-AREA. LISTE-SPACE-BEFORE SECTION. LISTE-SPACE-BEFORE-P. WRITE LISTE-IO-PRINT AFTER LISTE-BEFORE-SPACE LINES ADD LISTE-BEFORE-SPACE TO LISTE-LINE-COUNT MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE 0 TO LISTE-BEFORE-SPACE. LISTE-SKIP-AFTER SECTION. LISTE-SKIP-AFTER-P. WRITE LISTE-IO-PRINT BEFORE ADVANCING PAGE MOVE 1 TO LISTE-LINE-COUNT MOVE 0 TO LISTE-AFTER-SKIP INITIALIZE LISTE-IO-AREA. LISTE-SPACE-AFTER SECTION. LISTE-SPACE-AFTER-P. WRITE LISTE-IO-PRINT BEFORE LISTE-AFTER-SPACE LINES ADD LISTE-AFTER-SPACE TO LISTE-LINE-COUNT INITIALIZE LISTE-IO-AREA MOVE 0 TO LISTE-AFTER-SPACE. DETAIL-OUTPUT SECTION. DETAIL-OUTPUT-P. IF (I-01 AND I-60) MOVE 'X' TO ORDNRM-IO-AREA (77:1) REWRITE ORDNRM-IO-AREA INVALID KEY DISPLAY 'Bad REWRITE - file = ORDNRM' END-REWRITE END-IF IF (I-01 AND I-U1) MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE DMFNR TO LISTE-IO-AREA (8:3) MOVE DMONR TO LISTE-IO-AREA (15:6) IF (I-60) MOVE 'OPPDATERT' TO LISTE-IO-AREA (32:9) END-IF MOVE 1 TO LISTE-AFTER-SPACE PERFORM LISTE-PRINT-LINE END-IF. HEADING-OUTPUT SECTION. HEADING-OUTPUT-P. IF (I-99 AND I-U1) OR (I-1P AND I-U1) MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE 'MEKANIKER STATISTIKK.' TO LISTE-IO-AREA (30:21) MOVE 'JOBB: VOS02A' TO LISTE-IO-AREA (101:12) MOVE 'PROGRAM: VOS050' TO LISTE-IO-AREA (116:15) MOVE 01 TO LISTE-BEFORE-SKIP MOVE 2 TO LISTE-AFTER-SPACE PERFORM LISTE-PRINT-LINE MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE 'OPPDATERING AV DAGENS' TO LISTE-IO-AREA (30:21) MOVE 'ORDRE.' TO LISTE-IO-AREA (52:6) MOVE 'DATO:' TO LISTE-IO-AREA (99:5) MOVE UDATE TO EDIT-DATE MOVE EDIT-DATE (7:8) TO LISTE-IO-AREA (103:8) MOVE 'TIDSPUNKT:' TO LISTE-IO-AREA (112:10) MOVE TIDSP TO EDIT-DATE MOVE EDIT-DATE (7:8) TO LISTE-IO-AREA (123:8) MOVE 1 TO LISTE-AFTER-SPACE PERFORM LISTE-PRINT-LINE END-IF IF (I-99 AND I-U1) MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE 'FIRMA' TO LISTE-IO-AREA (6:5) MOVE 'ORDRENR' TO LISTE-IO-AREA (14:7) MOVE 1 TO LISTE-AFTER-SPACE PERFORM LISTE-PRINT-LINE END-IF. HEADING-OVERFLOW SECTION
COBOL
. HEADING-OVERFLOW-P. IF (I-OF AND I-U1) MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE 'MEKANIKER STATISTIKK.' TO LISTE-IO-AREA (30:21) MOVE 'JOBB: VOS02A' TO LISTE-IO-AREA (101:12) MOVE 'PROGRAM: VOS050' TO LISTE-IO-AREA (116:15) MOVE 01 TO LISTE-BEFORE-SKIP MOVE 2 TO LISTE-AFTER-SPACE PERFORM LISTE-PRINT-LINE MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE 'OPPDATERING AV DAGENS' TO LISTE-IO-AREA (30:21) MOVE 'ORDRE.' TO LISTE-IO-AREA (52:6) MOVE 'DATO:' TO LISTE-IO-AREA (99:5) MOVE UDATE TO EDIT-DATE MOVE EDIT-DATE (7:8) TO LISTE-IO-AREA (103:8) MOVE 'TIDSPUNKT:' TO LISTE-IO-AREA (112:10) MOVE TIDSP TO EDIT-DATE MOVE EDIT-DATE (7:8) TO LISTE-IO-AREA (123:8) MOVE 1 TO LISTE-AFTER-SPACE PERFORM LISTE-PRINT-LINE END-IF IF (I-OF AND I-U1) MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE 'FIRMA' TO LISTE-IO-AREA (6:5) MOVE 'ORDRENR' TO LISTE-IO-AREA (14:7) MOVE 1 TO LISTE-AFTER-SPACE PERFORM LISTE-PRINT-LINE END-IF. TOTAL-OUTPUT SECTION. TOTAL-OUTPUT-P. IF (I-L1 AND I-U1) MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE 'ANTALL ORDRE FIRMA :' TO LISTE-IO-AREA (11:20) MOVE ANTORD TO XO-60YN9R MOVE XO-60YN9R TO LISTE-IO-AREA (31:7) MOVE 1 TO LISTE-BEFORE-SPACE MOVE 1 TO LISTE-AFTER-SPACE PERFORM LISTE-PRINT-LINE END-IF IF (I-LR AND I-U1) MOVE SPACES TO LISTE-IO-AREA INITIALIZE LISTE-IO-AREA MOVE 'ANTALL ORDRE TOTALT:' TO LISTE-IO-AREA (11:20) MOVE TOTORD TO XO-60YN9R MOVE XO-60YN9R TO LISTE-IO-AREA (31:7) MOVE 1 TO LISTE-BEFORE-SPACE MOVE 1 TO LISTE-AFTER-SPACE PERFORM LISTE-PRINT-LINE END-IF. HALT-INDICATOR-CHECK SECTION. HALT-INDICATOR-CHECK-P. IF (I-H0 OR I-H1 OR I-H2 OR I-H3 OR I-H4 OR I-H5 OR I-H6 OR I-H7 OR I-H8 OR I-H9) DISPLAY 'USER SET HALT INDICATORS ARE: ' F-H0 ',' F-H1 ',' F-H2 ',' F-H3 ',' F-H4 ',' F-H5 ',' F-H6 ',' F-H7 ',' F-H8 ',' F-H9 UPON CONSOLE GO TO MAINLINE-TERMINATION END-IF. INITIALIZATION SECTION. INITIALIZATION-P. MOVE ZERO TO RETURN-CODE MOVE ZEROS TO INDICATOR-TABLE SET I-1ST TO TRUE SET I-L0 TO TRUE SET I-1P TO TRUE SET NOT-IN-DETAIL-OUTPUT TO TRUE IF U-1-ON SET I-U1 TO TRUE END-IF IF U-2-ON SET I-U2 TO TRUE END-IF IF U-3-ON SET I-U3 TO TRUE END-IF IF U-4-ON SET I-U4 TO TRUE END-IF IF U-5-ON SET I-U5 TO TRUE END-IF IF U-6-ON SET I-U6 TO TRUE END-IF IF U-7-ON SET I-U7 TO TRUE END-IF IF U-8-ON SET I-U8 TO TRUE END-IF ACCEPT SYSTEM-DATE FROM DATE ACCEPT SYSTEM-TIME-X FROM TIME MOVE SYSTEM-YEAR TO UYEAR MOVE SYSTEM-MONTH TO UMONTH MOVE SYSTEM-DAY TO UDAY MOVE UDATE-DDMMYY TO UDATE MOVE 1 TO LR-CHECK SET DAGMEKI-LEVEL-INIT TO TRUE INITIALIZE DAGMEKI-DATA-FIELDS SET DAGMEKI-EOF-OFF TO TRUE SET DAGMEKI-PROCESS TO TRUE OPEN INPUT DAGMEKI OPEN I-O ORDNRM OPEN OUTPUT LISTE INITIALIZE LISTE-IO-AREA INITIALIZE LISTE-DATA-FIELDS MOVE 57 TO LISTE-MAX-LINES. INITIALIZE TEMPORARY-FIELDS. TERMINATION SECTION. TERMINATION-P. CLOSE DAGMEKI CLOSE ORDNRM IF LISTE-IO-AREA NOT = SPACES WRITE LISTE-IO-PRINT BEFORE 1 LINE MOVE SPACES TO LISTE-IO-AREA END-IF CLOSE LISTE. SETOFF-I-L SECTION. SET NOT-I-L1 TO TRUE. SET NOT-I-L2 TO TRUE. SET NOT-I-L3 TO TRUE. SET NOT-I-L4 TO TRUE. SET NOT-I-L5 TO TRUE. SET NOT-I-L6 TO TRUE. SET NOT-I-L7 TO TRUE. SET NOT-I-L8 TO TRUE. SET NOT-I-L9 TO TRUE. SETON-I-L9 SECTION. SET I-L9 TO TRUE. PERFORM SETON-I-L8. SETON-I-L8 SECTION. SET I-L8 TO TRUE. PERFORM SETON-I-L7. SETON-I-L7 SECTION. SET I-L7 TO TRUE. PERFORM SETON-I-L6. SETON-I-L6 SECTION. SET I-L6 TO TRUE. PERFORM SETON-I-L5. SETON-I-L5 SECTION. SET I-L5 TO TRUE. PERFORM SETON-I-L4. SETON-I-L4 SECTION. SET I-L4 TO TRUE. PERFORM SETON-I-L3. SETON-I-L3 SECTION. SET I-L3 TO TRUE. PERFORM SETON-I-L2. SETON-I-L2 SECTION. SET I-L2 TO TRUE. PERFORM SETON-I-L1. SETON-I-L1 SECTION. SET I-L1 TO TRUE. SETOFF-I-H SECTION. SET NOT-I-H1 TO TRUE. SET NOT-I-H2 TO TRUE. SET NOT-I-H3 TO TRUE. SET NOT-I-H4 TO TRUE. SET NOT-I-H5 TO TRUE. SET NOT-I-H6 TO TRUE. SET NOT-I-H7 TO TRUE. SET NOT-I-H8 TO TRUE. SET NOT-I-H9 TO TRUE. SET NOT-I-H0 TO TRUE. <|end_of_text|> *********************************************************** * Copybook name: SUPPIN * Original author: David Stagowski * * Description: A copybook used in the SUPPCALL program. * * This is a shortened version of the PSAP copybook. * This is only the Suppliers part. * * Maintenence Log * Date Author Maintenance Requirement * ---------- ------------ -------------------------------- * 2020-08-22 dastagg Created for ECBAP Final Project * ********************************************************** 01 SUPPLIERS. 05 SUPPLIER-CODE PIC X(10) VALUE SPACES. 05 SUPPLIER-TYPE PIC X(01) VALUE SPACES. 88 SUBCONTRACTOR VALUE 'S'. 88 DISTRIBUTOR VALUE 'D'. 88 MANUFACTURER VALUE 'M'. 88 IMPORTER VALUE 'I'. 05 SUPPLIER-NAME PIC X(15
COBOL
) VALUE SPACES. 05 SUPPLIER-PERF PIC 9(03) VALUE ZERO. 05 SUPPLIER-RATING PIC X(01) VALUE SPACES. 88 HIGHEST-QUALITY VALUE '3'. 88 AVERAGE-QUALITY VALUE '2'. 88 LOWEST-QUALITY VALUE '1'. 05 SUPPLIER-STATUS PIC X(01) VALUE SPACES. 88 GOVT-COMM VALUE '1'. 88 GOVT-ONLY VALUE '2'. 88 COMMERCIAL-ONLY VALUE '3'. 05 SUPPLIER-ACT-DATE PIC 9(08) VALUE ZERO. <|end_of_text|>identification division. program-id. htmlgen. data division. working-storage section. 01 outputBuffer pic x(1000). 01 outputBufferPointer pic 9(4). 01 indentLevel pic 9(4). 01 openTagNamesTable. 02 openTagNames pic x(100) occurs 100 times. linkage section. 01 outputBufferArgument pic x(1000). 01 tagName pic x(100). 01 textContent pic x(100). 01 attributeName pic x(100). 01 attributeValue pic x(100). procedure division. entry "htmlgen-initialize" move 0 to indentLevel move 1 to outputBufferPointer move spaces to outputBuffer goback. entry "htmlgen-start-element" using by content tagName add 1 to indentLevel move tagName to openTagNames(indentLevel) string "<" openTagNames(indentLevel) delimited by space ">" into outputBuffer with pointer outputBufferPointer goback. entry "htmlgen-add-attribute" using by content attributeName, by content attributeValue subtract 1 from outputBufferPointer string " " delimited by size attributeName delimited by spaces "='" attributeValue delimited by spaces "'>" into outputBuffer with pointer outputBufferPointer goback. entry "htmlgen-tostring" using outputBufferArgument move outputBuffer to outputBufferArgument goback. entry "htmlgen-end-element" string "</" openTagNames(indentLevel) delimited by space ">" into outputBuffer with pointer outputBufferPointer subtract 1 from indentLevel goback. entry "htmlgen-add-text-content" using by content textContent string textContent delimited by space into outputBuffer with pointer outputBufferPointer goback. goback.<|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. C06E01. AUTHOR. Andrei Stoica. * Continually calculates using two numbers and an operator * Ends when "s" is entered instead of an operator DATA DIVISION. WORKING-STORAGE SECTION. 01 Num1 PIC 9. 01 Num2 PIC 9. 01 Result PIC --9.99 VALUE ZERO. 01 Operator PIC X. 88 ValidOperator VALUE '+', '-', '*', '/', 'S'. 88 StopOperator VALUE 'S'. PROCEDURE DIVISION. 00000-CALCULATE-RESULT. PERFORM GetValidOperator UNTIL ValidOperator PERFORM UNTIL StopOperator DISPLAY 'Enter a single digit number -' ACCEPT Num1 DISPLAY 'Enter a single digit number -' ACCEPT Num2 EVALUATE Operator WHEN '+' ADD Num1 TO Num2 GIVING Result WHEN '-' SUBTRACT Num2 FROM Num1 GIVING Result WHEN '*' MULTIPLY Num1 BY Num2 GIVING Result WHEN '/' DIVIDE Num1 BY Num2 GIVING Result END-EVALUATE DISPLAY 'Result is ='Result INITIALIZE Operator PERFORM GetValidOperator UNTIL ValidOperator END-PERFORM DISPLAY 'Exiting calculator.' STOP RUN. GetValidOperator. DISPLAY 'Enter operator(+,-,*,/) OR "S" to Quit -' ACCEPT Operator . <|end_of_text|> *> VERBO ADD IDENTIFICATION DIVISION. PROGRAM-ID. VERBO_ADD. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-NUM1 PIC 9(9) VALUE 10. 01 WS-NUM2 PIC 9(9) VALUE 10. 01 WS-NUM3 PIC 9(9) VALUE 10. 01 WS-NUM4 PIC 9(9) VALUE 10. 01 WS-NUMA PIC 9(9) VALUE 10. 01 WS-NUMB PIC 9(9) VALUE 10. 01 WS-NUMC PIC 9(9) VALUE 10. 01 WS-NUMD PIC 9(9) VALUE 10. 01 WS-NUME PIC 9(9) VALUE 10. 01 WS-TESTE PIC 9(9) VALUE 10. PROCEDURE DIVISION. ADD WS-NUM1 TO WS-TESTE. ADD WS-NUM1 WS-NUM2 TO WS-NUM3 WS-NUM4.*> 1,2 E 3 SÃO SOMADAS E O RESULTADO É SALVO NA 3. 1, 2 E 4 SÃO SOMADAS E O RESULTADO É SALVO NA 4 ADD WS-NUMA WS-NUMB WS-NUMC TO WS-NUMD GIVING WS-NUME. *> NUMA, NUMB,NUMC E NUMD, SÃO SOMADAS E O RESULTADO É COLOCADO EM E DISPLAY "WS-TESTE :" WS-TESTE DISPLAY "WS-NUM2 :" WS-NUM2 DISPLAY "WS-NUM3 :" WS-NUM3 DISPLAY "WS-NUM4 :" WS-NUM4 DISPLAY "WS-NUMA :" WS-NUMA DISPLAY "WS-NUMB :" WS-NUMB DISPLAY "WS-NUMC :" WS-NUMC DISPLAY "WS-NUMD :" WS-NUMD DISPLAY "WS-NUME :" WS-NUME STOP RUN. <|end_of_text|>IDENTIFICATION DIVISION. PROGRAM-ID. WORKING-STORAGE-TESTING. DATA DIVISION. WORKING-STORAGE SECTION 01 WS-NAME PIC X(10) VALUE 'SCOTT'. PROCEDURE DIVISION DISPLAY WS-NAME. END RUN. <|end_of_text|> ****************************************************** ***** ***** ***** U@ž@ζ@‹β@s@ƒ}@ƒX@ƒ^@[ ***** ***** ( F B K M ) 64/4 ***** ****************************************************** 01 FBKM. 02 FBKM_PNAME1 PIC X(004) VALUE "FBKM". 02 F PIC X(001). 02 FBKM_LNAME PIC X(004) VALUE "FBKM". 02 F PIC X(001). 02 FBKM_KEY1 PIC X(100) VALUE SPACE. 02 FBKM_SORT PIC X(100) VALUE SPACE. 02 FBKM_IDLST PIC X(100) VALUE SPACE. 02 FBKM_RES USAGE POINTER. 01 FBK-R. 02 FBK-KEY. ƒR[ƒh 03 FBK-BKC PIC 9(004). ‹βsΊ°Δή 03 FBK-HSC PIC 9(003). Žx“XΊ°Δή 02 FBK-BNA. 03 FBK-BKN PIC X(015). ‹βs–Ό 03 FBK-HSN PIC X(015). –{Žx“X–Ό 02 F PIC X(001). 02 FBK-ENG PIC 9(004). 77 F PIC X(1). <|end_of_text|> 01 CADCLIENTE. 02 BLANK SCREEN. 02 LINE 01 COL 01 VALUE "******************************". 02 LINE 02 COL 05 VALUE "CADASTRAR CLIENTE". 02 LINE 03 COL 02 VALUE "CPF: ". 02 LINE 03 COL 13 PIC Z(11) TO WS-CCPF. 02 LINE 04 COL 02 VALUE "NOME: ". 02 LINE 04 COL 13 PIC X(50) TO WS
COBOL
-CNOME. 02 LINE 06 COL 05 VALUE "ENDERECO". 02 LINE 07 COL 02 VALUE "CEP: ". 02 LINE 07 COL 13 PIC Z(8) TO WS-CCEP. 02 LINE 08 COL 02 VALUE "RUA: ". 02 LINE 08 COL 13 PIC X(50) TO WS-CRUA. 02 LINE 09 COL 02 VALUE "NUMERO: ". 02 LINE 09 COL 14 PIC Z(5) TO WS-CNUM. 02 LINE 10 COL 02 VALUE "BAIRRO: ". 02 LINE 10 COL 13 PIC X(50) TO WS-CBAI. 02 LINE 11 COL 02 VALUE "CIDADE: ". 02 LINE 11 COL 13 PIC X(50) TO WS-CCID. 02 LINE 12 COL 02 VALUE "ESTADO: ". 02 LINE 12 COL 13 PIC X(2) TO WS-CUF. <|end_of_text|> ******************************************************************* * Project code name "ORCA" * 日医標準レセプトソフト(JMA standard receipt software) * Copyright(C) 2002 JMA (Japan Medical Association) * * This program is part of "JMA standard receipt software". * * This program is distributed in the hope that it will be useful * for further advancement in medical care, according to JMA Open * Source License, but WITHOUT ANY WARRANTY. * Everyone is granted permission to use, copy, modify and * redistribute this program, but only under the conditions described * in the JMA Open Source License. You should have received a copy of * this license along with this program. If not, stop using this * program and contact JMA, 2-28-16 Honkomagome, Bunkyo-ku, Tokyo, * 113-8621, Japan. ******************************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. ORAPI031RC3V2. ***************************************************************** * システム名 : 日医標準レセプトソフト * サブシステム名 : API連携用モジュール * コンポーネント名 : 室料差額編集 * 管理者 : * 作成日付 作業者 記述 * 17/12/04 NACL−太田 新規作成 ***************************************************************** * プログラム修正履歴 * Maj/Min/Rev 修正者 日付 内容 ***************************************************************** * ENVIRONMENT DIVISION. CONFIGURATION SECTION. INPUT-OUTPUT SECTION. FILE-CONTROL. * DATA DIVISION. FILE SECTION. * WORKING-STORAGE SECTION. * * スパ領域 COPY "COMMON-SPA". * 01 FLG-AREA. 03 FLG-SYSKANRI PIC 9(01). 03 FLG-LOOPEND PIC 9(01). * 01 IDX-AREA. 03 IDX0 PIC 9(05). 03 IDX1 PIC 9(05). 03 IDXL PIC 9(05). 03 IDXM PIC 9(05). * * 一時領域 01 WRK-AREA. 03 WRK-YMD PIC X(10). 03 WRK-ZOGENPTN PIC X(01). 03 WRK-ZOGEN PIC S9(05). 03 WRK-KEISANYMD PIC X(08). 03 WRK-SYMD. 05 WRK-SYY PIC 9(04). 05 WRK-SMM PIC 9(02). 05 WRK-SDD PIC 9(02). 03 WRK-EDTYMD1 PIC X(09). 03 WRK-DATE. 05 WRK-DATE-YY PIC 9(04). 05 WRK-DATE-FL1 PIC X(01). 05 WRK-DATE-MM PIC 9(02). 05 WRK-DATE-FL2 PIC X(01). 05 WRK-DATE-DD PIC 9(02). 03 WRK-HMS. 05 WRK-HMS-HH PIC 9(02). 05 WRK-HMS-MM PIC 9(02). 05 WRK-HMS-SS PIC 9(02). 03 WRK-TIME. 05 WRK-TIME-HH PIC 9(02). 05 WRK-TIME-FL1 PIC X(01). 05 WRK-TIME-MM PIC 9(02). 05 WRK-TIME-FL2 PIC X(01). 05 WRK-TIME-SS PIC 9(02). 03 WRK-SRYYMD. 05 WRK-SRYYMD-YM PIC X(06). 05 WRK-SRYYMD-DD PIC 9(02). 03 WRK-SAGAKUZ9 PIC ZZZZZ9. 03 WRK-ERRIDXZ9 PIC Z9. 03 WRK-EDYUKYMD PIC X(8). * 01 API-AREA. 03 API-BASEYMD PIC X(08). 03 API-ERRFLG PIC 9(01). 03 API-RMSAGAKU-LAST PIC 9(05). 03 API-RMSAGAKU-OCC OCCURS 99. 05 API-TKBNCD PIC X(02). 05 API-TSAGAKU PIC 9(07). 05 API-TSTYUKYMD PIC X(08). 05 API-TEDYUKYMD PIC X(08). 05 API-TLASTSTYMD PIC X(08). 05 API-TLASTEDYMD PIC X(08). 05 API-TUPEDYMD PIC X(08). 05 API-TFORCE PIC X(04). 05 API-TERRCD PIC X(04). * 01 CONST-AREA. 03 CONST-RMSAGAKU-INF-MAX PIC 9(05) VALUE 99. 03 CONST-SELECT PIC X(02) VALUE "01". 03 CONST-INSERT PIC X(02) VALUE "02". 03 CONST-UPDATE PIC X(02) VALUE "03". 03 CONST-DELETE PIC X(02) VALUE "04". * ***************************************************************** * サブプロ用 領域 ***************************************************************** * COPY "CPORCSCOMMON.INC". * * マシン日付取得サブ COPY "CPORCSMCNDATE.INC". * * 日付変換サブ COPY "CPORCSDAY.INC". COPY "CPORCSLNK.INC". * * 数字変換領域 COPY "CPORCSNUM.INC". * * API XML読み込み用定義体 COPY "CPAPIV2REQ.INC". COPY "CPHSCONFRCV2REQ.INC". * * API XML書き込み用定義体 COPY "CPHSCONFRCV2RES.INC". * ***************************************************************** * ファイルレイアウト ***************************************************************** * * システム管理 COPY "CPSYSKANRI.INC". COPY "CPSK1010.INC". COPY "CPSK5113.INC". * COPY "MCPDATA.INC". * ***************************************************************** * 連絡領域 ***************************************************************** LINKAGE SECTION. COPY "MCPAREA". COPY "ORCA-SPA". COPY "LINKAREA". * 01 SCRAREA. COPY "API01RV2SCRAREA.INC". * PROCEDURE DIVISION USING MCPAREA SPAAREA LINKAREA SCRAREA. * ***************************************************************** * 主処理 ***************************************************************** 000-MAIN-SEC SECTION. * * 使用不可とする。 IF ( 1 = 1 ) MOVE LOW-VALUE TO APILST36-BODY MOVE 404 TO APILST36-HTTPSTATUS GO TO 000-MAIN-
COBOL
EXIT END-IF * DISPLAY "***************************" DISPLAY "* hsconfroomcharge start *" DISPLAY "***************************" * INITIALIZE FLG-AREA INITIALIZE IDX-AREA INITIALIZE WRK-AREA INITIALIZE SPA-AREA INITIALIZE API-AREA * * 初期処理 PERFORM 100-INIT-SEC * * 主処理 IF ( SPA-ERRCD = SPACE ) PERFORM 200-MAIN-SEC END-IF * * 返却領域編集 PERFORM 300-END-SEC * DISPLAY "**************************" DISPLAY "* hsconfroomcharge end *" DISPLAY "**************************" . 000-MAIN-EXIT. EXIT PROGRAM. * * ***************************************************************** * 初期 処理 ***************************************************************** 100-INIT-SEC SECTION. * INITIALIZE XML-HSCONFRCRES * * 更新日取得 INITIALIZE ORCSMCNDATEAREA CALL "ORCSMCNDATE" USING ORCSMCNDATEAREA * MOVE MCP-USER TO SPA-OPID * MOVE SMCNDATE-YMD TO SPA-SYSYMD * * 医療機関識別番号セット MOVE "API" TO SPA-MOTOPG CALL "ORCSHOSPNUM" USING MCPAREA SPA-AREA IF ( SPA-ERRCD NOT = SPACE ) MOVE "0099" TO SPA-ERRCD PERFORM 990-EXIT-PROGRAM-SEC END-IF * * SPA共通設定 INITIALIZE SYS-1010-REC INITIALIZE ORCSCOMMONAREA MOVE "M00" TO ORCSCOMMON-PG CALL "ORCSCOMMON" USING MCPAREA SPA-AREA ORCSCOMMONAREA SYS-1010-REC IF ( SPA-ERRCD NOT = SPACE ) EVALUATE SPA-ERRCD WHEN "1001" MOVE "8901" TO SPA-ERRCD WHEN "1002" MOVE "8902" TO SPA-ERRCD WHEN "1003" MOVE "8903" TO SPA-ERRCD WHEN "1005" MOVE "8905" TO SPA-ERRCD WHEN "1015" MOVE "8915" TO SPA-ERRCD WHEN OTHER MOVE "8900" TO SPA-ERRCD END-EVALUATE PERFORM 990-EXIT-PROGRAM-SEC END-IF * * XML情報取り出し PERFORM 900-XML-READ-SEC IF ( SPA-ERRCD NOT = SPACE ) PERFORM 990-EXIT-PROGRAM-SEC END-IF * . 100-INIT-EXT. EXIT. ***************************************************************** * 主 処理 ***************************************************************** 200-MAIN-SEC SECTION. * IF ( SPA-ERRCD = SPACE ) PERFORM 2001-INPUT-CHK-SEC END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 2002-DB-SEC END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 2003-RESPONSE-EDIT-SEC END-IF * . 200-MAIN-EXT. EXIT. * ***************************************************************** * 入力項目チェック処理 ***************************************************************** 2001-INPUT-CHK-SEC SECTION. * IF ( SPA-ERRCD = SPACE ) EVALUATE HSCONFRCREQ-REQNUM WHEN SPACE WHEN CONST-SELECT MOVE "01" TO HSCONFRCREQ-REQNUM PERFORM 20011-INPUT-CHK-SEC WHEN CONST-INSERT WHEN CONST-UPDATE WHEN CONST-DELETE PERFORM 20012-INPUT-CHK-SEC WHEN OTHER MOVE "0001" TO SPA-ERRCD END-EVALUATE END-IF * . 2001-INPUT-CHK-EXT. EXIT. ***************************************************************** * 参照時入力項目チェック処理 ***************************************************************** 20011-INPUT-CHK-SEC SECTION. * IF ( SPA-ERRCD = SPACE ) PERFORM 2001-BASEYMD-CHK-SEC END-IF * . 20011-INPUT-CHK-CHK-EXT. EXIT. ***************************************************************** * 追加・更新・削除時入力項目チェック処理 ***************************************************************** 20012-INPUT-CHK-SEC SECTION. * MOVE ZERO TO IDX1 * IF ( SPA-ERRCD = SPACE ) PERFORM 2001-BASEYMD-CHK-SEC END-IF * IF ( SPA-ERRCD = SPACE ) * PERFORM VARYING IDXL FROM 1 BY 1 UNTIL ( IDXL > CONST-RMSAGAKU-INF-MAX ) * IF ( HSCONFRCREQ-TKBNCD (IDXL) NOT = SPACE ) * COMPUTE IDX1 = IDX1 + 1 * MOVE IDXL TO API-RMSAGAKU-LAST * MOVE SPACE TO SPA-ERRCD * EVALUATE HSCONFRCREQ-REQNUM WHEN CONST-INSERT PERFORM 2001-INSERT-INPUT-CHK-SEC WHEN CONST-UPDATE PERFORM 2001-UPDATE-INPUT-CHK-SEC WHEN CONST-DELETE PERFORM 2001-DELETE-INPUT-CHK-SEC END-EVALUATE * IF ( SPA-ERRCD NOT = SPACE ) MOVE SPA-ERRCD TO API-TERRCD (IDXL) MOVE 1 TO API-ERRFLG END-IF END-IF * END-PERFORM * IF ( API-ERRFLG = 1 ) MOVE "0003" TO SPA-ERRCD END-IF END-IF * IF ( SPA-ERRCD = SPACE ) IF ( IDX1 = ZERO ) MOVE "0004" TO SPA-ERRCD END-IF END-IF * . 2001-INSERT-INPUT-CHK-EXT. EXIT. ***************************************************************** * 追加時入力項目チェック処理 ***************************************************************** 2001-INSERT-INPUT-CHK-SEC SECTION. * IF ( SPA-ERRCD = SPACE ) PERFORM 20011-KBNCD-CHK-SEC END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 20011-SAGAKU-CHK-SEC END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 20011-STYUKYMD-CHK-SEC END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 20011-EDYUKYMD-CHK-SEC END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 20011-FORCE-CHK-SEC END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 20011-OTHER-CHK-SEC END-IF * . 2001-INSERT-INPUT-CHK-EXT. EXIT. ***************************************************************** * 更新時入力項目チェック処理 ***************************************************************** 2001-UPDATE-INPUT-CHK-SEC SECTION. * IF ( SPA-ERRCD = SPACE ) PERFORM 20011-KBNCD-CHK-SEC END-IF * IF ( SPA-ERRCD = SPACE ) IF ( HSCONFRCREQ-TSAGAKU (IDXL) NOT = SPACE ) PERFORM 20011-SAGAKU-CHK-SEC
COBOL
END-IF END-IF * IF ( SPA-ERRCD = SPACE ) IF ( HSCONFRCREQ-TSTYUKYMD (IDXL) NOT = SPACE ) PERFORM 20011-STYUKYMD-CHK-SEC END-IF END-IF * IF ( SPA-ERRCD = SPACE ) IF ( HSCONFRCREQ-TEDYUKYMD (IDXL) NOT = SPACE ) PERFORM 20011-EDYUKYMD-CHK-SEC END-IF END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 20011-OTHER-CHK-SEC END-IF * . 2001-UPDATE-INPUT-CHK-EXT. EXIT. ***************************************************************** * 削除時入力項目チェック処理 ***************************************************************** 2001-DELETE-INPUT-CHK-SEC SECTION. * IF ( SPA-ERRCD = SPACE ) PERFORM 20011-KBNCD-CHK-SEC END-IF * . 2001-DELETE-INPUT-CHK-EXT. EXIT. ***************************************************************** * 基準日チェック処理 ***************************************************************** 2001-BASEYMD-CHK-SEC SECTION. * IF ( HSCONFRCREQ-BASEYMD = SPACE ) MOVE SPA-SYSYMD TO API-BASEYMD ELSE MOVE HSCONFRCREQ-BASEYMD TO WRK-DATE PERFORM 800-SYMD-SEC PERFORM 800-HIZUKE-SEC IF ( WRK-EDTYMD1 = SPACE ) MOVE "0002" TO SPA-ERRCD ELSE MOVE WRK-SYMD TO API-BASEYMD END-IF END-IF * . 2001-BASEYMD-CHK-EXT. EXIT. ***************************************************************** * 室料差額コードチェック処理 ***************************************************************** 20011-KBNCD-CHK-SEC SECTION. * IF ( SPA-ERRCD = SPACE ) IF ( HSCONFRCREQ-TKBNCD (IDXL)(1:2) IS NUMERIC ) AND ( HSCONFRCREQ-TKBNCD (IDXL) >= "01" ) AND ( HSCONFRCREQ-TKBNCD (IDXL) <= "99" ) MOVE HSCONFRCREQ-TKBNCD (IDXL) TO API-TKBNCD (IDXL) ELSE MOVE "0005" TO SPA-ERRCD END-IF END-IF * IF ( SPA-ERRCD = SPACE ) AND ( HSCONFRCREQ-REQNUM = CONST-UPDATE OR CONST-DELETE ) * INITIALIZE SYSKANRI-REC MOVE SPA-HOSPNUM TO SYS-HOSPNUM MOVE "5113" TO SYS-KANRICD MOVE API-TKBNCD (IDXL) TO SYS-KBNCD MOVE API-BASEYMD TO SYS-STYUKYMD SYS-EDYUKYMD PERFORM 900-SYSKANRI-KEY10-SEL-SEC IF ( FLG-SYSKANRI = ZERO ) MOVE SYSKANRI-REC TO SYS-5113-REC MOVE SYS-5113-BRM-SAGAKU-NM TO API-TSAGAKU (IDXL) MOVE SYS-5113-STYUKYMD TO API-TSTYUKYMD (IDXL) MOVE SYS-5113-EDYUKYMD TO API-TEDYUKYMD (IDXL) ELSE MOVE "0006" TO SPA-ERRCD END-IF * END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM VARYING IDXM FROM 1 BY 1 UNTIL ( IDXM >= IDXL ) OR ( SPA-ERRCD NOT = SPACE ) IF ( HSCONFRCREQ-TKBNCD (IDXL) = HSCONFRCREQ-TKBNCD (IDXM)) MOVE "0007" TO SPA-ERRCD END-IF END-PERFORM END-IF * . 20011-KBNCD-CHK-EXT. EXIT. ***************************************************************** * 室料差額チェック処理 ***************************************************************** 20011-SAGAKU-CHK-SEC SECTION. * IF ( SPA-ERRCD = SPACE ) AND ( HSCONFRCREQ-REQNUM = CONST-INSERT ) IF ( HSCONFRCREQ-TSAGAKU (IDXL) = SPACE ) MOVE "0008" TO SPA-ERRCD END-IF END-IF * IF ( SPA-ERRCD = SPACE ) * INITIALIZE ORCSNUMAREA MOVE HSCONFRCREQ-TSAGAKU (IDXL) TO SNUM-INX CALL "ORCSNUM" USING ORCSNUMAREA IF ( SNUM-RC NOT = ZERO ) OR ( SNUM-MINKBN NOT = SPACE ) OR ( SNUM-SYOKBN NOT = SPACE ) MOVE "0009" TO SPA-ERRCD ELSE MOVE SNUM-OUTNUM TO API-TSAGAKU (IDXL) * IF ( API-TSAGAKU (IDXL) > 300000 ) MOVE "0015" TO SPA-ERRCD END-IF * END-IF END-IF * . 20011-SAGAKU-CHK-EXT. EXIT. ***************************************************************** * 有効期間開始日チェック処理 ***************************************************************** 20011-STYUKYMD-CHK-SEC SECTION. * IF ( HSCONFRCREQ-TSTYUKYMD (IDXL) = SPACE ) OR ( HSCONFRCREQ-TSTYUKYMD (IDXL)(1:4) = "0000" ) MOVE "00000000" TO API-TSTYUKYMD (IDXL) ELSE MOVE HSCONFRCREQ-TSTYUKYMD (IDXL) TO WRK-DATE PERFORM 800-SYMD-SEC PERFORM 800-HIZUKE-SEC IF ( WRK-EDTYMD1 = SPACE ) MOVE "0010" TO SPA-ERRCD ELSE MOVE WRK-SYMD TO API-TSTYUKYMD (IDXL) END-IF END-IF * . 20011-STYUKYMD-CHK-EXT. EXIT. ***************************************************************** * 有効期間終了日チェック処理 ***************************************************************** 20011-EDYUKYMD-CHK-SEC SECTION. * IF ( HSCONFRCREQ-TEDYUKYMD (IDXL) = SPACE ) OR ( HSCONFRCREQ-TEDYUKYMD (IDXL)(1:4) = "9999" ) MOVE "99999999" TO API-TEDYUKYMD (IDXL) ELSE MOVE HSCONFRCREQ-TEDYUKYMD (IDXL) TO WRK-DATE PERFORM 800-SYMD-SEC PERFORM 800-HIZUKE-SEC IF ( WRK-EDTYMD1 = SPACE ) MOVE "0011" TO SPA-ERRCD ELSE MOVE WRK-SYMD TO API-TEDYUKYMD (IDXL) END-IF END-IF * . 20011-EDYUKYMD-CHK-EXT. EXIT. ***************************************************************** * 強制更新フラグチェック処理 ***************************************************************** 20011-FORCE-CHK-SEC SECTION. * EVALUATE FUNCTION UPPER-CASE(HSCONFRCREQ-TFORCE (IDXL)) WHEN SPACE WHEN "FALSE" CONTINUE WHEN
COBOL
"TRUE" MOVE "1" TO API-TFORCE (IDXL) WHEN OTHER MOVE "0012" TO SPA-ERRCD END-EVALUATE * . 20011-FORCE-CHK-EXT. EXIT. ***************************************************************** * その他チェック処理 ***************************************************************** 20011-OTHER-CHK-SEC SECTION. * IF ( API-TSTYUKYMD (IDXL) > API-TEDYUKYMD (IDXL)) MOVE "0013" TO SPA-ERRCD END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 200111-KIKAN-CHK-SEC END-IF * . 20011-OTHER-CHK-EXT. EXIT. ***************************************************************** * 有効期間チェック処理 ***************************************************************** 200111-KIKAN-CHK-SEC SECTION. * INITIALIZE SYSKANRI-REC MOVE SPA-HOSPNUM TO SYS-HOSPNUM MOVE "5113" TO SYS-KANRICD MOVE API-TKBNCD (IDXL) TO SYS-KBNCD MOVE API-TSTYUKYMD (IDXL) TO SYS-EDYUKYMD MOVE API-TEDYUKYMD (IDXL) TO SYS-STYUKYMD PERFORM 900-SYSKANRI-KEY26-SEL-SEC * PERFORM UNTIL ( FLG-SYSKANRI NOT = ZERO ) OR ( SPA-ERRCD NOT = SPACE ) * EVALUATE HSCONFRCREQ-REQNUM WHEN CONST-INSERT EVALUATE TRUE WHEN ( API-TFORCE (IDXL) = SPACE ) WHEN ( API-TSTYUKYMD (IDXL) <= SYS-STYUKYMD ) MOVE "0014" TO SPA-ERRCD END-EVALUATE * IF ( API-TSTYUKYMD (IDXL) > SYS-STYUKYMD ) * MOVE SYS-STYUKYMD TO API-TLASTSTYMD (IDXL) MOVE SYS-EDYUKYMD TO API-TLASTEDYMD (IDXL) * MOVE API-TSTYUKYMD (IDXL) TO WRK-YMD MOVE "1" TO WRK-ZOGENPTN MOVE -1 TO WRK-ZOGEN PERFORM 800-CALENDAR-SEC MOVE WRK-KEISANYMD TO API-TUPEDYMD (IDXL) END-IF WHEN CONST-UPDATE IF ( API-BASEYMD >= SYS-STYUKYMD ) AND ( API-BASEYMD <= SYS-EDYUKYMD ) CONTINUE ELSE MOVE "0014" TO SPA-ERRCD END-IF END-EVALUATE * PERFORM 900-SYSKANRI-KEY26-FET-SEC * END-PERFORM * MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key26" TO MCP-PATHNAME PERFORM 910-DBCLOSECURSOR-SEC * . 200111-KIKAN-CHK-EXT. EXIT. ***************************************************************** * データベース更新処理 ***************************************************************** 2002-DB-SEC SECTION. * PERFORM VARYING IDXL FROM 1 BY 1 UNTIL ( IDXL > API-RMSAGAKU-LAST ) OR ( SPA-ERRCD NOT = SPACE ) * IF ( API-TKBNCD (IDXL) NOT = SPACE ) PERFORM 20021-DB-SEC END-IF END-PERFORM * . 2002-DB-EXT. EXIT. ***************************************************************** * データベース更新処理 ***************************************************************** 20021-DB-SEC SECTION. * EVALUATE HSCONFRCREQ-REQNUM WHEN CONST-INSERT IF ( SPA-ERRCD = SPACE ) IF ( API-TLASTSTYMD (IDXL) NOT = SPACE ) PERFORM 200211-LAST-UPDATE-SEC END-IF END-IF * IF ( SPA-ERRCD = SPACE ) PERFORM 200211-INSERT-SEC END-IF WHEN CONST-UPDATE IF ( SPA-ERRCD = SPACE ) PERFORM 200211-UPDATE-SEC END-IF WHEN CONST-DELETE IF ( SPA-ERRCD = SPACE ) PERFORM 200211-DELETE-SEC END-IF END-EVALUATE * . 20021-DB-EXT. EXIT. ***************************************************************** * 有効期間終了日更新処理 ***************************************************************** 200211-LAST-UPDATE-SEC SECTION. * INITIALIZE SYSKANRI-REC MOVE SPA-HOSPNUM TO SYS-HOSPNUM MOVE "5113" TO SYS-KANRICD MOVE API-TKBNCD (IDXL) TO SYS-KBNCD MOVE API-TUPEDYMD (IDXL) TO SYS-STYUKYMD SYS-EDYUKYMD MOVE SPA-OPID TO SYS-OPID MOVE SMCNDATE-YMD TO SYS-UPYMD MOVE SMCNDATE-HMS TO SYS-UPHMS MOVE SYSKANRI-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "upd3" TO MCP-PATHNAME PERFORM 910-DBUPDATE-SEC IF ( MCP-RC NOT = ZERO ) MOVE "4001" TO SPA-ERRCD END-IF * . 200211-LAST-UPDATE-EXT. EXIT. ***************************************************************** * 室料差額追加処理 ***************************************************************** 200211-INSERT-SEC SECTION. * INITIALIZE SYS-5113-REC MOVE SPA-HOSPNUM TO SYS-5113-HOSPNUM MOVE "5113" TO SYS-5113-KANRICD MOVE API-TKBNCD (IDXL) TO SYS-5113-KBNCD MOVE API-TSTYUKYMD (IDXL) TO SYS-5113-STYUKYMD MOVE API-TEDYUKYMD (IDXL) TO SYS-5113-EDYUKYMD MOVE API-TSAGAKU (IDXL) TO SYS-5113-BRM-SAGAKU-NM MOVE SPA-OPID TO SYS-5113-OPID MOVE SMCNDATE-YMD TO SYS-5113-CREYMD SYS-5113-UPYMD MOVE SMCNDATE-HMS TO SYS-5113-UPHMS MOVE SYS-5113-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBINSERT-SEC IF ( MCP-RC NOT = ZERO ) MOVE "4002" TO SPA-ERRCD END-IF * . 200211-INSERT-EXT. EXIT. ***************************************************************** * 室料差額更新処理 ***************************************************************** 200211-UPDATE-SEC SECTION. * INITIALIZE SYS-5113-REC MOVE SPA-HOSPNUM TO SYS-5113-HOSPNUM MOVE "5113" TO SYS-5113-KANRICD MOVE API-TKBNCD (IDXL) TO SYS-5113-KBNCD MOVE API-BASEYMD TO SYS-5113-STYUKYMD SYS-5113-EDYUKYMD MOVE SYS-5113-REC TO SYSKANRI-REC PERFORM 900-SYSKANRI-KEY10-SEL-SEC IF ( FLG-SYSKANRI = ZERO ) MOVE SYSKANRI
COBOL
-REC TO SYS-5113-REC MOVE API-TSTYUKYMD(IDXL) TO SYS-5113-STYUKYMD MOVE API-TEDYUKYMD(IDXL) TO SYS-5113-EDYUKYMD MOVE API-TSAGAKU (IDXL) TO SYS-5113-BRM-SAGAKU-NM MOVE SPA-OPID TO SYS-5113-OPID MOVE SMCNDATE-YMD TO SYS-5113-UPYMD MOVE SMCNDATE-HMS TO SYS-5113-UPHMS MOVE SYS-KEY TO SYS-5113-UPD-KEY MOVE SYS-5113-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "upd1" TO MCP-PATHNAME PERFORM 910-DBUPDATE-SEC IF ( MCP-RC NOT = ZERO ) MOVE "4003" TO SPA-ERRCD END-IF ELSE * MOVE "4004" TO SPA-ERRCD * INITIALIZE SYSKANRI-REC MOVE SYSKANRI-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "abort" TO MCP-PATHNAME PERFORM 911-DBSELECT-SEC END-IF * . 200211-UPDATE-EXT. EXIT. ***************************************************************** * 室料差額削除処理 ***************************************************************** 200211-DELETE-SEC SECTION. * INITIALIZE SYS-5113-REC MOVE SPA-HOSPNUM TO SYS-5113-HOSPNUM MOVE "5113" TO SYS-5113-KANRICD MOVE API-TKBNCD (IDXL) TO SYS-5113-KBNCD MOVE API-BASEYMD TO SYS-5113-STYUKYMD SYS-5113-EDYUKYMD MOVE SYS-5113-REC TO SYSKANRI-REC PERFORM 900-SYSKANRI-KEY10-SEL-SEC IF ( FLG-SYSKANRI = ZERO ) MOVE SYSKANRI-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBDELETE-SEC IF ( MCP-RC NOT = ZERO ) MOVE "4005" TO SPA-ERRCD END-IF ELSE * MOVE "4006" TO SPA-ERRCD * INITIALIZE SYSKANRI-REC MOVE SYSKANRI-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "abort" TO MCP-PATHNAME PERFORM 911-DBSELECT-SEC END-IF * . 200211-DELETE-EXT. EXIT. ***************************************************************** * レスポンス編集処理 ***************************************************************** 2003-RESPONSE-EDIT-SEC SECTION. * MOVE HSCONFRCREQ-REQNUM TO HSCONFRCRES-REQNUM * MOVE API-BASEYMD TO WRK-SYMD PERFORM 800-DATE-SEC MOVE WRK-DATE TO HSCONFRCRES-BASEYMD * INITIALIZE SYS-5113-REC MOVE "5113" TO SYS-5113-KANRICD MOVE API-BASEYMD TO SYS-5113-STYUKYMD SYS-5113-EDYUKYMD MOVE SYS-5113-REC TO SYSKANRI-REC PERFORM 900-SYSKANRI-KEY2-SEL-SEC * MOVE ZERO TO IDXL * PERFORM UNTIL ( FLG-SYSKANRI NOT = ZERO ) OR ( IDXL >= CONST-RMSAGAKU-INF-MAX ) * COMPUTE IDXL = IDXL + 1 * MOVE SYSKANRI-REC TO SYS-5113-REC * MOVE SYS-5113-KBNCD(1:2) TO HSCONFRCRES-TKBNCD (IDXL) * MOVE SYS-5113-BRM-SAGAKU-NM TO WRK-SAGAKUZ9 MOVE WRK-SAGAKUZ9 TO HSCONFRCRES-TSAGAKU (IDXL) * MOVE SYS-5113-STYUKYMD TO WRK-SYMD PERFORM 800-DATE-SEC MOVE WRK-DATE TO HSCONFRCRES-TSTYUKYMD (IDXL) * MOVE SYS-5113-EDYUKYMD TO WRK-SYMD PERFORM 800-DATE-SEC MOVE WRK-DATE TO HSCONFRCRES-TEDYUKYMD (IDXL) * PERFORM 900-SYSKANRI-KEY2-FET-SEC * END-PERFORM * MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME PERFORM 910-DBCLOSECURSOR-SEC * . 2003-RESPONSE-EDIT-EXT. EXIT. ***************************************************************** * 終了処理 ***************************************************************** 300-END-SEC SECTION. * PERFORM 900-XML-WRITE-SEC * . 300-END-EXT. EXIT. * ***************************************************************** * 日付編集処理 ***************************************************************** 800-DATE-SEC SECTION. * MOVE SPACE TO WRK-DATE * IF ( WRK-SYMD NOT = SPACE ) INITIALIZE WRK-DATE MOVE WRK-SYY TO WRK-DATE-YY MOVE WRK-SMM TO WRK-DATE-MM MOVE WRK-SDD TO WRK-DATE-DD MOVE "-" TO WRK-DATE-FL1 MOVE "-" TO WRK-DATE-FL2 * EVALUATE WRK-SYMD WHEN "00000000" MOVE 01 TO WRK-DATE-MM MOVE 01 TO WRK-DATE-DD WHEN "99999999" MOVE 12 TO WRK-DATE-MM MOVE 31 TO WRK-DATE-DD END-EVALUATE * END-IF * . 800-DATE-EXT. EXIT. ***************************************************************** * 日付編集処理 ***************************************************************** 800-SYMD-SEC SECTION. * MOVE SPACE TO WRK-SYMD * IF ( WRK-DATE NOT = SPACE ) MOVE WRK-DATE-YY TO WRK-SYY MOVE WRK-DATE-MM TO WRK-SMM MOVE WRK-DATE-DD TO WRK-SDD END-IF * . 800-SYMD-EXT. EXIT. ***************************************************************** * カレンダー処理 ***************************************************************** 800-CALENDAR-SEC SECTION. * INITIALIZE STS-AREA-DAY INITIALIZE LNK-DAY6-AREA MOVE "61" TO LNK-DAY6-IRAI MOVE WRK-YMD TO LNK-DAY6-KIJUN MOVE WRK-ZOGENPTN TO LNK-DAY6-ZOGENPTN MOVE WRK-ZOGEN TO LNK-DAY6-ZOGEN CALL "ORCSDAY" USING STS-AREA-DAY LNK-DAY6-AREA MOVE LNK-DAY6-KEISAN TO WRK-KEISANYMD * . 800-CALENDAR-EXT. EXIT. ***************************************************************** * 日付編集処理 ***************************************************************** 800-HIZUKE-SEC SECTION. * MOVE
COBOL
SPACE TO WRK-EDTYMD1 * IF ( WRK-SYMD = ALL "9" OR ZERO ) MOVE WRK-SYMD (1:8) TO WRK-EDTYMD1 ELSE INITIALIZE STS-AREA-DAY INITIALIZE LNK-DAY2-AREA MOVE "21" TO LNK-DAY2-IRAI MOVE WRK-SYMD TO LNK-DAY2-YMD CALL "ORCSDAY" USING STS-AREA-DAY LNK-DAY2-AREA IF ( STS-DAY-RC1 = ZERO ) MOVE LNK-DAY2-EDTYMD1 TO WRK-EDTYMD1 END-IF END-IF * . 800-HIZUKE-EXT. EXIT. ***************************************************************** * 時刻編集処理 ***************************************************************** 800-TIME-SEC SECTION. * INITIALIZE WRK-TIME MOVE WRK-HMS-HH TO WRK-TIME-HH MOVE WRK-HMS-MM TO WRK-TIME-MM MOVE WRK-HMS-SS TO WRK-TIME-SS MOVE ":" TO WRK-TIME-FL1 MOVE ":" TO WRK-TIME-FL2 * . 800-TIME-EXT. EXIT. ***************************************************************** * エラーメッセージ編集処理 ***************************************************************** 890-ERRCD-MSG-SEC SECTION. * MOVE SPACE TO SPA-ERRMSG * EVALUATE SPA-ERRCD WHEN "0000" MOVE "処理終了" TO SPA-ERRMSG WHEN "0001" MOVE "リクエスト番号の入力に誤りがあります。" TO SPA-ERRMSG WHEN "0002" MOVE "基準日の入力に誤りがあります。" TO SPA-ERRMSG WHEN "0003" MOVE "室料差額情報の入力に誤りがあります。" TO SPA-ERRMSG WHEN "0004" MOVE "室料差額コードが未入力です。" TO SPA-ERRMSG WHEN "0005" MOVE "室料差額コードの入力に誤りがあります。" TO SPA-ERRMSG WHEN "0006" MOVE "室料差額コードに該当する室料差額情報が存在しません。" TO SPA-ERRMSG WHEN "0007" MOVE "同じ室料差額コードの複数入力はできません。" TO SPA-ERRMSG WHEN "0008" MOVE "室料差額が未入力です。" TO SPA-ERRMSG WHEN "0009" MOVE "室料差額の入力に誤りがあります。" TO SPA-ERRMSG WHEN "0010" MOVE "有効期間開始日の入力に誤りがあります。" TO SPA-ERRMSG WHEN "0011" MOVE "有効期間終了日の入力に誤りがあります。" TO SPA-ERRMSG WHEN "0012" MOVE "強制更新の入力に誤りがあります。" TO SPA-ERRMSG WHEN "0013" MOVE "有効期間開始日>有効期間終了日となっています。" TO SPA-ERRMSG WHEN "0014" MOVE "有効期間の重複する室料差額情報が存在します。" TO SPA-ERRMSG WHEN "0015" MOVE "室料差額は30万円以内で入力してください。" TO SPA-ERRMSG WHEN "8900" MOVE "システム項目が設定できません。" TO SPA-ERRMSG MOVE "0089" TO SPA-ERRCD WHEN "8901" MOVE "職員情報が取得できません。" TO SPA-ERRMSG MOVE "0089" TO SPA-ERRCD WHEN "8902" MOVE "医療機関情報が取得できません。" TO SPA-ERRMSG MOVE "0089" TO SPA-ERRCD WHEN "8903" MOVE "システム日付が取得できません。" TO SPA-ERRMSG MOVE "0089" TO SPA-ERRCD WHEN "8905" MOVE "患者番号構成情報が取得できません。" TO SPA-ERRMSG MOVE "0089" TO SPA-ERRCD WHEN "8915" MOVE SPACE TO SPA-ERRMSG STRING "グループ医療機関が不整合です。" DELIMITED BY SIZE "処理を終了して下さい。" DELIMITED BY SIZE INTO SPA-ERRMSG END-STRING MOVE "0089" TO SPA-ERRCD WHEN "0097" MOVE "送信内容に誤りがあります。" TO SPA-ERRMSG WHEN "0098" MOVE "送信内容の読込ができませんでした。" TO SPA-ERRMSG WHEN "0099" MOVE "ユーザIDが未登録です。" TO SPA-ERRMSG END-EVALUATE * . 890-ERRCD-MSG-EXT. EXIT. ***************************************************************** * XML情報から内容を取り出す ***************************************************************** 900-XML-READ-SEC SECTION. * IF ( APILST36-BODY NOT = LOW-VALUE ) DISPLAY "hsconfroomchargev2 object is not low_value" END-IF * INITIALIZE XML-APIREQ * XML情報取り出し MOVE "xml_hsconfroomchargev2req" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME MOVE APILST36-BODY TO APIREQ-OBJECT MOVE ZERO TO APIREQ-MODE PERFORM 910-XMLOPEN-SEC IF ( MCP-RC = ZERO OR 1 ) MOVE "xml_hsconfroomchargev2req" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME MOVE "hsconfroomchargev2req" TO APIREQ-RECORDNAME MOVE "XMLREAD" TO MCP-FUNC PERFORM 910-XMLREAD-SEC IF ( MCP-RC = ZERO OR 1 ) MOVE XML-APIREQ TO XML-HSCONFRCREQ ELSE DISPLAY "XMLREAD failure = " MCP-RC MOVE "0098" TO SPA-ERRCD END-IF ELSE DISPLAY "XMLOPEN failure = " MCP-RC MOVE "0097" TO SPA-ERRCD END-IF * MOVE "xml_hsconfroomchargev2req" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-XMLCLOSE-SEC * . 900-XML-READ-EXT. EXIT. ***************************************************************** * XML情報を書き出す ***************************************************************** 900-XML-WRITE-SEC SECTION. * MOVE SMCNDATE-YMD TO WRK-SYMD PERFORM 800-DATE-SEC MOVE WRK-DATE TO HSCONFRCRES-INFORMATION-DATE * MOVE SMCNDATE-HMS TO WRK-HMS PERFORM 800-TIME-SEC MOVE WRK-TIME TO HSCONFRCRES-INFORMATION-TIME * IF ( SPA-ERRCD = SPACE ) MOVE ZERO TO SPA-ERRCD END-IF PERFORM 890-ERRCD-MSG-SEC MOVE SPA-ERRCD TO HSCONFRCRES-RESULT MOVE SPA-ERRMSG TO HSCONFRCRES-RESULT-MSG * IF ( API-ERRFLG NOT = ZERO ) * MOVE ZERO TO IDXM * PERFORM
COBOL
VARYING IDXL FROM 1 BY 1 UNTIL ( IDXL > API-RMSAGAKU-LAST ) * IF ( API-TERRCD (IDXL) NOT = SPACE ) COMPUTE IDXM = IDXM + 1 MOVE HSCONFRCREQ-TKBNCD (IDXL) TO HSCONFRCRES-TKBNCD (IDXM) MOVE IDXL TO WRK-ERRIDXZ9 MOVE WRK-ERRIDXZ9 TO HSCONFRCRES-TERRIDX (IDXM) MOVE API-TERRCD (IDXL) TO HSCONFRCRES-TERRCD (IDXM) MOVE API-TERRCD (IDXL) TO SPA-ERRCD PERFORM 890-ERRCD-MSG-SEC MOVE SPA-ERRMSG TO HSCONFRCRES-TERRMSG (IDXM) END-IF * END-PERFORM END-IF * MOVE XML-HSCONFRCRES TO XML-APIREQ * MOVE 1 TO APIREQ-MODE * MOVE "xml_hsconfroomchargev2res" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-XMLOPEN-SEC IF ( MCP-RC = ZERO OR 1 ) MOVE "xml_hsconfroomchargev2res" TO MCP-TABLE MOVE "hsconfroomchargev2res" TO APIREQ-RECORDNAME PERFORM 910-XMLWRITE-SEC IF ( MCP-RC = ZERO OR 1 ) CONTINUE ELSE DISPLAY "XMLWRITE failure = " MCP-RC END-IF ELSE DISPLAY "XMLOPEN failure = " MCP-RC END-IF * MOVE "xml_hsconfroomchargev2res" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-XMLCLOSE-SEC IF (MCP-RC = ZERO OR 1 ) MOVE APIREQ-OBJECT TO APILST36-BODY MOVE "application/xml" TO APILST36-CONTENT-TYPE ELSE DISPLAY "XMLCLOSE failure = " MCP-RC DISPLAY "hsconfroomcharge xml write failure " END-IF * . 900-XML-WRITE-EXT. EXIT. ***************************************************************** * システム管理検索処理 ***************************************************************** 900-SYSKANRI-KEY10-SEL-SEC SECTION. * MOVE ZERO TO FLG-SYSKANRI * MOVE SPA-HOSPNUM TO SYS-HOSPNUM MOVE SYSKANRI-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key10" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF ( MCP-RC = ZERO ) MOVE MCPDATA-REC TO SYSKANRI-REC ELSE MOVE 1 TO FLG-SYSKANRI INITIALIZE SYSKANRI-REC END-IF * MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key10" TO MCP-PATHNAME PERFORM 910-DBCLOSECURSOR-SEC * . 900-SYSKANRI-KEY10-SEL-EXT. EXIT. ***************************************************************** * システム管理検索処理 ***************************************************************** 900-SYSKANRI-KEY2-SEL-SEC SECTION. * MOVE ZERO TO FLG-SYSKANRI * MOVE SPA-HOSPNUM TO SYS-HOSPNUM MOVE SYSKANRI-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF ( MCP-RC = ZERO ) MOVE MCPDATA-REC TO SYSKANRI-REC ELSE MOVE 1 TO FLG-SYSKANRI INITIALIZE SYSKANRI-REC END-IF * . 900-SYSKANRI-KEY2-SEL-EXT. EXIT. ***************************************************************** * システム管理FETCH処理 ***************************************************************** 900-SYSKANRI-KEY2-FET-SEC SECTION. * MOVE ZERO TO FLG-SYSKANRI * MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME PERFORM 910-DBFETCH-SEC IF ( MCP-RC = ZERO ) MOVE MCPDATA-REC TO SYSKANRI-REC ELSE MOVE 1 TO FLG-SYSKANRI INITIALIZE SYSKANRI-REC END-IF * . 900-SYSKANRI-KEY2-FET-EXT. EXIT. ***************************************************************** * システム管理検索処理 ***************************************************************** 900-SYSKANRI-KEY26-SEL-SEC SECTION. * MOVE ZERO TO FLG-SYSKANRI * MOVE SPA-HOSPNUM TO SYS-HOSPNUM MOVE SYSKANRI-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key26" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF ( MCP-RC = ZERO ) MOVE MCPDATA-REC TO SYSKANRI-REC ELSE MOVE 1 TO FLG-SYSKANRI INITIALIZE SYSKANRI-REC END-IF * . 900-SYSKANRI-KEY26-SEL-EXT. EXIT. ***************************************************************** * システム管理FETCH処理 ***************************************************************** 900-SYSKANRI-KEY26-FET-SEC SECTION. * MOVE ZERO TO FLG-SYSKANRI * MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key26" TO MCP-PATHNAME PERFORM 910-DBFETCH-SEC IF ( MCP-RC = ZERO ) MOVE MCPDATA-REC TO SYSKANRI-REC ELSE MOVE 1 TO FLG-SYSKANRI INITIALIZE SYSKANRI-REC END-IF * . 900-SYSKANRI-KEY26-FET-EXT. EXIT. ***************************************************************** * DB検索処理 ***************************************************************** 910-DBSELECT-SEC SECTION. * MOVE "DBSELECT" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF ( MCP-RC = ZERO ) PERFORM 910-DBFETCH-SEC END-IF * . * 910-DBSELECT-EXT. EXIT. ***************************************************************** * DB検索処理(FETCHはしない) ***************************************************************** 911-DBSELECT-SEC SECTION. * MOVE "DBSELECT" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . * 911-DBSELECT-EXT. EXIT. ***************************************************************** * DB読み込み処理 ***************************************************************** 910-DBFETCH-SEC SECTION. * MOVE "DBFETCH" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . * 910-DBFETCH-EXT. EXIT. ***************************************************************** * DBクローズ処理 ***************************************************************** 910-DBCLOSECURSOR-SEC SECTION. * MOVE "DBCLOSECURSOR" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * .
COBOL
* 910-DBCLOSECURSOR-EXT. EXIT. ***************************************************************** * DBINSERT処理 ***************************************************************** 910-DBINSERT-SEC SECTION. * MOVE "DBINSERT" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . * 910-DBINSERT-EXT. EXIT. ***************************************************************** * DBUPDATE処理 ***************************************************************** 910-DBUPDATE-SEC SECTION. * MOVE "DBUPDATE" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . * 910-DBUPDATE-EXT. EXIT. ***************************************************************** * DBDELETE処理 ***************************************************************** 910-DBDELETE-SEC SECTION. * MOVE "DBDELETE" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . * 910-DBDELETE-EXT. EXIT. ***************************************************************** * XMLオープン処理 ***************************************************************** 910-XMLOPEN-SEC SECTION. * MOVE "XMLOPEN" TO MCP-FUNC CALL "MONFUNC" USING MCPAREA XML-APIREQ * . * 910-XMLOPEN-EXT. EXIT. ***************************************************************** * XML読込処理 ***************************************************************** 910-XMLREAD-SEC SECTION. * MOVE "XMLREAD" TO MCP-FUNC CALL "MONFUNC" USING MCPAREA XML-APIREQ * . * 910-XMLREAD-EXT. EXIT. ***************************************************************** * XML書込処理 ***************************************************************** 910-XMLWRITE-SEC SECTION. * MOVE "XMLWRITE" TO MCP-FUNC CALL "MONFUNC" USING MCPAREA XML-APIREQ * . * 910-XMLWRITE-EXT. EXIT. ***************************************************************** * XMLクローズ処理 ***************************************************************** 910-XMLCLOSE-SEC SECTION. * MOVE "XMLCLOSE" TO MCP-FUNC CALL "MONFUNC" USING MCPAREA XML-APIREQ * . * 910-XMLCLOSE-EXT. EXIT. * ***************************************************************** * プログラム終了処理(エラー時) ***************************************************************** 990-EXIT-PROGRAM-SEC SECTION. * IF ( SPA-ERRCD = "0099" ) MOVE 404 TO APILST36-HTTPSTATUS ELSE PERFORM 900-XML-WRITE-SEC END-IF * EXIT PROGRAM * . 990-EXIT-PROGRAM-EXT. EXIT. <|end_of_text|> ****************************************************************** * Author:Jossie Esteban Rodriguez * Date:21/01/2021 * Purpose: Curso * Tectonics: cobc ****************************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. ASIGNARMULTIPLESVALORES. DATA DIVISION. FILE SECTION. WORKING-STORAGE SECTION. 01 A PIC 99. 01 B PIC 99. 01 C PIC 99. 01 D PIC 99. 01 E PIC 99. 01 I PIC 99. 01 G PIC 99. 01 H PIC 99. 01 J PIC 99. 01 TEXTO PIC XX VALUE SPACES. 01 Z PIC 99 VALUE ZEROES. PROCEDURE DIVISION. *Asignamos el valor de 10 a las variables que quiera separadas por espacio *Las variables es mejor dejarals iniciadas en cobol *las palabras reservadas SPACE o SPACES inicializan las variables con un espacio *Las palabras ZEOR y ZEROES inicilazan las variables numericas en cero RUTINA1. MOVE 10 TO A B C D E I G H J. * DISPLAY TEXTO. DISPLAY A. DISPLAY B. DISPLAY C. DISPLAY D. DISPLAY E. DISPLAY I. DISPLAY G. DISPLAY H. DISPLAY J. DISPLAY Z. STOP RUN. END PROGRAM ASIGNARMULTIPLESVALORES. <|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. PROG26. * programa usando numeros decimais ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 VALOR1 PIC 9(5)V9(2) VALUE 76543.98. 01 VALOR2 PIC 9(2)V9(2) VALUE 12.36. 01 VALOR3 PIC S999V99 VALUE -587.21. 01 RESULTADO1 PIC 9(5)V9(2). 01 RESULTADO2 PIC S9(5)V9(2). PROCEDURE DIVISION. PROGRAM-BEGIN. COMPUTE RESULTADO1 = VALOR1 + VALOR2. DISPLAY VALOR1 " + " VALOR2 " = " RESULTADO1. DISPLAY "-------------------". COMPUTE RESULTADO2 = VALOR2 + VALOR3. DISPLAY VALOR2 " + (" VALOR3 ") = " RESULTADO2. PROGRAM-DONE. STOP RUN. <|end_of_text|> identification division. program-id. Tag. environment division. configuration section. data division. working-storage section. 01 resposta pic x. *----- Criando = Clientes copy "tagcopy.cpy" replacing leading ==TAG== by ==clientes==. *----- Criando = Fornecedores copy "tagcopy.cpy" replacing leading ==TAG== by ==fornecedores==. procedure division. display erase at 0101 move "JOAO" to clientes-nome fornecedores-nome display "Dados Movidos" at 0201 accept resposta at 2301 goback. end program Tag.<|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. HELLOCOB. PROCEDURE DIVISION. DISPLAY "HELLO WORLD" STOP RUN. <|end_of_text|> $set LINKCOUNT"512" ****************************************************************** * * * ******* ****** ****** **** **** ** * * ** ** ** ** ** ** ** ** ** ** *** * * ** ** ** ** ** ** ** ** ** * ** * * ******* ** ** ****** ** ** ** ** * ** * * ** ** ** ** ** ** ** ** ******* * * ** ** ** ** ** ** ** ** ** ** * * ** ****** ****** **** **** **** * * * * ENGLISH * * * * ( A P A C ) P O S P R O G R A M M I N G K E Y S * * * * P O S - U S I N G P R O G R A M M A B L E K E Y S * * * * VERSION 8.14.03 - May 2010 * * * ****************************************************************** 000010 IDENTIFICATION DIVISION. 000020 PROGRAM-ID. POS004. 000030 AUTHOR. J W LEMMON (APAC). 000040 DATE-WRITTEN. JUNE 1990. COPYRIGHT NOTICE: COPYRIGHT (C) 1990 - 2010 by James William Lemmon. (Id No. 4412165050082). All rights reserved. e-mail [email protected]. 000050 SECURITY. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59
COBOL
Temple Place - Suite 330, Boston, MA 02111-1307, USA. 000050 ENVIRONMENT DIVISION. 000060 CONFIGURATION SECTION. 000070 SPECIAL-NAMES. 000080 CURSOR IS CSTART 000090 CONSOLE IS CRT CRT STATUS IS KEY-STATUS. 000090 INPUT-OUTPUT SECTION. 000100 FILE-CONTROL. COPY APACFIDS.SL. 000140 COPY DEPART.SL. 000120 COPY PARAM.SL. COPY POSPLU.SL. SELECT POSKBD ASSIGN DISK LOCK MANUAL WITH LOCK ON MULTIPLE RECORDS 000180 STATUS WS-STATUS 000190 ACCESS DYNAMIC 000200 ORGANIZATION INDEXED 000210 RECORD POS-KEY ALTERNATE RECORD POS-KEY2 DUPLICATES. 000180 COPY STOCK.SL. / 000320 DATA DIVISION. 000330 FILE SECTION. COPY APACFIDS.FDE. 000370 COPY DEPART.FDE. 000350 COPY PARAM.FDE. COPY POSPLU.FDE. 000010 FD POSKBD LABEL RECORD STANDARD 000020 VALUE OF FILE-ID "POSKBD". 000030 01 POS-RECORD1. 03 POS-KEY. 05 POS-ACT PIC X(01). 05 POS-CODE. 07 POS-HEX PIC X(01) COMP-X. * * SPECIFIES THE PLU-NUMBER * 03 POS-KEY2. 05 POS-NO PIC 9(03). 000390 COPY STOCK.FDE. / 000570 WORKING-STORAGE SECTION. 77 WS-CHECK PIC X(18) VALUE "aeWlimemnomLalismJ". 77 WS-S1 PIC 9(02) COMP-0. 001720 77 WS-S2 PIC 9(04) COMP-5. 001730 77 WS-S3 PIC 9(04) COMP-5. 001740 77 WS-S4 PIC 9(04) COMP-5. 001750 77 WS-S5 PIC 9(04) COMP-5. 001760 77 WS-S6 PIC 9(04) COMP-5. 001770 77 WS-S7 PIC 9(04) COMP-5. 001780 77 WS-S8 PIC 9(04) COMP-5. 001790 77 WS-IXS PIC 9(04) COMP-5. 001800 77 WS-IXS1 PIC 9(04) COMP-5. 001810 77 WS-IXS2 PIC 9(04) COMP-5. 001820 77 WS-IXS3 PIC 9(04) COMP-5. 001830 77 WS-IXS4 PIC 9(04) COMP-5. 77 WS-SM PIC 9(02) COMP-0. 000930 77 WS-OPTION PIC X(01). 001870 77 WS-DEPKEY PIC 9(06) COMP-5. 000700 77 WS-PARKEY PIC 9(04) COMP-5. 77 WS-REPLY PIC X(01). 77 WS-ERROR PIC 9(01). 77 WS-ACT PIC X(01). 77 WS-USE-ITM PIC X(01). 77 WS-EXT-STK PIC X(01). 77 WS-KEY-PRESSED PIC X(18). 77 PRG-NAME PIC X(12) VALUE "STP\STPLOOK". 77 TODAY-DDMMYY PIC 9(08) COMP-5. 77 WS-USUB PIC 9(04) COMP-5. 77 WS-PLU PIC 9(03). 77 WS-PLU-IND PIC 9(01). 77 WS-NODEP PIC X(30) VALUE "NO SUCH D E P A R T M E N T". 002420 01 WS-DB-LINE. 002430 03 WS-TOP-LNE. 002440 05 WS-TCHR PIC X(01) OCCURS 80. 03 WS-T-LINE REDEFINES WS-TOP-LNE. 05 FILLER PIC X(01). 05 WS-H-LINE PIC X(78). 05 FILLER PIC X(01). 002430 03 WS-TOP-LNE2. 002440 05 WS-TCH PIC X(01) OCCURS 80. 03 WS-TP-LINE2 REDEFINES WS-TOP-LNE2. 05 FILLER PIC X(01). 05 WS-TOP-COMP PIC X(40). 001430 05 FILLER PIC X(23). 05 WS-WRKHD PIC X(11). 001430 05 FILLER PIC X(01). 05 WS-WRKST PIC X(03). 001430 05 FILLER PIC X(01). 002450 03 WS-MID-LNE. 002460 05 WS-MCHR PIC X(01) OCCURS 80. 03 WS-MST-LNE REDEFINES WS-MID-LNE. 05 WS-MST1 PIC X(01). 05 WS-MST78 PIC X(78). 05 WS-MST80 PIC X(01). 003020 03 WS-MID-LNE2. 05 FILLER PIC X(01) VALUE "│". 05 WS-BLNK78 PIC X(78) VALUE ALL "░". 05 FILLER PIC X(01) VALUE "│". 003040 03 WS-BOT-LINE. 002480 05 WS-BCHR PIC X(01) OCCURS 80. 003060 03 WS-BOT-LNE2. 002480 05 WS-BCH PIC X(01) OCCURS 80. 003240 03 WS-B-LINE REDEFINES WS-BOT-LNE2. 003250 05 FILLER PIC X(01). 05 WS-MEM-LINE. 003260 07 WS-SRT-LINE 003270 PIC X(50). 07 FILLER PIC X(10). 003280 05 FILLER PIC X(19). 03 WS-MM-LINE. 05 FILLER PIC X(01) VALUE X"B3". 05 FILLER PIC X(60) VALUE SPACES. 05 FILLER PIC X(01) VALUE X"B3". 03 WS-HME-LINE PIC X(60) VALUE ALL X"CD". COPY WS.WS. 01 WS-HELP. 03 WS-MODULE PIC X(03) VALUE "POS". 03 WS-PROG PIC X(03) VALUE "004". COPY FUNCTION.WS. 000290 01 WS-PARID. 000020 03 WS-SYS-ID PIC X(03). 001280 01 W02-FID. COPY APACFIDS.ID. 000370 COPY DEPART.ID. COPY PARAM.ID. 000450 COPY POSPLU.ID. 000390 COPY STOCK.ID. COPY W05.VAT. COPY W10.STK. COPY W12.WS. COPY W11.STK. COPY W40.WS. 003800 COPY W50.WS. COPY W75.STK. 01 W90-MENUS. 03 W90-MENU PIC X(14) OCCURS 10. 004120 01 W95-COMP PIC X(40). 005120 01 W100-EDIT. 003970 03 W100-V2. 003980 05 W100-S6V2 PIC Z(05)9.99-. 03 W100-V3 REDEFINES W100-V2. 05 W100-PRICE PIC X(09). 05 FILLER PIC X(01). 03 W100-V5 REDEFINES W100-V2. 05 W100-QNT PIC Z(05)9.99-. 01 W200-MEMO. 03 W200-MEM-FLDS. 05 W200-MEM1 PIC X(60). 05 W200-MEM2 PIC X(60). 05
COBOL
W200-MEM3 PIC X(60). 05 W200-MEM4 PIC X(60). 05 W200-MEM5 PIC X(60). 05 W200-MEM6 PIC X(60). 05 W200-MEM7 PIC X(60). 05 W200-MEM8 PIC X(60). 05 W200-MEM9 PIC X(60). 05 W200-MEM10 PIC X(60). 05 W200-MEM11 PIC X(60). 05 W200-MEM12 PIC X(60). 03 W200-MEM-FOC REDEFINES W200-MEM-FLDS. 05 W200-MEM PIC X(60) OCCURS 12. LINKAGE SECTION. COPY CHAIN.LS. / 003780 SCREEN SECTION. COPY BLANK.CRT. 01 MENU-INSTRUCT. 03 LINE 25 COLUMN 2 BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 VALUE "Use ". 03 COLUMN 6 HIGHLIGHT BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 VALUE "". 03 COLUMN 7 BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 VALUE " or ". 03 COLUMN 11 HIGHLIGHT BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 VALUE "". 03 COLUMN 12 BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 VALUE " to point to an item, and ". 03 COLUMN 38 HIGHLIGHT BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 VALUE "<Enter>". 03 COLUMN 45 BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 VALUE " to Select ". 03 COLUMN 56 HIGHLIGHT BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 VALUE "<Esc>". 03 COLUMN 61 BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 VALUE " to Exit". 000850 01 S-PROG. 000860 03 LINE 2 COLUMN 33 FOREGROUND-COLOR 7 HIGHLIGHT VALUE "PROGRAMMING KEYS". 01 S-MENU. 03 LINE 4 COLUMN 28 BACKGROUND-COLOR 2 FOREGROUND-COLOR 2 HIGHLIGHT VALUE "┌────────────────────────". 03 COLUMN 53 BACKGROUND-COLOR 2 FOREGROUND-COLOR 0 VALUE "┐". 03 LINE 5 COLUMN 28 BACKGROUND-COLOR 2 FOREGROUND-COLOR 2 HIGHLIGHT VALUE "│ ". 03 COLUMN 31 BACKGROUND-COLOR 2 FOREGROUND-COLOR 7 HIGHLIGHT VALUE "PROGRAMMING OPTIONS". 03 COLUMN 50 BACKGROUND-COLOR 2 FOREGROUND-COLOR 0 VALUE " │". 03 LINE 6 COLUMN 28 BACKGROUND-COLOR 2 FOREGROUND-COLOR 2 HIGHLIGHT VALUE "│ ". 03 COLUMN 30 BACKGROUND-COLOR 2 FOREGROUND-COLOR 7 HIGHLIGHT VALUE "1". 03 COLUMN 31 BACKGROUND-COLOR 2 FOREGROUND-COLOR 0 VALUE " Programme keys │". 03 LINE 7 COLUMN 28 BACKGROUND-COLOR 2 FOREGROUND-COLOR 2 HIGHLIGHT VALUE "│ ". 03 COLUMN 30 BACKGROUND-COLOR 2 FOREGROUND-COLOR 7 HIGHLIGHT VALUE "2". 03 COLUMN 31 BACKGROUND-COLOR 2 FOREGROUND-COLOR 0 VALUE " Test the Keys │". 001470 03 LINE 8 COLUMN 28 BACKGROUND-COLOR 2 FOREGROUND-COLOR 2 HIGHLIGHT VALUE "│ ". 03 COLUMN 30 BACKGROUND-COLOR 2 FOREGROUND-COLOR 7 HIGHLIGHT VALUE "3". 03 COLUMN 31 BACKGROUND-COLOR 2 FOREGROUND-COLOR 0 VALUE " List Keyboard Layout │". 001470 03 LINE 9 COLUMN 28 BACKGROUND-COLOR 2 FOREGROUND-COLOR 2 HIGHLIGHT VALUE "│ ". 03 COLUMN 30 BACKGROUND-COLOR 2 FOREGROUND-COLOR 7 HIGHLIGHT VALUE "4". 03 COLUMN 31 BACKGROUND-COLOR 2 FOREGROUND-COLOR 0 VALUE " View Keyboard Layout │". 001470 03 LINE 10 COLUMN 28 BACKGROUND-COLOR 2 FOREGROUND-COLOR 2 HIGHLIGHT VALUE "│ ". 03 COLUMN 30 BACKGROUND-COLOR 2 FOREGROUND-COLOR 7 HIGHLIGHT VALUE "0". 03 COLUMN 31 BACKGROUND-COLOR 2 FOREGROUND-COLOR 0 VALUE " Exit │". 03 LINE 11 COLUMN 28 BACKGROUND-COLOR 2 FOREGROUND-COLOR 2 HIGHLIGHT VALUE "└". 03 COLUMN 29 BACKGROUND-COLOR 2 FOREGROUND-COLOR 0 VALUE "────────────────────────┘". COPY S99.CRT. COPY ERROR.CRT. COPY OPT.CRT. 001230 PROCEDURE DIVISION USING LS-PARID LS-USER-ID LS0-PROGRAMS LS0-SECURITY. 004790 AA000 SECTION. 006580 AA00. 003240 IF LS0-PALEV < 3 AND LS0-SALEV < 9 MOVE "Not Authorised" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO AY005. 006590 PERFORM ZA00-INIT. IF WS-ERROR = 9 PERFORM FA000. 006620 AA01. IF MOUSE-ATTACHED = "Y" MOVE 66 TO MOUSE-FUNC MOVE 1 TO MOUSE-PARAM CALL X"AF" USING MOUSE-FUNC MOUSE-PARAM. 006630 DISPLAY CLR-SCREEN. DISPLAY S-PROG. MOVE 5 TO SHADE-ROW. MOVE 30 TO SHADE-COL. MOVE 24 TO SHADE-WIDTH. MOVE 7 TO SHADE-LINES. DISPLAY S-MENU. DISPLAY MENU-INSTRUCT. PERFORM SCREEN-SHADOW. AA02. MOVE 5 TO TOP-ROW. MOVE 9 TO BOTTOM-ROW. MOVE 4 TO SCREEN-LIN. MOVE 30 TO SCREEN-COL. MOVE 22 TO STRING-LENGTH. PERFORM SAVE-ATTR. AA05. CALL X"AF" USING GET-SINGLE-CHAR, KEY-STATUS. 006660 AA10. IF ADIS-FUNC EVALUATE KEY-CODE-1 WHEN UP-KEY PERFORM MOVE-BLOCK-UP WHEN DOWN-KEY PERFORM MOVE-BLOCK-DOWN WHEN MOUSE-KEY PERFORM POSITION-MOUSE IF MOUSE-ENTER = "Y" MOVE "N" TO MOUSE-ENTER GO TO AA15 END-IF IF MOUSE-Y = 24 IF MOUSE-X = 5 MOVE 5 TO KEY-CODE-1 GO TO AA10 ELSE IF MOUSE-X = 10 MOVE 6 TO KEY-CODE-1 GO TO AA10 ELSE IF MOUSE-X > 36 AND < 44 MOVE 0 TO KEY-CODE-1 GO TO AA10 ELSE IF MOUSE-X > 54 AND < 60 MOVE 0 TO KEY-CODE-1 MOVE 1 TO KEY-TYPE GO TO AA10 END-IF END-IF WHEN ENTER-KEY GO TO AA15 WHEN OTHER CALL X"E5" END-EVALUATE GO TO AA05 ELSE IF USER-FUNC EVALUATE KEY-CODE-1 WHEN ESC-KEY MOVE "0" TO WS-OPTION GO TO AA18 WHEN OTHER CALL X"E5" END-EVALUATE GO TO AA05 ELSE IF DATA-8BIT MOVE KEY-CODE-1X TO WS-OPTION CALL "CBL_TOUPPER" USING WS-OPTION BY VALUE WS-LENGTH RETURNING WS-STATUS IF (WS-OPTION < "0" OR > "4") AND (WS-OPTION NOT = "?") CALL X"E5" GO TO AA05 END-IF GO TO AA16 ELSE
COBOL
CALL X"E5" GO TO AA05. AA15. IF SCREEN-LIN < 5 CALL X"E5" GO TO AA05 ELSE IF SCREEN-LIN = 5 MOVE "1" TO WS-OPTION ELSE IF SCREEN-LIN = 6 MOVE "2" TO WS-OPTION ELSE IF SCREEN-LIN = 7 MOVE "3" TO WS-OPTION ELSE IF SCREEN-LIN = 8 MOVE "4" TO WS-OPTION ELSE IF SCREEN-LIN = 9 MOVE "0" TO WS-OPTION. GO TO AA18. AA16. PERFORM CLEAR-BLOCK. IF WS-OPTION = "0" OR "?" MOVE 9 TO SCREEN-LIN ELSE IF WS-OPTION = "1" MOVE 5 TO SCREEN-LIN ELSE IF WS-OPTION = "2" MOVE 6 TO SCREEN-LIN ELSE IF WS-OPTION = "3" MOVE 7 TO SCREEN-LIN ELSE IF WS-OPTION = "4" MOVE 8 TO SCREEN-LIN. PERFORM SAVE-ATTR. PERFORM MARK-BLOCK. AA18. IF MOUSE-ATTACHED = "Y" MOVE 66 TO MOUSE-FUNC MOVE 0 TO MOUSE-PARAM CALL X"AF" USING MOUSE-FUNC MOUSE-PARAM. 006730 IF WS-OPTION = "0" 006740 GO TO AY000-EOJ. 006750 IF WS-OPTION = "1" 006760 PERFORM BA000 006770 ELSE 006780 IF WS-OPTION = "2" 006790 PERFORM BB000 006800 ELSE 006810 IF WS-OPTION = "3" 006820 PERFORM DA000 006830 ELSE 006840 IF WS-OPTION = "4" 006850 PERFORM EA000 ELSE IF WS-OPTION = "?" PERFORM FA000. 007060 GO TO AA01. COPY AA50.LUP. * * **** D I S P L A Y L O O K U P O P T I O N S * 011010 AA300 SECTION. 011020 AA301. 011010 DISPLAY "F1" AT 2502 WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 14 "=Help," WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 "F2" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 14 011020 "=Item/" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 011030 "F3" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 14 011040 "=Alt/" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 011050 "F4" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 14 011060 "=Desc/" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 011050 "F5" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 14 011060 "=Desc2/" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 011070 "F6" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 14 011080 "=X/Ref Find," WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 011030 "F8" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 14 "=Prompt," WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 011070 "Esc" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 14 "ape" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1. 011110 AA305. 011120 EXIT. * * **** D I S P L A Y D E P A R T M E N T N A M E * AA400 SECTION. AA401. MOVE SPACES TO W10-DEPT. IF W10-LEDG > 0 AND < 297 MOVE W10-LEDG TO WS-DEPKEY PERFORM READ-DEPART THRU READ-DEPART-EXIT MOVE DPT-DESC TO W10-DEPT. IF W10-DEPT = SPACES MOVE WS-NODEP TO W10-DEPT. DISPLAY W10-DEPT AT 0322 WITH FOREGROUND-COLOR 6 HIGHLIGHT BACKGROUND-COLOR 5. AA405. EXIT. / 008260 AY000-END SECTION. 008270 AY000-EOJ. 008280 CLOSE POSPLU POSKBD. AY005. EXIT PROGRAM. COPY CA000.STK. COPY CA100.STK. COPY CA200.STK. COPY CA500.STK. COPY LOCKED.REC. COPY FUNCTION.CRT. COPY OPTION.CRT. COPY CLEAR.CRT. COPY ABORT.PRN. COPY APAC.HLP. / 007310 AN00-READ SECTION. COPY DEPART.RD. COPY PARAM.RD. COPY POSKBD.RD. COPY POSPLU.RD. COPY STOCK.RD. / 007770 AO00-WRITE SECTION. COPY PARAM.WR. COPY POSKBD.WR. COPY POSPLU.WR. BA000 SECTION 50. BA0. MOVE ZERO TO PLU-SUB0 PLU-SUB1 PLU-SUB2 PLU-SUB3 PLU-SUB4 PLU-SUB5 PLU-SUB6 PLU-SUB7 PLU-SUB8 PLU-SUB9. MOVE SPACES TO PLU-TYPE PLU-VALUE. MOVE 0 TO WS-SM. BA00. DISPLAY CLR-SCREEN. DISPLAY "PROGRAMME P.O.S. KEYS" AT 0230 WITH FOREGROUND-COLOR 7 HIGHLIGHT. BA00A. IF WS-SM = 0 GO TO BA00B ELSE MOVE 1 TO WS-S1. MOVE 0411 TO CPOS. BA00AB. IF WS-S1 = WS-SM DISPLAY W90-MENU (WS-S1) AT CPOS WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 ELSE DISPLAY W90-MENU (WS-S1) AT CPOS WITH BACKGROUND-COLOR 5. IF WS-S1 < WS-SM ADD 1 TO WS-S1 IF CCOL < 60 ADD 15 TO CCOL ELSE ADD 1 TO CLIN MOVE 11 TO CCOL END-IF GO TO BA00AB. BA00B. DISPLAY "Press the required key" AT 1012 WITH FOREGROUND-COLOR 6 HIGHLIGHT. DISPLAY "Press " AT 1212 "Esc" WITH FOREGROUND-COLOR 6 HIGHLIGHT "ape key to exit," "Home" WITH FOREGROUND-COLOR 6 HIGHLIGHT " to start at first screen". DISPLAY "Key to programme:" AT 0812. CALL X"AF" USING GET-SINGLE-CHAR, KEY-STATUS. IF USER-FUNC EVALUATE KEY-CODE-1 WHEN ESC-KEY GO TO BA100 WHEN F1-KEY WHEN F2-KEY WHEN F3-KEY WHEN F4-KEY WHEN F5-KEY WHEN F6-KEY WHEN F7-KEY WHEN F8-KEY WHEN F9-KEY WHEN F10-KEY WHEN F11-KEY WHEN F12-KEY WHEN SF1-KEY WHEN SF2-KEY WHEN SF3-KEY WHEN SF4-KEY WHEN SF5-KEY WHEN SF6-KEY WHEN SF7-KEY WHEN SF8-KEY WHEN SF9-KEY WHEN SF10-KEY WHEN SF11-KEY WHEN SF12-KEY WHEN CF1-KEY WHEN CF2-KEY WHEN CF3-KEY WHEN CF4-KEY WHEN CF5-KEY WHEN CF6-KEY WHEN CF7-KEY WHEN CF8-KEY WHEN CF9-KEY WHEN CF10-KEY WHEN CF11-KEY WHEN CF12-KEY WHEN AF1-KEY WHEN AF2-KEY WHEN AF3-KEY WHEN AF4-KEY WHEN AF5-KEY WHEN AF6-KEY WHEN AF7-KEY WHEN AF8-KEY WHEN AF9-KEY WHEN AF10-KEY WHEN AF11-KEY WHEN AF12-KEY
COBOL
WHEN ALT-1 WHEN ALT-2 WHEN ALT-3 WHEN ALT-4 WHEN ALT-5 WHEN ALT-6 WHEN ALT-7 WHEN ALT-8 WHEN ALT-9 WHEN ALT-0 WHEN ALT-HYPH WHEN ALT-EQUAL WHEN ALT-A WHEN ALT-B WHEN ALT-C WHEN ALT-D WHEN ALT-E WHEN ALT-F WHEN ALT-G WHEN ALT-H WHEN ALT-I WHEN ALT-J WHEN ALT-K WHEN ALT-L WHEN ALT-M WHEN ALT-N WHEN ALT-O WHEN ALT-P WHEN ALT-Q WHEN ALT-R WHEN ALT-S WHEN ALT-T WHEN ALT-U WHEN ALT-V WHEN ALT-W WHEN ALT-X WHEN ALT-Y WHEN ALT-Z GO TO BA05 WHEN OTHER GO TO BA20 END-EVALUATE ELSE IF ADIS-FUNC EVALUATE KEY-CODE-1 WHEN HOME-KEY GO TO BA0 WHEN LEFT-KEY WHEN RIGHT-KEY WHEN UP-KEY WHEN DOWN-KEY WHEN HOME-KEY WHEN END-KEY WHEN BACK-SPACE WHEN DEL-KEY WHEN INS-KEY GO TO BA05 WHEN OTHER GO TO BA20 END-EVALUATE ELSE IF DATA-8BIT CALL "CBL_TOUPPER" USING KEY-CODE-1X BY VALUE WS-LENGTH RETURNING WS-STATUS ELSE GO TO BA20. BA05. MOVE KEY-TYPE TO POS-ACT. MOVE KEY-CODE-1X TO POS-CODE. PERFORM READ-POSKBD THRU READ-POSKBD-EXIT. IF WS-F-ERROR = 48 MOVE "PLU/PK has not been Setup" TO WS-ERR-STRING 025040 PERFORM ERROR-MESSAGE GO TO BA00. DISPLAY "PLU/PK " AT 1412 WITH HIGHLIGHT POS-NO WITH FOREGROUND-COLOR 6 HIGHLIGHT. MOVE KEY-TYPE TO PLU-ACT. MOVE KEY-CODE-1X TO PLU-CODE. MOVE SPACES TO PLU-TYPE PLU-VALUE. PERFORM READ-POSPLU-LOCK THRU READ-POSPLU-EXIT. IF WS-F-ERROR = 49 MOVE 1 TO WS-PLU-IND ELSE MOVE ZERO TO WS-PLU-IND. MOVE POS-NO TO PLU-NO. DISPLAY "Action:" AT 1612. DISPLAY "I" AT 1622 WITH FOREGROUND-COLOR 6 HIGHLIGHT "tem code," "F" WITH FOREGROUND-COLOR 6 HIGHLIGHT "unction, " "M" WITH FOREGROUND-COLOR 6 HIGHLIGHT "enu or " "P" WITH FOREGROUND-COLOR 6 HIGHLIGHT "ayment method". DISPLAY "Description/Value:" AT 1812. MOVE PLU-TYPE TO WS-ACT. MOVE PLU-VALUE TO WS-KEY-PRESSED. BA10. ACCEPT WS-ACT AT 1620 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 UPDATE AUTO. IF USER-FUNC EVALUATE KEY-CODE-1 WHEN ESC-KEY GO TO BA00 END-EVALUATE. CALL "CBL_TOUPPER" USING WS-ACT BY VALUE WS-LENGTH RETURNING WS-STATUS. IF NOT (WS-ACT = "F" OR "I" OR "M" OR "P") GO TO BA10. DISPLAY WS-ACT AT 1620 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5. IF WS-ACT = "F" MOVE 7 TO SHADE-ROW MOVE 69 TO SHADE-COL MOVE 8 TO SHADE-WIDTH MOVE 16 TO SHADE-LINES DISPLAY "┌────────" AT 0667 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "┐" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 0767 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "CANCEL │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 0867 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "CASHUP │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 0967 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "HOLD │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1067 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "LOOKUP │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1167 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "PLU │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1267 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "PRICE │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1367 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "PRINT │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1467 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "QUANTITY│" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1567 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "REFUND │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1667 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "SCAN/KEY│" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1767 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "TOTAL │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1867 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "VOID │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1967 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "LOGON │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 2067 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "LOGOFF │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 2167 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "STAFF │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "└" AT 2267 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "────────┘" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 PERFORM SCREEN-SHADOW. IF WS-ACT = "P" MOVE 8 TO SHADE-ROW MOVE 65 TO SHADE-COL MOVE 12 TO SHADE-WIDTH MOVE 10 TO SHADE-LINES DISPLAY "┌" AT 0763 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "────────────┐" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 0863 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "CASH │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 0963 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "CHEQUE │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1063 WITH FOREGROUND-COLOR 7 HIGHLIGHT
COBOL
BACKGROUND-COLOR 7 "CREDIT CARD │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1163 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "SPEEDPOINT │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1263 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "GIFT VOUCHER│" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1363 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "COUPON │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1463 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "TRAV. CHEQUE│" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1563 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "BUY AID │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1663 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "ACCOUNT │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "└" AT 1763 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "────────────┘" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 PERFORM SCREEN-SHADOW. BA15. IF WS-ACT = "I" PERFORM AA300. ACCEPT WS-KEY-PRESSED AT 1831 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 UPDATE AUTO. IF USER-FUNC EVALUATE KEY-CODE-1 WHEN ESC-KEY GO TO BA10 END-EVALUATE. IF WS-ACT = "I" IF USER-FUNC EVALUATE KEY-CODE-1 WHEN F1-KEY PERFORM HELP-ROUTINE GO TO BA15 WHEN F2-KEY MOVE "I" TO W10-ETYPE WHEN F3-KEY MOVE "A" TO W10-ETYPE WHEN F4-KEY MOVE "D" TO W10-ETYPE WHEN F5-KEY MOVE "2" TO W10-ETYPE WHEN F6-KEY MOVE "X" TO W10-ETYPE WHEN OTHER CALL X"E5" GO TO BA15 END-EVALUATE PERFORM AA50-LOOKUP MOVE W10-EXT-ITEM TO WS-KEY-PRESSED. IF WS-KEY-PRESSED = SPACES GO TO BA15. MOVE 18 TO WS-LENGTH. CALL "CBL_TOUPPER" USING WS-KEY-PRESSED BY VALUE WS-LENGTH RETURNING WS-STATUS. MOVE 1 TO WS-LENGTH. DISPLAY WS-KEY-PRESSED AT 1831 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5. IF WS-ACT = "F" IF NOT (WS-KEY-PRESSED = "VOID" OR "HOLD" OR "CANCEL" OR "REFUND" OR "TOTAL" OR "CASHUP" OR "LOOKUP" OR "SUB TOTAL" OR "SCAN/KEY" OR "X" OR "LOGON" OR "QUANTITY" OR "PLU" OR "PRICE" OR "LOGOFF" OR "PRINT" OR "STAFF") MOVE "Function Description" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO BA15. IF WS-ACT = "P" IF NOT (WS-KEY-PRESSED = "CASH" OR "CHEQUE" OR "CREDIT CARD" OR "SPEEDPOINT" OR "GIFT VOUCHER" OR "VOUCHER" OR "COUPON" OR "TRAV. CHEQUE" OR "BUY AID" OR "ACCOUNT") MOVE "Payment Type" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO BA15. MOVE 19 TO SLIN. PERFORM CHECK-SETUP THRU CHECK-EXIT. 020250 IF WS-OPTION = "N" GO TO BA10. MOVE WS-ACT TO PLU-TYPE. MOVE WS-KEY-PRESSED TO PLU-VALUE. IF WS-PLU-IND = 1 PERFORM WRITE-POSPLU THRU WRITE-POSPLU-EXIT ELSE PERFORM REWRITE-POSPLU THRU WRITE-POSPLU-EXIT. IF WS-ACT = "M" ADD 1 TO WS-SM MOVE PLU-HEX TO PLU-MENU-LEVEL (WS-SM) MOVE WS-KEY-PRESSED TO W90-MENU (WS-SM). GO TO BA00. BA20. MOVE "Not a programmable key" TO WS-ERR-STRING. 003260 PERFORM ERROR-MESSAGE. GO TO BA00. BA100. IF WS-SM = ZERO GO TO BA999. MOVE SPACES TO W90-MENU (WS-SM). MOVE ZERO TO PLU-MENU-LEVEL (WS-SM). SUBTRACT 1 FROM WS-SM. GO TO BA00. BA999. EXIT. BB000 SECTION 51. BB0. MOVE ZERO TO PLU-SUB0 PLU-SUB1 PLU-SUB2 PLU-SUB3 PLU-SUB4 PLU-SUB5 PLU-SUB6 PLU-SUB7 PLU-SUB8 PLU-SUB9. MOVE SPACES TO PLU-TYPE PLU-VALUE. MOVE 0 TO WS-SM. BB00. DISPLAY CLR-SCREEN. DISPLAY "TEST PROGRAMMED P.O.S. KEYS" AT 0227 WITH FOREGROUND-COLOR 7 HIGHLIGHT. BB00A. IF WS-SM = 0 GO TO BB00B ELSE MOVE 1 TO WS-S1. MOVE 0411 TO CPOS. BB00AB. IF WS-S1 = WS-SM DISPLAY W90-MENU (WS-S1) AT CPOS WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 ELSE DISPLAY W90-MENU (WS-S1) AT CPOS WITH BACKGROUND-COLOR 5. IF WS-S1 < WS-SM ADD 1 TO WS-S1 IF CCOL < 60 ADD 15 TO CCOL ELSE ADD 1 TO CLIN MOVE 11 TO CCOL END-IF GO TO BB00AB. BB00B. DISPLAY "Press the required key" AT 1012 WITH FOREGROUND-COLOR 6 HIGHLIGHT. DISPLAY "Press " AT 1212 "Esc" WITH FOREGROUND-COLOR 6 HIGHLIGHT "ape key to exit," "Home" WITH FOREGROUND-COLOR 6 HIGHLIGHT " to start at first screen". DISPLAY "Key to test: " AT 0812. CALL X"AF" USING GET-SINGLE-CHAR, KEY-STATUS. IF USER-FUNC EVALUATE KEY-CODE-1 WHEN ESC-KEY GO TO BB100 WHEN F1-KEY WHEN F2-KEY WHEN F3-KEY WHEN F4-KEY WHEN F5-KEY WHEN F6-KEY WHEN F7-KEY WHEN F8-KEY WHEN F9-KEY WHEN F10-KEY WHEN F11-KEY WHEN F12-KEY WHEN SF1-KEY WHEN SF2-KEY WHEN SF3-KEY WHEN SF4-KEY WHEN SF5-KEY WHEN SF6-KEY WHEN SF7-KEY WHEN SF8-KEY WHEN SF9-KEY WHEN SF10-KEY WHEN SF11-KEY WHEN SF12-KEY WHEN CF1-KEY WHEN CF2-KEY WHEN CF3-KEY WHEN CF4-KEY WHEN CF5-KEY WHEN CF6-KEY WHEN CF7-KEY WHEN CF8-KEY WHEN CF9-KEY WHEN CF10-KEY WHEN CF11-KEY WHEN CF12-KEY WHEN AF1-KEY WHEN AF2-KEY WHEN AF3-KEY
COBOL
WHEN AF4-KEY WHEN AF5-KEY WHEN AF6-KEY WHEN AF7-KEY WHEN AF8-KEY WHEN AF9-KEY WHEN AF10-KEY WHEN AF11-KEY WHEN AF12-KEY WHEN ALT-1 WHEN ALT-2 WHEN ALT-3 WHEN ALT-4 WHEN ALT-5 WHEN ALT-6 WHEN ALT-7 WHEN ALT-8 WHEN ALT-9 WHEN ALT-0 WHEN ALT-HYPH WHEN ALT-EQUAL WHEN ALT-A WHEN ALT-B WHEN ALT-C WHEN ALT-D WHEN ALT-E WHEN ALT-F WHEN ALT-G WHEN ALT-H WHEN ALT-I WHEN ALT-J WHEN ALT-K WHEN ALT-L WHEN ALT-M WHEN ALT-N WHEN ALT-O WHEN ALT-P WHEN ALT-Q WHEN ALT-R WHEN ALT-S WHEN ALT-T WHEN ALT-U WHEN ALT-V WHEN ALT-W WHEN ALT-X WHEN ALT-Y WHEN ALT-Z GO TO BB05 WHEN OTHER GO TO BB20 END-EVALUATE ELSE IF ADIS-FUNC EVALUATE KEY-CODE-1 WHEN HOME-KEY GO TO BB0 WHEN LEFT-KEY WHEN RIGHT-KEY WHEN UP-KEY WHEN DOWN-KEY WHEN HOME-KEY WHEN END-KEY WHEN BACK-SPACE WHEN DEL-KEY WHEN INS-KEY GO TO BB05 WHEN OTHER GO TO BB20 END-EVALUATE ELSE IF DATA-8BIT CALL "CBL_TOUPPER" USING KEY-CODE-1X BY VALUE WS-LENGTH RETURNING WS-STATUS ELSE GO TO BB20. BB05. MOVE KEY-TYPE TO POS-ACT. MOVE KEY-CODE-1X TO POS-CODE. PERFORM READ-POSKBD THRU READ-POSKBD-EXIT. IF WS-F-ERROR = 48 MOVE "PLU/PK has not been Setup" TO WS-ERR-STRING 025040 PERFORM ERROR-MESSAGE GO TO BB00. DISPLAY "PLU/PK " AT 1412 WITH HIGHLIGHT POS-NO WITH FOREGROUND-COLOR 6 HIGHLIGHT. MOVE KEY-TYPE TO PLU-ACT. MOVE KEY-CODE-1X TO PLU-CODE. MOVE SPACES TO PLU-TYPE PLU-VALUE. PERFORM READ-POSPLU-LOCK THRU READ-POSPLU-EXIT. IF WS-F-ERROR = 49 MOVE 1 TO WS-PLU-IND ELSE MOVE ZERO TO WS-PLU-IND. MOVE POS-NO TO PLU-NO. DISPLAY "Action:" AT 1612. DISPLAY "I" AT 1622 WITH FOREGROUND-COLOR 6 HIGHLIGHT "tem code," "F" WITH FOREGROUND-COLOR 6 HIGHLIGHT "unction or " "M" WITH FOREGROUND-COLOR 6 HIGHLIGHT "enu". DISPLAY "Description/Value:" AT 1812. MOVE PLU-TYPE TO WS-ACT. MOVE PLU-VALUE TO WS-KEY-PRESSED. BB10. DISPLAY WS-ACT AT 1620 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 UPDATE AUTO. IF WS-ACT = "F" MOVE 8 TO SHADE-ROW MOVE 69 TO SHADE-COL MOVE 8 TO SHADE-WIDTH MOVE 15 TO SHADE-LINES DISPLAY "┌────────" AT 0667 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "┐" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 0767 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "CANCEL │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 0867 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "CASHUP │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 0967 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "HOLD │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1067 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "LOOKUP │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1167 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "PLU │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1267 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "PRICE │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1367 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "PRINT │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1467 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "QUANTITY│" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1567 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "REFUND │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1667 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "SCAN/KEY│" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1767 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "TOTAL │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1867 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "VOID │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 1967 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "LOGON │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 2067 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "LOGOFF │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "│" AT 2167 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "STAFF │" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 DISPLAY "└" AT 2267 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 7 "────────┘" WITH FOREGROUND-COLOR 0 BACKGROUND-COLOR 7 PERFORM SCREEN-SHADOW. BB15. DISPLAY WS-KEY-PRESSED AT 1831 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 UPDATE AUTO. MOVE WS-ACT TO PLU-TYPE. MOVE WS-KEY-PRESSED TO PLU-VALUE. MOVE 19 TO SLIN. MOVE "Press ANY key to continue" TO WS-ERR-MES. PERFORM OPT-SETUP THRU OPT-EXIT. IF WS-ACT = "M" ADD 1 TO WS-SM MOVE PLU-HEX TO PLU-MENU-LEVEL (WS-SM) MOVE WS-KEY-PRESSED TO W90-MENU (WS-SM). GO TO BB00. BB20. MOVE "Not a programmable key" TO WS-ERR-STRING. 003260 PERFORM ERROR-MESSAGE. GO TO BB00. BB100. IF WS-SM = ZERO GO TO BB999. MOVE SPACES TO W90-MENU (WS-SM). MOVE ZERO TO PLU-MENU-LEVEL (WS-SM). SUBTRACT 1 FROM WS-SM. GO TO BB00. BB999. EXIT. DA000 SECTION 52. DA00. DISPLAY CLR-SCREEN. DISPLAY "LIST PROGRAMMED KEYS" AT 0231
COBOL
WITH FOREGROUND-COLOR 7 HIGHLIGHT. MOVE 1 TO WS-PLU. DA05. MOVE SPACE TO POS-ACT. MOVE ZERO TO POS-HEX POS-NO. DA999. EXIT. EA000 SECTION 53. EA00. DISPLAY CLR-SCREEN. DISPLAY "VIEW PROGRAMMED P.O.S. KEYS" AT 0230 WITH FOREGROUND-COLOR 7 HIGHLIGHT. MOVE 1 TO WS-PLU. EA05. MOVE SPACE TO POS-ACT. MOVE ZERO TO POS-HEX POS-NO. EA999. EXIT. FA000 SECTION 54. FA00. DISPLAY CLR-SCREEN. DISPLAY "SETUP THE K.B. LAYOUT" AT 0230 WITH FOREGROUND-COLOR 7 HIGHLIGHT. MOVE 1 TO WS-PLU. FA05. MOVE SPACE TO POS-ACT. MOVE ZERO TO POS-HEX POS-NO. FA10. DISPLAY "Press the key that will represent: " AT 0406 "PLU/PK " WITH HIGHLIGHT WS-PLU WITH FOREGROUND-COLOR 6 HIGHLIGHT " Press " "Esc" WITH FOREGROUND-COLOR 6 HIGHLIGHT "ape to END". CALL X"AF" USING GET-SINGLE-CHAR, KEY-STATUS. IF USER-FUNC EVALUATE KEY-CODE-1 WHEN ESC-KEY GO TO FA25 WHEN F1-KEY MOVE "F1" TO WS-KEY-PRESSED WHEN F2-KEY MOVE "F2" TO WS-KEY-PRESSED WHEN F3-KEY MOVE "F3" TO WS-KEY-PRESSED WHEN F4-KEY MOVE "F4" TO WS-KEY-PRESSED WHEN F5-KEY MOVE "F5" TO WS-KEY-PRESSED WHEN F6-KEY MOVE "F6" TO WS-KEY-PRESSED WHEN F7-KEY MOVE "F7" TO WS-KEY-PRESSED WHEN F8-KEY MOVE "F8" TO WS-KEY-PRESSED WHEN F9-KEY MOVE "F9" TO WS-KEY-PRESSED WHEN F10-KEY MOVE "F10" TO WS-KEY-PRESSED WHEN F11-KEY MOVE "F11" TO WS-KEY-PRESSED WHEN F12-KEY MOVE "F12" TO WS-KEY-PRESSED WHEN SF1-KEY MOVE "Shft+F1" TO WS-KEY-PRESSED WHEN SF2-KEY MOVE "Shft+F2" TO WS-KEY-PRESSED WHEN SF3-KEY MOVE "Shft+F3" TO WS-KEY-PRESSED WHEN SF4-KEY MOVE "Shft+F4" TO WS-KEY-PRESSED WHEN SF5-KEY MOVE "Shft+F5" TO WS-KEY-PRESSED WHEN SF6-KEY MOVE "Shft+F6" TO WS-KEY-PRESSED WHEN SF7-KEY MOVE "Shft+F7" TO WS-KEY-PRESSED WHEN SF8-KEY MOVE "Shft+F8" TO WS-KEY-PRESSED WHEN SF9-KEY MOVE "Shft+F9" TO WS-KEY-PRESSED WHEN SF10-KEY MOVE "Shft+F10" TO WS-KEY-PRESSED WHEN SF11-KEY MOVE "Shft+F11" TO WS-KEY-PRESSED WHEN SF12-KEY MOVE "Shft+F12" TO WS-KEY-PRESSED WHEN CF1-KEY MOVE "Ctrl+F1" TO WS-KEY-PRESSED WHEN CF2-KEY MOVE "Ctrl+F2" TO WS-KEY-PRESSED WHEN CF3-KEY MOVE "Ctrl+F3" TO WS-KEY-PRESSED WHEN CF4-KEY MOVE "Ctrl+F4" TO WS-KEY-PRESSED WHEN CF5-KEY MOVE "Ctrl+F5" TO WS-KEY-PRESSED WHEN CF6-KEY MOVE "Ctrl+F6" TO WS-KEY-PRESSED WHEN CF7-KEY MOVE "Ctrl+F7" TO WS-KEY-PRESSED WHEN CF8-KEY MOVE "Ctrl+F8" TO WS-KEY-PRESSED WHEN CF9-KEY MOVE "Ctrl+F9" TO WS-KEY-PRESSED WHEN CF10-KEY MOVE "Ctrl+F10" TO WS-KEY-PRESSED WHEN CF11-KEY MOVE "Ctrl+F11" TO WS-KEY-PRESSED WHEN CF12-KEY MOVE "Ctrl+F12" TO WS-KEY-PRESSED WHEN AF1-KEY MOVE "Alt+F1" TO WS-KEY-PRESSED WHEN AF2-KEY MOVE "Alt+F2" TO WS-KEY-PRESSED WHEN AF3-KEY MOVE "Alt+F3" TO WS-KEY-PRESSED WHEN AF4-KEY MOVE "Alt+F4" TO WS-KEY-PRESSED WHEN AF5-KEY MOVE "Alt+F5" TO WS-KEY-PRESSED WHEN AF6-KEY MOVE "Alt+F6" TO WS-KEY-PRESSED WHEN AF7-KEY MOVE "Alt+F7" TO WS-KEY-PRESSED WHEN AF8-KEY MOVE "Alt+F8" TO WS-KEY-PRESSED WHEN AF9-KEY MOVE "Alt+F9" TO WS-KEY-PRESSED WHEN AF10-KEY MOVE "Alt+F10" TO WS-KEY-PRESSED WHEN AF11-KEY MOVE "Alt+F11" TO WS-KEY-PRESSED WHEN AF12-KEY MOVE "Alt+F12" TO WS-KEY-PRESSED WHEN ALT-1 MOVE "Alt+1" TO WS-KEY-PRESSED WHEN ALT-2 MOVE "Alt+2" TO WS-KEY-PRESSED WHEN ALT-3 MOVE "Alt+3" TO WS-KEY-PRESSED WHEN ALT-4 MOVE "Alt+4" TO WS-KEY-PRESSED WHEN ALT-5 MOVE "Alt+5" TO WS-KEY-PRESSED WHEN ALT-6 MOVE "Alt+6" TO WS-KEY-PRESSED WHEN ALT-7 MOVE "Alt+7" TO WS-KEY-PRESSED WHEN ALT-8 MOVE "Alt+8" TO WS-KEY-PRESSED WHEN ALT-9 MOVE "Alt+9" TO WS-KEY-PRESSED WHEN ALT-0 MOVE "Alt+0" TO WS-KEY-PRESSED WHEN ALT-HYPH MOVE "Alt+HYPH" TO WS-KEY-PRESSED WHEN ALT-EQUAL MOVE "Alt+EQUAL" TO WS-KEY-PRESSED WHEN ALT-A MOVE "Alt+A" TO WS-KEY-PRESSED WHEN ALT-B MOVE "Alt+B" TO WS-KEY-PRESSED WHEN ALT-C MOVE "Alt+C" TO WS-KEY-PRESSED WHEN ALT-D MOVE "Alt+D" TO WS-KEY-PRESSED WHEN ALT-E MOVE "Alt+E" TO WS-KEY-PRESSED WHEN ALT-F MOVE "Alt+F" TO WS-KEY-PRESSED WHEN ALT-G MOVE "Alt+G" TO WS-KEY-PRESSED WHEN ALT-H MOVE "Alt+H" TO WS-KEY-PRESSED WHEN ALT-I MOVE "Alt+I" TO WS-KEY-PRESSED WHEN ALT-J MOVE "Alt+J" TO WS-KEY-PRESSED WHEN ALT-K MOVE "Alt+K" TO WS-KEY-PRESSED WHEN ALT-L MOVE "Alt+L" TO WS-KEY-PRESSED WHEN ALT-M MOVE "Alt+M" TO WS-KEY-PRESSED WHEN ALT-N MOVE "Alt+N" TO WS-KEY-PRESSED WHEN ALT-O MOVE "Alt+O" TO WS-KEY-PRESSED WHEN ALT-P MOVE "Alt+P" TO WS-KEY-PRESSED WHEN ALT-Q MOVE "Alt+Q" TO WS-KEY-PRESSED WHEN ALT-R MOVE "Alt+R" TO WS-KEY-PRESSED WHEN ALT-S MOVE "Alt+S" TO WS-KEY-PRESSED WHEN ALT-T MOVE "Alt+T" TO WS-KEY-PRESSED WHEN ALT-U
COBOL
MOVE "Alt+U" TO WS-KEY-PRESSED WHEN ALT-V MOVE "Alt+V" TO WS-KEY-PRESSED WHEN ALT-W MOVE "Alt+W" TO WS-KEY-PRESSED WHEN ALT-X MOVE "Alt+X" TO WS-KEY-PRESSED WHEN ALT-Y MOVE "Alt+Y" TO WS-KEY-PRESSED WHEN ALT-Z MOVE "Alt+Z" TO WS-KEY-PRESSED WHEN OTHER GO TO FA30 END-EVALUATE ELSE IF ADIS-FUNC EVALUATE KEY-CODE-1 WHEN LEFT-KEY MOVE "Left Arrow" TO WS-KEY-PRESSED WHEN RIGHT-KEY MOVE "Right Arrow" TO WS-KEY-PRESSED WHEN UP-KEY MOVE "Up Arrow" TO WS-KEY-PRESSED WHEN DOWN-KEY MOVE "Down Arrow" TO WS-KEY-PRESSED WHEN HOME-KEY MOVE "Home" TO WS-KEY-PRESSED WHEN END-KEY MOVE "End" TO WS-KEY-PRESSED WHEN BACK-SPACE MOVE "Back Space" TO WS-KEY-PRESSED WHEN DEL-KEY MOVE "Del" TO WS-KEY-PRESSED WHEN INS-KEY MOVE "Ins" TO WS-KEY-PRESSED WHEN OTHER GO TO FA30 END-EVALUATE ELSE IF DATA-8BIT CALL "CBL_TOUPPER" USING KEY-CODE-1X BY VALUE WS-LENGTH RETURNING WS-STATUS MOVE KEY-CODE-1X TO WS-KEY-PRESSED ELSE GO TO FA30. MOVE KEY-TYPE TO POS-ACT. MOVE KEY-CODE-1X TO POS-CODE. PERFORM READ-POSKBD THRU READ-POSKBD-EXIT. IF WS-F-ERROR = 48 MOVE 1 TO WS-PLU-IND GO TO FA20. MOVE ZERO TO WS-PLU-IND. IF POS-NO = WS-PLU GO TO FA20. DISPLAY "Key pressed: " AT 0812 WS-KEY-PRESSED WITH FOREGROUND-COLOR 6 HIGHLIGHT " is assigned to " POS-NO WITH FOREGROUND-COLOR 7 HIGHLIGHT. DISPLAY "Replace " AT 1012 "Y" WITH FOREGROUND-COLOR 6 HIGHLIGHT "/" "N" WITH FOREGROUND-COLOR 6 HIGHLIGHT. MOVE SPACE TO WS-OPTION. FA15. ACCEPT WS-OPTION AT 1024 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 UPDATE AUTO. CALL "CBL_TOUPPER" USING WS-OPTION BY VALUE WS-LENGTH RETURNING WS-STATUS. IF NOT (WS-OPTION = "Y" OR "N") GO TO FA15. IF WS-OPTION = "N" MOVE 0801 TO CPOS PERFORM ERASE-SCREEN-LOOP UNTIL CLIN > 10 GO TO FA10. FA20. MOVE WS-PLU TO POS-NO. DISPLAY "Key pressed: " AT 0812 WS-KEY-PRESSED WITH FOREGROUND-COLOR 6 HIGHLIGHT " assigned to " POS-NO WITH FOREGROUND-COLOR 7 HIGHLIGHT. PERFORM CHECK-CORRECT. 020250 IF WS-OPTION = "N" GO TO FA10. IF WS-PLU-IND = 1 PERFORM WRITE-POSKBD THRU WRITE-POSKBD-EXIT ELSE PERFORM REWRITE-POSKBD THRU WRITE-POSKBD-EXIT. IF WS-PLU < 255 ADD 1 TO WS-PLU GO TO FA10. FA25. MOVE "Review Keyboard Layout [ ]" TO WS-ERR-MES PERFORM OPT-MESSAGE. IF NOT (WS-OPTION = "Y" OR "N") GO TO FA25. IF WS-OPTION = "N" GO TO FA35. GO TO FA00. FA30. MOVE "Not a programmable key" TO WS-ERR-STRING. 025040 PERFORM ERROR-MESSAGE. GO TO FA10. FA35. MOVE SPACE TO POS-ACT. MOVE 0 TO POS-HEX. 000030 START POSKBD KEY >= POS-KEY. MOVE ZERO TO PLU-SUB0 PLU-SUB1 PLU-SUB2 PLU-SUB3 PLU-SUB4 PLU-SUB5 PLU-SUB6 PLU-SUB7 PLU-SUB8 PLU-SUB9. MOVE SPACES TO PLU-TYPE PLU-VALUE. FA40. 000320 PERFORM READ-POSKBD-NEXT THRU READ-POSKBD-EXIT. 000350 IF WS-F-ERROR = 48 GO TO FA999. MOVE POS-ACT TO PLU-ACT. MOVE POS-CODE TO PLU-CODE. PERFORM READ-POSPLU THRU READ-POSPLU-EXIT. IF WS-F-ERROR = 49 MOVE 1 TO WS-PLU-IND ELSE MOVE ZERO TO WS-PLU-IND. MOVE POS-NO TO PLU-NO. IF WS-PLU-IND = 1 PERFORM WRITE-POSPLU THRU WRITE-POSPLU-EXIT ELSE PERFORM REWRITE-POSPLU THRU WRITE-POSPLU-EXIT. GO TO FA40. FA999. EXIT. / * **** INITIALIZE ROUTINE **** * 029020 ZA00-INIT SECTION 89. ZA00. PERFORM ZA55 THRU ZA60. MOVE LS-PARID TO WS-PARID. MOVE LS-L-OR-N TO W02-L-OR-N. MOVE WS-SYS-ID TO W02-SYSID. MOVE LS-TODAY-DDMMYY TO TODAY-DDMMYY. MOVE LS-USUB TO WS-USUB. 042000 DISPLAY CLR-SCREEN. * * **** S E T U P T H E F U N C T I O N K E Y S * MOVE 1 TO USER-ACTION USER-SETTING. * * ESC, F1 to F10, Shift + F1 to F10, Ctrl + F1 to F10, * Alt + F1 to F10, Alt + 1 to 0, Alt + - & =, * PAGE-UP AND PAGE-DOWN KEYS * MOVE ZERO TO USER-NUMBER. MOVE 55 TO USER-KEYS. CALL X"AF" USING SET-BIT-PAIRS, USER-KEY-CONTROL. * * Alt + A to Z KEYS * F11 & F10, Shift + F11 & F12, Ctrl + F11 & F12, * Alt + F11 & F12 keys * MOVE 65 TO USER-NUMBER. MOVE 34 TO USER-KEYS. CALL X"AF" USING SET-BIT-PAIRS, USER-KEY-CONTROL. * * **** A C T I V A T E M O U S E * MOVE 64 TO MOUSE-FUNC. MOVE 1 TO MOUSE-PARAM. CALL X"AF" USING MOUSE-FUNC MOUSE-PARAM. IF MOUSE-FUNC NOT = 255 MOVE "Y" TO MOUSE-ATTACHED MOVE 66 TO MOUSE-FUNC MOVE 0 TO MOUSE-PARAM CALL X"AF" USING MOUSE-FUNC MOUSE-PARAM ELSE GO TO ZA00A. * * **** S E T M O U S E K E Y T O A C T * A S F U N C T I O N K E Y * MOVE 3 TO USER-ACTION. MOVE 27 TO USER-NUMBER. MOVE 2 TO USER-KEYS. CALL X"AF" USING SET-BIT-PAIRS, USER-KEY-CONTROL. * * **** P A R A M E T E R F I L E * ZA00A. MOVE "PARAM" TO AFID-KEY. ZA00-READ-APACFIDS. 000030 READ APACFIDS WITH IGNORE LOCK KEY IS AFID-KEY. IF WS-STATUS = "00" GO TO ZA00-READ-APACFIDS-EXIT. 006260 STRING "Missing " DELIMITED
COBOL
SIZE AFID-KEY DELIMITED BY " " " file ID - Status " DELIMITED SIZE WS-STATUS DELIMITED SIZE INTO WS-ERR-MES. PERFORM ERROR-LENGTH THRU ERROR-EXIT. 006370 STOP RUN. ZA00-READ-APACFIDS-EXIT. EXIT. ZA00A-CONTINUE. MOVE AFID-PATH TO W02-PARAM. MOVE "DEPART" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-DEPART. MOVE "POSPLU" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-POSPLU. MOVE "STOCKF" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-STOCKF. 020890 MOVE 3 TO WS-PARKEY. 020900 PERFORM READ-PARAM THRU READ-PARAM-EXIT. MOVE PAR-USE-ITM TO WS-USE-ITM. MOVE PAR-EXT-STK TO WS-EXT-STK. 042720 MOVE 1 TO WS-PARKEY. 042730 PERFORM READ-PARAM THRU READ-PARAM-EXIT. 042740 MOVE PAR-COMPANY TO W95-COMP. 042750 MOVE PAR-DMY TO W12-TODAY. 042760 MOVE PAR-YMD TO W12-T-YMD. MOVE ZERO TO WS-ERROR. 042520 MOVE 5 TO WS-PARKEY. 042550 PERFORM READ-PARAM THRU READ-PARAM-EXIT. MOVE 1 TO W05-V-RATE. ZA05-VAT. MOVE W05-VAT-CODE TO DPT-CODE. PERFORM READ-DEPART THRU READ-DEPART-EXIT. MOVE DPT-R-DATE TO WS-VAT-DATE(W05-V-RATE). MOVE DPT-RATE TO W05-VAT(W05-V-RATE). ADD 6 W05-V-RATE GIVING WS-S1. MOVE DPT-P-RATE TO W05-VAT(WS-S1). IF W05-V-RATE < 6 ADD 1 TO W05-V-RATE GO TO ZA05-VAT. OPEN I-O POSPLU. IF WS-STATUS = "05" CLOSE POSPLU OPEN OUTPUT POSPLU CLOSE POSPLU OPEN I-O POSPLU PERFORM ZA500 THRU ZA510. IF WS-ERROR = ZERO OPEN I-O POSKBD. 044780 GO TO ZA999-EXIT. ZA55. 041220 MOVE 1 TO WS-S1. 021870 MOVE SPACES TO WS-MID-LNE. 041240 ZA60. 041250 MOVE WS-G1 TO WS-TCHR (WS-S1) WS-BCHR (WS-S1). MOVE WS-G8 TO WS-TCH (WS-S1) WS-BCH (WS-S1). 041260 IF WS-S1 < 80 041270 ADD 1 TO WS-S1 041280 GO TO ZA60. MOVE WS-G9 TO WS-TCH (1). MOVE WS-G10 TO WS-TCH (80). MOVE WS-G11 TO WS-BCH (1). MOVE WS-G12 TO WS-BCH (80). MOVE WS-G14 TO WS-TCHR (1) WS-BCHR (1). MOVE WS-G13 TO WS-TCHR (80) WS-BCHR (80). 021930 MOVE WS-G2 TO WS-TCHR (18) WS-TCHR (49) 021940 WS-TCHR (60) WS-TCHR (70). 021950 MOVE WS-G3 TO WS-MCHR (18) WS-MCHR (49) 021960 WS-MCHR (60) WS-MCHR (70) WS-MCHR (1) WS-MCHR (80). 021970 MOVE WS-G4 TO WS-BCHR (18) WS-BCHR (49) 021980 WS-BCHR (60) WS-BCHR (70). MOVE LS-COMPANY TO WS-TOP-COMP. IF LS-USER = LS-SYS-ID MOVE "Supervisor─" TO WS-WRKHD ELSE MOVE "Workstation" TO WS-WRKHD MOVE LS-USER TO WS-WRKST. ZA500. OPEN I-O POSKBD. IF NOT (WS-STATUS = "00") MOVE 9 TO WS-ERROR GO TO ZA510. MOVE SPACE TO POS-ACT. MOVE 0 TO POS-HEX. 000030 START POSKBD KEY >= POS-KEY. IF WS-STATUS = "23" MOVE 9 TO WS-ERROR GO TO ZA510. MOVE ZERO TO PLU-SUB0 PLU-SUB1 PLU-SUB2 PLU-SUB3 PLU-SUB4 PLU-SUB5 PLU-SUB6 PLU-SUB7 PLU-SUB8 PLU-SUB9. MOVE SPACES TO PLU-TYPE PLU-VALUE. ZA505. 000320 READ POSKBD NEXT WITH IGNORE LOCK. 000350 IF NOT (WS-STATUS = "00") CLOSE POSKBD GO TO ZA510. MOVE POS-ACT TO PLU-ACT. MOVE POS-CODE TO PLU-CODE. MOVE POS-NO TO PLU-NO. PERFORM WRITE-POSPLU. GO TO ZA505. ZA510. EXIT. 042880 ZA999-EXIT. 042890 EXIT. / * **** I / O E R R O R M E S S A G E S * 042900 ZB000-ERROR SECTION 81. 041480 OPEN-ERROR. 041490 DISPLAY CLR-SCREEN. 041500 DISPLAY "Open error" AT 0812 WITH FOREGROUND-COLOR 14. 041510 GO TO DISPLAY-FILE-NAME. 041480 READ-ERROR. 041490 DISPLAY CLR-SCREEN. 041500 DISPLAY "Read error" AT 0812 WITH FOREGROUND-COLOR 14. 041510 GO TO DISPLAY-FILE-NAME. 041520 WRITE-ERROR. 041530 DISPLAY CLR-SCREEN. 041540 DISPLAY "Write error" AT 0812 WITH FOREGROUND-COLOR 14. 041510 GO TO DISPLAY-FILE-NAME. I-O-ERROR-EXIT. EXIT. 041560 DISPLAY-FILE-NAME. 041810 IF WS-F-ERROR = 7 041820 MOVE W02-DEPART TO WS-FILE 041830 MOVE WS-DEPKEY TO WS-KEY 041840 ELSE 041850 IF WS-F-ERROR = 15 041860 MOVE WS-PARID TO WS-FILE 041870 MOVE WS-PARKEY TO WS-KEY 041840 ELSE 041850 IF WS-F-ERROR = 22 041860 MOVE W02-STOCKF TO WS-FILE 041870 MOVE ZERO TO WS-KEY MOVE STK-CODE TO WS-KEYX 041840 ELSE 041850 IF WS-F-ERROR = 49 041860 MOVE W02-POSPLU TO WS-FILE 041870 MOVE ZERO TO WS-KEY MOVE PLU-KEY TO WS-KEYX. 041880 IF WS-STATUS = "10" 041890 MOVE "End of FILE" TO WS-STAT-MESSAGE 041900 ELSE 041910 IF WS-STATUS = "22" 041920 MOVE "Duplicate record number" TO WS-STAT-MESSAGE 041930 ELSE 041940 IF WS-STATUS = "23" 041950 MOVE "Invalid record number" TO WS-STAT-MESSAGE 041960 ELSE 041970 IF WS-STATUS = "24" 041980 MOVE "DISK full" TO WS-STAT-MESSAGE 041990 ELSE 042000 IF WS-STATUS = "30" 042010 MOVE "DISK error" TO WS-STAT-MESSAGE 042020 ELSE 042030 IF WS-STATUS = "94" 042040 MOVE "FILE locked" TO WS-STAT-MESSAGE. 045380 DISPLAY "File - " AT 1012 WS-FILE WITH FOREGROUND-COLOR 11. 045390 DISPLAY "Status " AT 1212 WS-STATUS WITH FOREGROUND-COLOR 11 ": " WS-STAT-MESSAGE WITH FOREGROUND-COLOR 14. 045400 IF WS-STATUS NOT = "94" 045410 DISPLAY "Key " AT 141
COBOL
2 WS-KEY WITH FOREGROUND-COLOR 11 " " WS-KEYX WITH FOREGROUND-COLOR 11 045420 DISPLAY "Reverse backup or contact program Support" AT 1612. 045440 DISPLAY "Please make a note of these details" AT 1812. 042170 STOP RUN. <|end_of_text|> $set LINKCOUNT"596" ****************************************************************** * * * ****** ** ****** **** **** ****** * * ** ** ** ** ** ** ** ** ** ** ** * * ** ** ** ** ** ** ** ** * * ****** ** ****** ** ** ** ** ** * * ** ** ** ** ** ** ** ** * * ** ** ** ** ** ** ** ** ** ** * * ****** ******** ****** **** **** ******** * * * * ENGLISH * * * * P R I N T P I C K I N G S L I P P R O G R A M * * * * VERSION 8.15.04 - January 2012 * * * ****************************************************************** 000010 IDENTIFICATION DIVISION. 000020 PROGRAM-ID. SLS002. 000030 AUTHOR. J.W.LEMMON (APAC). 000040 DATE-WRITTEN. AUGUST 1991. COPYRIGHT NOTICE: COPYRIGHT (C) 1991 - 2011 by James William Lemmon. (Id No. 4412165050082). All rights reserved. e-mail [email protected]. 000050 SECURITY. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 000050 ENVIRONMENT DIVISION. 000060 CONFIGURATION SECTION. 000070 SPECIAL-NAMES. 000080 CURSOR IS CSTART 000090 CONSOLE IS CRT CRT STATUS IS KEY-STATUS. 000100 INPUT-OUTPUT SECTION. 000110 FILE-CONTROL. COPY APACFIDS.SL. 000150 COPY CONTROL.SL. 000150 COPY DEBTOR.ISL. 000190 COPY DEPART.SL. 000270 COPY PARAM.SL. 000310 COPY SALE.SL. COPY SHARED.SL. 000250 COPY SORDER.SL. COPY SPARTS.SL. 000330 COPY STOCK.SL. 000370 SELECT PRNDSK ASSIGN W02-PRNDISK 000380 ORGANIZATION LINE SEQUENTIAL. 000370 SELECT PRNREP ASSIGN W02-PRINTER 000380 ORGANIZATION LINE SEQUENTIAL. / 000390 DATA DIVISION. 000400 FILE SECTION. COPY APACFIDS.FDE. 000440 COPY CONTROL.FDE. 000480 COPY DEBTOR.FDE. 000420 COPY DEPART.FDE. 000560 COPY PARAM.FDE. 000600 COPY SALE.IFD. COPY SHARED.FDE. 000540 COPY SORDER.FDE. COPY SPARTS.FDE. 000620 COPY STOCK.FDE. 000660 FD PRNDSK LABEL RECORD OMITTED 000420 LINAGE IS WS-PGE-LENGTH. 000680 01 REP-L1. 03 REP-PG. 05 REP-LN PIC 9(04). 000710 03 REP-DETAIL2 PIC X(96). 000700 01 REP-L2. 03 FILLER PIC X(04). 000690 03 REP-DETAIL1 PIC X(80). 000720 01 REP-L3. 03 FILLER PIC X(04). 000730 03 REP-AC PIC X(10). 000740 03 REP-ACNO PIC X(06). 03 FILLER PIC X(01). 000750 03 REP-NAME PIC X(40). 03 FILLER PIC X(06). 000760 03 REP-DATE PIC X(06). 03 REP-TIME. 000770 05 REP-DTE PIC Z9/99/9999. 01 REP-L3A. 03 FILLER PIC X(04). 03 FILLER PIC X(10). 03 REP-TEL PIC X(14). 03 REP-CNTCT PIC X(10). 03 REP-CONTACT PIC X(30). 03 FILLER PIC X(32). 000790 01 REP-L4. 03 FILLER PIC X(04). 000800 03 REP-H1 PIC X(29). 000810 03 REP-REF PIC 9(08)/99. 000860 03 FILLER PIC X(40). 000870 01 REP-L5. 03 FILLER PIC X(04). 000880 03 REP-H2 PIC X(20). 000890 03 REP-H3 PIC X(32). 000900 03 REP-H4 PIC X(12). 000930 03 REP-H5 PIC X(16). 000940 01 REP-L6. 03 FILLER PIC X(04). 03 REP-EXT-ITEM. 000950 05 REP-ITM1 PIC X(14). 05 REP-SL PIC X(01). 05 REP-ITM PIC X(03). 03 FILLER PIC X(02). 000960 03 REP-DESC PIC X(30). 03 FILLER PIC X(02). 03 REP-QTY PIC Z(05)9.999 BLANK WHEN ZERO. 03 FILLER PIC X(02). 03 REP-PRICE PIC Z(06)9.999. 03 FILLER PIC X(05). 01 REP-L7. 03 FILLER PIC X(24). 03 REP-EXT-ITEM2. 000980 05 REP-ITM2 PIC X(14). 05 REP-SL2 PIC X(01). 05 REP-ITM3 PIC X(03). 000990 03 FILLER PIC X(01). 03 REP-DSCR PIC X(30). 000990 03 FILLER PIC X(01). 001410 03 REP-QNT PIC Z(05)9.999. 03 FILLER PIC X(12). 000660 FD PRNREP LABEL RECORD OMITTED 000420 LINAGE IS WS-PGE-LENGTH. 000680 01 PRN-L1. 000690 03 PRN-DETAIL2 PIC X(96). 000700 01 PRN-L2. 000710 03 PRN-DETAIL1 PIC X(80). / 002090 WORKING-STORAGE SECTION. 77 WS-CHECK PIC X(18) VALUE "aeWlimemnomLalismJ". 002100 77 WS-DISC PIC 99V99 COMP-3. 002110 77 WS-TDISC PIC 99V99 COMP-3. 002120 77 WS-CASH-AC PIC X(06). 002130 77 WS-SUB PIC 9(04) COMP-5. 002140 77 WS-S1 PIC 9(04) COMP-5. 002150 77 WS-S2 PIC 9(04) COMP-5. 002160 77 WS-S3 PIC 9(04) COMP-5. 002170 77 WS-S4 PIC 9(04) COMP-5. 002180 77 WS-S5 PIC 9(04) COMP-5. 002190 77 WS-S6 PIC
COBOL
9(04) COMP-5. 002200 77 WS-S7 PIC 9(04) COMP-5. 002210 77 WS-S8 PIC 9(04) COMP-5. 002220 77 WS-S9 PIC 9(04) COMP-5. 002230 77 WS-IXS PIC 9(04) COMP-5. 002240 77 WS-IXS1 PIC 9(04) COMP-5. 002250 77 WS-IXS2 PIC 9(04) COMP-5. 002260 77 WS-IXS3 PIC 9(04) COMP-5. 002270 77 WS-IXS4 PIC 9(04) COMP-5. 002280 77 WS-PARKEY PIC 9(04) COMP-5. 002300 77 WS-KEYSTR PIC 9(06) COMP-5. 002330 77 WS-SALSTR PIC 9(04) COMP-5. 002340 77 WS-SALKEY PIC 9(04) COMP-5. 002350 77 WS-NETKEY PIC 9(04) COMP-5. 002360 77 WS-AUDKEY PIC 9(06) COMP-5. 002370 77 WS-RECKEY PIC 9(06) COMP-5. 002380 77 WS-RECOVER PIC 9(06) COMP-5. 000820 77 WS-SHARED PIC 9(04) COMP-5 VALUE 1. 002440 77 WS-TRANS PIC 9(06) COMP-5 VALUE 1. 000820 77 WS-STOCK PIC X(01). 002400 77 WS-PRN1 PIC 9(01) VALUE 0. 002410 77 WS-PRN2 PIC 9(01) VALUE 0. 002190 77 WS-USE-PACKS PIC X(01). 77 WS-USE-ITM PIC X(01). 77 WS-EXT-STK PIC X(01). 77 WS-PIC-PRC PIC X(01). 002430 77 WS-START PIC 9(08). 002440 77 WS-END PIC 9(08). 002460 77 WS-TME2 PIC 9(08). 002470 77 WS-PORT PIC 9(05) VALUE 1004. 002480 77 WS-OPEN PIC X(01) VALUE X"01". 002490 77 WS-CLOSE PIC X(01) VALUE X"00". 002500 77 WS-PAR PIC 9(01) VALUE 0. 002510 77 WS-INO PIC 9(03) VALUE 0. 002520 77 WS-LINES PIC 9(02) VALUE 0. 002530 77 WS-FIRST PIC 9(03) VALUE 0. 002540 77 WS-LAST PIC 9(03) VALUE 0. 002550 77 WS-LASTINV PIC 9(04) COMP-5. 002560 77 WS-LINE PIC 9(04) COMP-5. 002570 77 WS-PAGE PIC 9(02) COMP-5. 002580 77 WS-L1 PIC 9(04) COMP-5. 002570 77 WS-PGE-LENGTH PIC 9(02) VALUE 66. 001870 77 WS-PRN-LENGTH PIC 9(02) VALUE 62. 003650 77 WS-COND PIC X(06). 003660 77 WS-NORM PIC X(06). 003070 77 WS-EXPP PIC X(06). 003080 77 WS-ECAN PIC X(06). 003090 77 WS-8LPI PIC X(06). 003100 77 WS-6LPI PIC X(06). 77 WS-10CPI PIC X(06). 77 WS-12CPI PIC X(06). 77 WS-17CPI PIC X(06). 002590 77 WS-OPTION PIC X(01). 001070 77 WS-PGADV PIC X(01) VALUE "Y". 002610 77 WS-SKIP PIC X(01) VALUE " ". 002610 77 WS-LOOK PIC X(01) VALUE "S". 002620 77 WS-ETYPE PIC X(01) VALUE "I". 002650 77 WS-ERROR PIC 9(01). 003150 77 WS-PRN-NO PIC X(01) COMP-X VALUE 9. 003160 77 WS-PRN-STAT PIC X(01) COMP-X. 002670 77 WS-CHAR1 PIC X(01). 002680 77 WS-CHAR2 PIC X(01). 002690 77 WS-COMP PIC 9(01). 002710 77 WS-UPDATE PIC 9(01) VALUE ZERO. 002720 77 WS-CONREC PIC 9(01) VALUE ZERO. 002730 77 WS-DELIV PIC X(01). 77 WS-ITMPRC PIC X(01). 002740 77 WS-TYPE PIC X(01). 002750 77 WS-AGE PIC X(01). 002760 77 WS-PRC PIC X(01). 002830 77 WS-BATCH PIC 9(05). 002020 77 WS-ERR2 PIC X(09) VALUE "No Record". 002880 77 WS-PER PIC Z(02)9.99. 002890 77 WS-CR PIC X(01). 002900 77 WS-TAXRES PIC S9(07)V9(08) COMP-3. 77 TODAY-DDMMYY PIC 9(08) COMP-5. 77 WS-USUB PIC 9(04) COMP-5. / 002910 01 WS-DB-LINE. 003060 03 WS-TOP-LINE. 003070 05 WS-TCHAR PIC X(80) VALUE "ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÑÍÍÍÍÍÍ - "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍ͵". 003080 03 WS-TOP-LNE2. 001390 05 WS-TCR PIC X(80) VALUE "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ - "ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿". 003100 03 WS-TP-LINE2 REDEFINES WS-TOP-LNE2. 003110 05 FILLER PIC X(01). 003120 05 WS-TOP-COMP PIC X(40). 001430 05 FILLER PIC X(23). 05 WS-WRKHD PIC X(11). 001430 05 FILLER PIC X(01). 05 WS-WRKST PIC X(03). 001430 05 FILLER PIC X(01). 003140 03 WS-MID-LINE. 001450 05 WS-MCHAR PIC X(80) VALUE "³ ³ ³ - " ³ ³ ³ ³". 03 WS-MINV REDEFINES WS-MID-LINE. 05 WS-INV1 PIC X(01). 05 WS-INV78 PIC X(78). 05 WS-INV80 PIC X(01). 003160 03 WS-MID-LNE2. 05 FILLER PIC X(01) VALUE "³". 05 WS-BLNK78 PIC X(78) VALUE SPACES. 05 FILLER PIC X(01) VALUE "³". 003180 03 WS-BOT-LINE. 003190 05 WS-BCHAR PIC X(80) VALUE "
COBOL
ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÏÍÍÍÍÍÍ - "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍ͵". 003200 03 WS-BOT-LNE2. 001510 05 WS-BCR PIC X(80) VALUE "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ - "ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ". 003240 03 WS-B-LINE REDEFINES WS-BOT-LNE2. 003250 05 FILLER PIC X(01). 05 WS-MEM-LINE. 003260 07 WS-SRT-LINE 003270 PIC X(50). 07 FILLER PIC X(10). 003280 05 FILLER PIC X(19). 03 WS-MM-LINE. 05 FILLER PIC X(01) VALUE "³". 05 WS-SPACE PIC X(60) VALUE SPACES. 05 FILLER PIC X(01) VALUE "³". 03 WS-HME-LINE PIC X(60) VALUE ALL "Í". 003220 03 WS-TOP-LNE. 003230 05 WS-TCHR PIC X(80) VALUE "ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍ - "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍ͵". 003240 03 WS-T-LINE REDEFINES WS-TOP-LNE. 003250 05 FILLER PIC X(01). 003260 05 WS-H-LINE 003270 PIC X(78). 003280 05 FILLER PIC X(01). 003290 03 WS-MID-LNE. 003300 05 WS-MCHR PIC X(80) VALUE "³ ³ - " ³ ³ ³ ³". 03 WS-MST-LNE REDEFINES WS-MID-LNE. 05 WS-MST1 PIC X(01). 05 WS-MST78 PIC X(78). 05 WS-MST80 PIC X(01). 003310 03 WS-BOT-LNE. 003320 05 WS-BCHR PIC X(80) VALUE "ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍ - "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍ͵". 003330 03 WS-TP-LNE. 003340 05 WS-TCH PIC X(80) VALUE "ÆÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ - "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍ͵". 003350 03 WS-MD-LNE. 003360 05 WS-MCH PIC X(80) VALUE "³ ³ - " ³ ³ ³ ³". 03 WS-MDDT-LNE REDEFINES WS-MD-LNE. 05 WS-MDT1 PIC X(01). 05 WS-MDT78 PIC X(78). 05 WS-MDT80 PIC X(01). 003370 03 WS-BT-LNE. 003380 05 WS-BCH PIC X(80) VALUE "ÆÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ - "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍ͵". 001690 03 WS-TP-LINE. 001700 05 WS-TCA PIC X(01) OCCURS 80. 001710 03 WS-MD-LINE. 001720 05 WS-MCA PIC X(01) OCCURS 80. 03 WS-SO78-L REDEFINES WS-MD-LINE. 05 WS-MSO1 PIC X(01). 05 WS-MSO78 PIC X(78). 05 WS-MSO80 PIC X(01). 001730 03 WS-BT-LINE. 001740 05 WS-BCA PIC X(01) OCCURS 80. 003340 COPY WS.WS. 01 WS-HELP. 03 WS-MODULE PIC X(03) VALUE "SLS". 03 WS-PROG PIC X(03) VALUE "002". 000290 01 WS-PARID. 000020 03 WS-SYS-ID PIC X(03). 01 WS-LOCAL-ID. 03 WS-LOCAL-DRIVE PIC X(01). 03 FILLER PIC X(14) VALUE ":\APACSHR\SORD". 03 WS-USER-ID PIC X(03). 03 FILLER PIC X(04) VALUE ".ORD". 01 WS-SORDER-STR. 03 FILLER PIC X(64). 003380 01 W00-TRAN-CODES. 03 W00-T-VAT PIC S9(09)V99 COMP-3. 003410 03 W00-E-DESC PIC X(12). 003420 03 W00-A-DESC PIC X(12). 003430 03 W00-ACTION PIC 9(01). 003440 03 W00-T-CODE PIC 9(02) COMP-5. 003450 03 W00-T-GL PIC 9(06) COMP-3. 003460 03 W00-T-DAY PIC 9(06) COMP-5. 003470 03 W00-T-VAL PIC S9(09)V99 COMP-3. 003480 03 W00-T-MTD PIC 9(06) COMP-5. 003490 03 W00-T-MTDV PIC S9(09)V99 COMP-3. 003500 03 W00-T-YTD PIC 9(06) COMP-5. 003510 03 W00-T-YTDV PIC S9(09)V99 COMP-3. 003530 01 W02-FID. COPY APACFIDS.ID. 003570 COPY CONTROL.ID. 003610 COPY DEBTOR.ID. 002120 COPY DEPART.ID. COPY PARAM.ID. 003710 COPY SALE.ID. COPY SHARED.ID. 003670 COPY SORDER.ID. COPY SPARTS.ID. 003730 COPY STOCK.ID. COPY PRNDISK.ID. 003770 01 W02-FILE-IDS. 003910 03 W02-PRINTER. 05 W02-REPORT PIC X(07) VALUE "SLS002.". 05 W02-USER PIC X(05) VALUE SPACES. COPY W05.VAT. COPY W10.SAL. 003120 01 W11-PARTS. 003130 03 W11-PART-DETAILS OCCURS 30. 003140 05 W11-CODE PIC X(14). 003150 05 W11-DESC PIC X(30). 003160 05 W11-QUANT PIC S9(05)V9999 COMP-3. COPY W12.WS. 01
COBOL
W14-ORDER. 03 W14-REF PIC Z(08). 03 W14-AC PIC X(06). 03 W14-NAME. 05 W14-NME PIC X(27). 05 FILLER PIC X(13). 03 W14-DATE PIC Z9/99/9999. 03 W14-PS PIC 9(02). 03 W14-DOC PIC X(01). 03 W14-DDOC. 05 W14-INV PIC Z(08). 03 W14-VALUE PIC Z(07)9.99. 004410 01 W15-DISCOUNT. 004420 03 W15-DISC PIC S9(03)V99 COMP-3 OCCURS 10. COPY W20.WS. 004520 01 W25-CALCS. 004730 03 W25-RESULT PIC 9(05)V99. 004740 03 W25-RESULT1 REDEFINES W25-RESULT. 004750 05 W25-WHOLE PIC 9(03). 004760 05 W25-DECIMAL PIC 9(02). 03 W25-RESULT2 REDEFINES W25-RESULT. 05 W25-KEY PIC 9(04). 05 W25-SUB PIC 9(01). 05 FILLER PIC 9(02). 004570 03 W25-TOTAL PIC 9(07)V99 COMP-3. 004580 03 W25-VALUE PIC S9(07)V99 COMP-3. 004590 03 W25-CREDIT PIC S9(07)V99 COMP-3. 001660 03 W25-TIME PIC 9(08). 001670 03 W25-TRED REDEFINES W25-TIME. 001690 05 W25-HH PIC 9(02). 001690 05 W25-MM PIC 9(02). 001690 05 W25-SS PIC 9(02). 001680 05 FILLER PIC 9(02). 01 W30-MESSAGE. 03 W30-PERC PIC Z9.99. 03 FILLER PIC X(40) VALUE "% Settlement discount if paid in 30 DAYS". 01 W32-MESSAGE. 03 W32-REMARKS OCCURS 10 PIC X(63). 01 W34-HEADER. 03 W34-FORMAT PIC X(01). 03 W34-MARGIN PIC 9(02) COMP-5. 03 W34-SALUTATION PIC X(63). COPY W40.DBT. COPY W40.WS. COPY FUNCTION.WS. 005370 COPY W50.WS. 005390 01 W60-NME-ADD. 005400 03 W60-NAME. 005410 05 W60-NCHAR OCCURS 40 PIC X(01). 005420 03 W60-ADDRESS. 005430 05 W60-ACHAR OCCURS 60 PIC X(01). 005440 03 W60-ADDRESS1 PIC X(60). 005620 COPY W70DEBT.IWS. 005640 01 W75-KEYS. 005650 03 W75-S PIC 9(02) COMP-5. 005660 03 W75-S1 PIC 9(02) COMP-5. 03 W75-S2 PIC 9(02) COMP-5. 005670 03 W75-DNO PIC X(06) OCCURS 18. 03 W75-SORD PIC 9(08) OCCURS 18. 005690 01 W75-TITLES. 005700 03 W75-DESCRIP. 005710 05 FILLER PIC X(28) VALUE 005720 "Mr Mnr Mrs Mev ". 005730 05 FILLER PIC X(28) VALUE 005740 "Miss Mej Ms Ms ". 005750 05 FILLER PIC X(28) VALUE 005760 "Dr Dr Rev Ds ". 005770 05 FILLER PIC X(28) VALUE 005780 "Prof Prof The HonSy Edel". 005790 05 FILLER PIC X(28) VALUE 005800 " ". 005810 03 W75-CODES REDEFINES W75-DESCRIP. 005820 05 W75-TITLE OCCURS 10. 005830 07 W75-ETITLE PIC X(07). 005840 07 W75-ATITLE PIC X(07). 005860 01 W80-ACCOUNT. 005870 03 W80-ACNO PIC X(06). 005880 03 W80-CRED REDEFINES W80-ACNO. 005890 05 W80-CNO PIC 9(05). 005900 05 W80-CAC REDEFINES W80-CNO. 005910 07 W80-CTYPE PIC 9(01). 005920 07 W80-SER PIC 9(04). 005930 05 FILLER PIC 9(01). 005940 03 W80-TYPE PIC 9(01). COPY W90.SAL. 006590 01 W95-STM. 006600 03 W95-COMP PIC X(40). 006610 03 W95-ADD1 PIC X(30). 006620 03 W95-ADD2 PIC X(30). 006630 03 W95-ADD3 PIC X(30). 006640 03 W95-ADD4 PIC X(30). 006650 03 W95-PC. 006660 05 W95-POST PIC 9(04). 006670 03 W95-TEL PIC X(14). 006680 03 W95-V1. 006690 05 W95-T PIC Z(04)9.99. 006700 03 W95-V2. 006710 05 W95-B PIC Z(06)9.99-. 006720 03 W95-D. 006730 05 W95-DTE PIC Z9/99/9999. 03 W95-TIME. 05 W95-HH PIC 99. 05 FILLER PIC X(01) VALUE ":". 05 W95-MM PIC 99. 05 FILLER PIC X(01) VALUE ":". 05 W95-SS PIC 99. 006740 01 W100-EDIT. 004500 03 W100-LBAL PIC Z(06)9.99-. 004500 03 W100-LARR PIC Z(06)9.99. 006750 03 W100-BAL PIC Z(08)9.99-. 006760 03 W100-CUR PIC Z(08)9.99-. 006770 03 W100-30 PIC Z(08)9.99-. 006780 03 W100-60 PIC Z(08)9.99-. 006790 03 W100-90 PIC Z(08)9.99-. 006800 03 W100-120 PIC Z(08)9.99-. 006800 03 W100-INT PIC Z(08)9.99-. 006810 03 W100-CRL PIC Z(06)9. 006820 03 W100-V2. 006830 05 W100-S6V2 PIC Z(05)9.99-. 03 W100-V3 REDEFINES W100-V2. 05 W100-PRICE PIC X(09). 05 FILLER PIC X(01). 03 W100-V4 REDEFINES W100-V2. 05 W100-EXT PIC Z(06)9.99. LINKAGE SECTION. COPY CHAIN.LS. / 006840 SCREEN SECTION. COPY BLANK.CRT. 007420 01 S02. 007430 03 LINE 2 COLUMN 27 FOREGROUND-COLOR 7 HIGHLIGHT 007440 VALUE "SALES/ORDER PROGRAM CONTROL". COPY SORLUP.CRT. 007910 01 S07. 007920 03 COLUMN 2 FOREGROUND
COBOL
-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 0 PIC X(14) USING W10-ITEM AUTO. 01 S07-ITM. 005540 03 COLUMN 2 FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 0 005550 PIC X(14) USING W10-ITEM AUTO. 03 COLUMN 17 FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 0 005550 PIC X(03) USING W10-ITM AUTO. 005530 01 S07-EXT. 005540 03 COLUMN 2 FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 0 005550 PIC X(18) USING W10-EXT-ITEM AUTO. 009600 01 S26-QNT. 009610 03 COLUMN 51 FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 0 009620 PIC Z(04)9.99 USING W10-QUANT AUTO. 009630 01 S26-PRC. 009640 03 COLUMN 60 FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 0 009650 PIC Z(05)9.99 USING W10-SELL AUTO. 009660 01 S26-DSC. 009670 03 COLUMN 30 FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 009680 PIC Z9.99 USING WS-DISC AUTO. 009690 01 S26-TDSC. 009700 03 COLUMN 15 FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 0 009710 PIC Z9.99 USING WS-TDISC AUTO. 009720 01 S26-AVGE. 009730 03 COLUMN 28 FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 009740 PIC Z(04)9.999 USING STK-AVGE AUTO. 009890 01 S28. 009900 03 LINE 25 COLUMN 25 BACKGROUND-COLOR 3 FOREGROUND-COLOR 7 HIGHLIGHT 009910 PIC ZZ9 USING WS-SALKEY AUTO. 009290 01 S30. 009300 03 LINE 2 COLUMN 35 FOREGROUND-COLOR 7 HIGHLIGHT VALUE "PICKING SLIP". 009310 03 LINE 3 COLUMN 2 VALUE "Ac No". 009320 03 COLUMN 15 VALUE "Name". 009330 03 COLUMN 61 VALUE "Ord No ". 009340 03 LINE 4 COLUMN 2 VALUE "Assisted". 03 COLUMN 61 VALUE "Tel.". 009350 03 LINE 5 COLUMN 2 VALUE "Ref. No". 03 COLUMN 20 VALUE "Contact". 009380 03 COLUMN 65 VALUE "Date". 009370 03 LINE 6 COLUMN 2 REVERSE-VIDEO VALUE "Item Code I". 009380 03 COLUMN 18 REVERSE-VIDEO VALUE "TM Description ". 009390 03 COLUMN 33 REVERSE-VIDEO VALUE " ". 009400 03 COLUMN 49 REVERSE-VIDEO VALUE " Quantity ". 009410 03 COLUMN 60 REVERSE-VIDEO VALUE "Unit Price ". 009420 03 COLUMN 72 REVERSE-VIDEO VALUE "Extended". 009160 03 LINE 7 COLUMN 1 BACKGROUND-COLOR 0 VALUE "Æ". 009160 03 COLUMN 2 VALUE "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍ - "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍ". 03 COLUMN 80 BACKGROUND-COLOR 0 VALUE "µ". 009160 03 LINE 19 COLUMN 1 BACKGROUND-COLOR 0 VALUE "Æ". 009170 03 COLUMN 2 VALUE "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍ - "ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍ". 03 COLUMN 80 BACKGROUND-COLOR 0 VALUE "µ". 009470 03 LINE 20 COLUMN 3 VALUE "Sub Total". 009480 03 LINE 21 COLUMN 3 VALUE "Discount". 009490 03 LINE 22 COLUMN 3 VALUE "T A X -VAT". 009500 03 LINE 23 COLUMN 3 VALUE "AMOUNT DUE". 01 S30A. 03 FOREGROUND-COLOR 3 HIGHLIGHT PIC Z(08) USING W10-SORD AUTO. 009950 01 S36. 009960 03 FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5 PIC X(06) USING W80-ACNO AUTO. COPY ERROR.CRT. COPY OPT.CRT. / 001230 PROCEDURE DIVISION USING LS-PARID LS-USER-ID LS0-PROGRAMS LS0-SECURITY. 010250 AA000-MAIN SECTION. 010260 AA000-INIT. 003240 IF LS0-SALEV < 1 MOVE "Not Authorised" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO AA49. 010270 PERFORM ZA000-INIT. 010430 GO TO BA00. AA49. EXIT PROGRAM. AA50-LOOKUP SECTION. AA50O. MOVE "O" TO WS-LOOK. 010500 AA50. 011050 PERFORM SAVE-SCREEN. 011080 MOVE 4 TO W44-FUNCTION. 011090 PERFORM SCREEN-CONTENTS. PERFORM SORDER-LOOKUP. 011320 PERFORM RESTORE-SCREEN. 010920 AA99. 010930 EXIT. COPY FUNCTION.SCR. COPY ERROR.SCR. * ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ * ³ OPT-MESSAGE ³ * ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ * ³ This routine is used to allow the OPERATOR to respond to ³ * ³ a request for an option, so that the correct action can ³ * ³ be performed by the program. The routine will display the ³ * ³ message in a pop-up window and allow the OPERATOR to ³ * ³ respond to the 'question'. ³ * ³ ³ * ³ The option request must be placed in WS-ERR-MES and may ³ * ³ not exceed 48 characters. The message will be centred in ³ * ³ the window. An example of a message request follows: ³ * ³ ³ * ³ MOVE "Print transactions (Y/N) [ ]" TO WS-ERR-MES. ³ * ³ PERFORM OPT-MESSAGE (Use this format if function or any ³ * ³ other keys are to be tested on exit) ³ * ³ OR ³ * ³ PERFORM OPT-MESSAGE UNTIL WS-OPTION = "N" OR "Y". ³ * ³ (Use TEST AFTER if WS-OPTION is preloaded with a ³ * ³ default option) ³ * ³ ³ * ³ This would be displayed as: ³ * ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ * ³ ³ Print transactions (Y/N) [ ] ³°° ³ * ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
COBOL
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ°° ³ * ³ °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° ³ * ³ ³ * ³ The response is returned in WS-OPTION (in upper case). ³ * ³ ³ * ³ To display the request message higher or lower (default ³ * ³ is line 13) move the line number to be used to SLIN and ³ * ³ then PERFORM OPT-SETUP THRU OPT-EXIT. ³ * ³ (The UNTIL and TEST AFTER options also apply here) ³ * ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ COPY OPTION.CRT. 010950 COPY LOCKED.RC2. 010970 COPY CLEAR.CRT. * * **** D I S P L A Y L O O K U P O P T I O N S * 011010 AA400 SECTION. 011020 AA401. 011590 DISPLAY "F1" AT 2502 WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 HIGHLIGHT "=Help," WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 "F2" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 HIGHLIGHT 011600 " Order no./ " WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 011610 "F3" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 HIGHLIGHT 011620 " Account no./ " WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1 "F4" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 HIGHLIGHT " From specified date Lookup" WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 1. 011110 AA405. 011120 EXIT. / ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ * ³ R E A D F I L E S R O U T I N E S ³ * ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 011130 AC000 SECTION. 011170 COPY CONTROL.RD. 011210 COPY DEBTOR.RD. 011730 COPY DEPART.RD. 011290 COPY PARAM.RD. 011310 COPY SALE.RD. COPY SHARED.RD. 011270 COPY SORDER.RD. COPY SPARTS.RD. 011330 COPY STOCK.RD. / ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ * ³R E W R I T E & W R I T E F I L E S R O U T I N E S³ * ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 011370 AD000-WRITE SECTION. 011410 COPY CONTROL.WR. 011410 COPY PARAM.WR. 011530 COPY SALE.WR. 011270 COPY SORDER.WR. COPY SORDER.LUP. COPY APAC.HLP. / ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ * ³ THIS ROUTINE GENERATES THE RECOVERY FILE RECORDS ³ * ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 011670 AY000 SECTION. 012470 AY60. * ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ * ³ Read the 5th record in the SHARED file and lock it. This ³ * ³ will cause all other programs that need to update the ³ * ³ data base to wait until this record is unlocked. ³ * ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 012690 MOVE 1 TO WS-COUNT. 012690 MOVE 5 TO WS-SHARED. 012700 PERFORM READ-SHARED-LOCK THRU READ-SHARED-EXIT. 012720 GO TO AY999. 012950 AY70. * ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ * ³ End the transaction and unlock any locked records. ³ * ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 013070 COMMIT. 013080 AY999. 013090 EXIT. / 013100 AZ000-END SECTION. 013110 AZ000-EOJ. CLOSE SALE 013240 PRNREP. IF W70-ORD-SYS = "Y" IF WS-LOCAL-DRIVE = "C" CLOSE SORDER MOVE WS-SORDER-STR TO W02-SORDER OPEN I-O SORDER. 013250 AZ100. 013260 EXIT PROGRAM. COPY CA000.STK. * ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ * ³ Read debtor record - using account number. ³ * ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 013720 CA155-GET-DEBTOR SECTION 2. 013730 CA155. 012010 MOVE W80-ACNO TO DEB-ACNO. 012020 PERFORM READ-DEBTOR THRU READ-DEBTOR-EXIT. IF WS-F-ERROR = 6 MOVE 1 TO WS-ERROR 014380 ELSE 013870 IF DEB-ACNO NOT = W80-ACNO 013880 MOVE 2 TO WS-ERROR 013890 ELSE 013900 MOVE 0 TO WS-ERROR 013910 MOVE DEB-TYPE TO W80-TYPE. 013890 CA160-EXIT. 013900 EXIT. COPY CA200.STK. COPY CA500.STK. * * **** G E T S O R D E R R E C O R D U S I N G SOR-KEY. * * WS-ERROR: * * 1
COBOL
= NO RECORD * 2 = NOT ORDER RECORD (QUOTE OR INVOICE) * 3 = ORDER DETAILS INCOMPLETE * 4 = INVALID ACCOUNT NUMBER * 013270 GET-SORDER SECTION. 013280 GET-SORD-ORDNO. MOVE 1 TO WS-S7. 013310 MOVE W10-SORD TO SOR-REF W90-RF. 013420 MOVE 100 TO SOR-SQN. MOVE ZERO TO WS-ERROR. PERFORM READ-SORDER THRU READ-SORDER-EXIT. IF WS-F-ERROR = 20 MOVE 1 TO WS-ERROR GO TO GET-SORDER-EXIT. IF SOR-DOC NOT = "O" MOVE 2 TO WS-ERROR GO TO GET-SORDER-EXIT. MOVE 1 TO WS-LAST WS-SALKEY. GO TO GET-SORD-TEST-TYPE. GET-SORD-NEXT. PERFORM READ-SORDER-NEXT THRU READ-SORDER-EXIT. IF WS-F-ERROR = 20 MOVE 3 TO WS-ERROR GO TO GET-SORDER-EXIT. GET-SORD-TEST-TYPE. * H E A D E R R E C O R D IF SOR-TYPE = 0 MOVE SOR-AC TO W80-ACNO DEB-ACNO PERFORM CA155-GET-DEBTOR IF WS-ERROR NOT = ZERO MOVE 4 TO WS-ERROR GO TO GET-SORDER-EXIT END-IF MOVE SOR-OREF TO W90-REG MOVE SOR-NAME TO W40-NAME MOVE SOR-PICNO TO W90-PICK MOVE SOR-ORD TO W90-ORD MOVE SOR-SMAN TO W10-SMAN MOVE SOR-EXP TO W90-EXP MOVE SOR-PRC TO WS-PRC MOVE SOR-CONTACT TO W40-CONTACT MOVE SOR-TEL TO W40-TEL ELSE * I T E M D E T A I L S IF SOR-TYPE = 1 INITIALIZE SAL-RECORD1 014950 MOVE SOR-EXT-ITEM TO SAL-EXT-ITEM MOVE SOR-DESC TO SAL-DESC MOVE SOR-QNT TO SAL-QNT * MOVE SOR-QORD TO SAL-ORD MOVE SOR-COST TO SAL-COST MOVE SOR-SELL TO SAL-SELL MOVE SOR-VAT TO SAL-VAT 015000 MOVE SOR-VAT-SUB TO SAL-VAT-SUB MOVE SOR-VAL TO SAL-VAL MOVE SOR-INCTAX TO SAL-INCTAX MOVE SOR-NONTAX TO SAL-NONTAX MOVE SOR-TAXVAL TO SAL-TAXVAL MOVE SOR-DSC TO SAL-DSC MOVE SOR-DISC TO SAL-DISC MOVE SOR-PACK TO SAL-PACK MOVE SOR-SQN TO SAL-SQN IF SAL-VAT-SUB > ZERO ADD SOR-TAXVAL TO W90-TAXVAL(SAL-VAT-SUB) END-IF PERFORM GET-SORD-WRITE-SALE ELSE * P A R T S D E T A I L S IF SOR-TYPE = 2 INITIALIZE SAL-RECORD1 014950 MOVE SOR-EXT-ITEM TO SAL-EXT-ITEM MOVE SOR-DESC TO SAL-DESC MOVE SOR-SQN TO SAL-SQN ELSE * R E M A R K S IF SOR-TYPE = 3 OR 4 INITIALIZE SAL-RECORD1 MOVE SOR-SERIAL TO SAL-MSER MOVE SOR-SQN TO SAL-SQN PERFORM GET-SORD-WRITE-SALE 015160 ELSE * A D D R E S S 015170 IF SOR-TYPE = 5 MOVE SOR-AD1 TO W40-AD1 MOVE SOR-AD2 TO W40-AD2 MOVE SOR-AD3 TO W40-AD3 MOVE SOR-AD4 TO W40-AD4 MOVE SOR-PC TO W40-PC ELSE * S A L U T A T I O N 015170 IF SOR-TYPE = 7 MOVE SOR-TEXT TO W34-SALUTATION ELSE * T E X T 015170 IF SOR-TYPE = 8 MOVE SOR-TEXT TO W32-REMARKS (WS-S7) ADD 1 TO WS-S7 ELSE * T R A I L E R MOVE SOR-SUBTOT TO W90-DB MULTIPLY -1 BY SOR-DSCNT GIVING W90-TDISC MOVE W90-TDISC TO W90-LDISC MOVE SOR-NON-TXBL TO W90-NONTAX 015280 MOVE SOR-TAXABLE TO W90-EXCTOT MOVE SOR-TAX TO W90-TTAX MOVE SOR-TOT TO W90-TOTAL MOVE SOR-BAL TO W90-BAL MOVE SOR-INSTRUCT TO W90-INSTRUCT MOVE SOR-PMETH TO W90-PMETH MOVE SOR-STATUS TO W40-STATUS MOVE SOR-HTEL TO W40-HTEL MOVE SOR-ID TO W40-ID GO TO GET-SORDER-EXIT. GO TO GET-SORD-NEXT. GET-SORD-WRITE-SALE. MOVE WS-LAST TO SAL-CODE. PERFORM WRITE-SALE THRU WRITE-SALE-EXIT. ADD 1 TO WS-LAST WS-SALKEY. 013470 GET-SORDER-EXIT. 013480 EXIT. / 016060 BA000 SECTION. 016070 BA00. IF LS-SLS-ORDNO NOT = SPACES PERFORM BD000 GO TO AZ000-EOJ. BA05. 016080 DISPLAY CLR-SCREEN. 016090 DISPLAY S02. 016100 DISPLAY "P" AT 1212 WITH FOREGROUND-COLOR 6 HIGHLIGHT "rint a picking slip or " WITH FOREGROUND-COLOR 7 "E" WITH FOREGROUND-COLOR 6 HIGHLIGHT "xit > <" WITH FOREGROUND-COLOR 7. MOVE " " TO WS-OPTION. 016150 BA10. PERFORM TEST AFTER UNTIL WS-OPTION = "P" OR "E" 016160 ACCEPT WS-OPTION AT 1242 WITH FOREGROUND-COLOR 7 HIGHLIGHT UPDATE AUTO CALL "CBL_TOUPPER" USING WS-OPTION BY VALUE WS-LENGTH RETURNING WS-STATUS END-PERFORM. * E X I T P R O G R A M 016240 IF WS-OPTION = "E" 016250 GO TO AZ000-EOJ. * P R I N T P I C K I N G S L I P 016340 PERFORM BC000 016350 GO TO BA05. / 017690 BB050 SECTION. 017700 BB50. MOVE WS-EXPP TO REP-DETAIL2. MOVE ZERO TO REP-LN. WRITE REP-L2 BEFORE 0 LINES. MOVE W95-COMP TO REP-DETAIL2. MOVE 2 TO REP-LN. WRITE REP-L2 BEFORE 2 LINES. 017710 MOVE SPACES TO REP-DETAIL2. 017750 MOVE "PICKING SLIP - REFERENCE NO:" TO REP-H1. MOVE W90-PS TO REP-REF. MOVE ZERO TO REP-LN. WRITE REP-L2 BEFORE 0 LINES. MOVE 2 TO REP-LN. 017760 WRITE REP-L2 BEFORE 2 LINES. IF W90-PICK > 01 MOVE SPACES TO REP-DETAIL2 MOVE "REPLACE PREVIOUS PICKING SLIP" TO REP-H1 MOVE 2 TO REP-LN WRITE REP-L2 BEFORE 2 LINES. BB60. MOVE WS-ECAN TO REP-DETAIL2. MOVE ZERO TO REP-LN. WRITE REP-L2 BEFORE 0 LINES. 017710 MOVE SPACES TO REP-DETAIL2. MOVE "Account :" TO REP-AC. 017770 MOVE W80-ACNO TO REP-ACNO. MOVE W40-NAME TO REP-NAME. MOVE "Date:" TO REP-DATE. MOVE W12-T
COBOL
ODAY TO REP-DTE. MOVE 1 TO REP-LN. 017760 WRITE REP-L2 BEFORE 1 LINES. 017790 MOVE SPACES TO REP-DETAIL2. MOVE " Contact:" TO REP-CNTCT. MOVE W40-CONTACT TO REP-CONTACT. MOVE "Tel :" TO REP-AC. MOVE W40-TEL TO REP-TEL. MOVE "Time:" TO REP-DATE. 012150 ACCEPT W25-TIME FROM TIME. MOVE W25-HH TO W95-HH. MOVE W25-MM TO W95-MM. MOVE W25-SS TO W95-SS. MOVE W95-TIME TO REP-TIME. MOVE 1 TO REP-LN. 017760 WRITE REP-L2 BEFORE 1 LINES. 017790 MOVE SPACES TO REP-DETAIL2. IF WS-DELIV = "Y" IF NOT(DEB-PADDR = SPACES) MOVE DEB-PADDR TO W60-ADDRESS INSPECT W60-ADDRESS REPLACING ALL "*" BY "." MOVE 1 TO REP-LN MOVE W60-ADDRESS TO REP-DETAIL2 WRITE REP-L2 BEFORE 1 LINES MOVE SPACES TO REP-DETAIL2. MOVE ALL "=" TO REP-DETAIL1. MOVE 2 TO REP-LN. 017760 WRITE REP-L2 BEFORE 2 LINES. 017790 MOVE SPACES TO REP-DETAIL2. 017800 MOVE "Item Code" TO REP-H2. 017820 MOVE "Description" TO REP-H3. 017840 MOVE " Quantity" TO REP-H4. IF WS-PIC-PRC = "Y" MOVE " Value" TO REP-H5 ELSE IF WS-ITMPRC = "Y" MOVE "Item Price" TO REP-H5 ELSE MOVE "Remarks" TO REP-H5. MOVE 2 TO REP-LN. 017850 WRITE REP-L2 BEFORE 2 LINES. MOVE SPACES TO REP-DETAIL2. 017950 BB65. 017960 EXIT. / BB400 SECTION. BB405. OPEN INPUT PRNDSK. CALL X"91" USING X91-RES X91-FUN PRNDSK. BB410. READ PRNDSK AT END CLOSE PRNDSK GO TO BB499. MOVE REP-DETAIL2 TO PRN-DETAIL2. IF REP-PG = "PAGE" WRITE PRN-L2 BEFORE PAGE ELSE MOVE REP-LN TO WS-LINES WRITE PRN-L1 BEFORE WS-LINES LINES. GO TO BB410. BB499. EXIT. / * **** P I C K I N G S L I P S * 018500 BC000 SECTION 5. 018570 BC05. * * **** P I C K I N G S L I P S C R E E N * 018580 DISPLAY CLR-SCREEN. 018590 DISPLAY S30. 018620 MOVE 8 TO LIN. 018630 PERFORM BC115 UNTIL LIN > 18. 018640 MOVE W12-TODAY TO W90-DTE. 018650 DISPLAY W90-DTE AT 0570 WITH FOREGROUND-COLOR 3 HIGHLIGHT BACKGROUND-COLOR 5. 018660 MOVE ZERO TO W90-BDT W90-LDISC W90-NONTAX 016450 W90-BAL W90-SALES W90-EXCTOT 016460 W90-CUR W90-PMETH W40-STATUS. 018680 MOVE 1 TO WS-FIRST WS-LAST. 018690 MOVE SPACES TO W90-TAX W90-INSTRUCT. MOVE 1 TO WS-S9. BC08. 018660 MOVE ZERO TO W90-VAT(WS-S9) W90-TAXVAL(WS-S9). IF WS-S9 < 12 ADD 1 TO WS-S9 GO TO BC08. MOVE ZERO TO W10-SORD. 018710 BC10. PERFORM AA400. 025260 ACCEPT S30A AT 0510. IF USER-FUNC EVALUATE KEY-CODE-1 WHEN ESC-KEY MOVE ZERO TO W10-SORD GO TO BC599 WHEN F1-KEY PERFORM HELP-ROUTINE WHEN F2-KEY MOVE "O" TO WS-ETYPE WHEN F3-KEY MOVE "A" TO WS-ETYPE WHEN F4-KEY MOVE "T" TO WS-ETYPE WHEN OTHER CALL X"E5" GO TO BC10 END-EVALUATE 020770 PERFORM AA50O THRU AA50 020780 DISPLAY S30A AT 0510 020790 IF W10-SORD = ZERO 020800 GO TO BC10. 018850 DISPLAY CLEAR-L25. 020810 IF W10-SORD = ZERO 020830 GO TO BC599. MOVE W10-SORD TO W90-REF. BC12. PERFORM GET-SORDER. IF WS-ERROR = 1 MOVE WS-ERR2 TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO BC10. IF WS-ERROR = 2 MOVE "Not an order" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO BC10. IF WS-ERROR = 3 MOVE "Order corrupted" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO BC10. IF WS-ERROR = 4 MOVE "Invalid a/c no" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO BC10. IF W90-EXP = "E" OR "X" MOVE W05-VATNO TO W90-TAX ELSE MOVE SPACES TO W90-TAX. 018820 DISPLAY S36 AT 0308 016780 DISPLAY W40-NAME AT 0320 WITH FOREGROUND-COLOR 3 HIGHLIGHT BACKGROUND-COLOR 5. 019900 DISPLAY W90-ORD AT 0368 WITH FOREGROUND-COLOR 7 HIGHLIGHT 017670 BACKGROUND-COLOR 5. 019970 DISPLAY W10-SMAN AT 0411 WITH FOREGROUND-COLOR 7 HIGHLIGHT 017710 BACKGROUND-COLOR 5. 020010 IF W10-SMAN NOT = ZERO 020030 ADD 100 W10-SMAN GIVING WS-PARKEY 020040 PERFORM READ-PARAM THRU READ-PARAM-EXIT 020100 DISPLAY PAR-SALESMAN AT 0420 WITH FOREGROUND-COLOR 3 HIGHLIGHT BACKGROUND-COLOR 5. DISPLAY W40-TEL AT 0466 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5. DISPLAY W40-CONTACT AT 0528 WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 5. MOVE 1 TO WS-SALKEY. SUBTRACT 1 FROM WS-LAST. BC15. 022610 MOVE W90-DB TO W90-TOTAL. 022620 SUBTRACT W90-LDISC FROM W90-TOTAL. 022630 MOVE W90-DB TO W100-BAL. 022640 DISPLAY W100-BAL AT 2015 WITH FOREGROUND-COLOR 3 HIGHLIGHT BACKGROUND-COLOR 5. 022650 MULTIPLY -1 BY W90-LDISC 022660 GIVING W100-BAL. 022670 DISPLAY W100-BAL AT 2115 WITH FOREGROUND-COLOR 3 HIGHLIGHT BACKGROUND-COLOR 5. * * **** C A L C U L A T E T A X ( RUNNING TOTAL ) * 022690 IF W90-TAX = SPACES 022700 GO TO BC20. MOVE 1 TO WS-S1. MOVE ZERO TO W25-TOTAL. BC18. 023070 IF W90-TAXVAL(WS-S1) NOT = ZERO 023060 MOVE W05-VAT(WS-S1) 023060 TO W05-RATE 023080 COMPUTE W25-TOTAL ROUNDED = W25-TOTAL + (W90-TAXVAL(WS-S1) * W05-RTE). IF WS-S1 < 6 ADD 1 TO WS-S1 GO TO BC18. 022740 MOVE W25-TOTAL TO W100-BAL. 022760 ADD W25-TOTAL TO W90-TOTAL. 022750 DISPLAY W100-BAL AT 2215 WITH FOREGROUND-COLOR 3 HIGHLIGHT BACKGROUND-COLOR 5. 022770 BC20. 022780 MOVE W90-TOTAL TO W100-BAL. 022790 DISPLAY
COBOL
W100-BAL AT 2315 WITH FOREGROUND-COLOR 3 HIGHLIGHT BACKGROUND-COLOR 5. * * **** D I S P L A Y S A L E S D E T A I L S * 029120 BC25. 029130 MOVE 8 TO LIN. 029140 PERFORM BC115 UNTIL LIN > 18. 029150 MOVE 8 TO LIN. 029160 MOVE 1 TO WS-LINES WS-FIRST. 029170 BC30. 029180 MOVE WS-FIRST TO WS-SALKEY. * * **** H A V E A L L T H E E N T R I E S B E E N * D I S P L A Y E D * 029190 BC35. 029200 IF WS-SALKEY > WS-LAST 029210 GO TO BC45. 029220 PERFORM READ-SALE THRU READ-SALE-EXIT. MOVE SAL-EXT-ITEM TO W10-EXT-ITEM. * * **** D I S P L A Y E N T R Y D E T A I L S * 029240 IF SAL-EXT-ITEM = SPACES 023480 DISPLAY (LIN, 21) SAL-SDSC WITH FOREGROUND-COLOR 7 HIGHLIGHT BACKGROUND-COLOR 0 029260 GO TO BC40. * * ***** E X T E N D E D C O D E ***** * IF WS-EXT-STK = "Y" DISPLAY S07-EXT AT LINE LIN ELSE * * ***** A L P H A - N U M E R I C C O D E ***** * IF W10-STCK = "A" IF WS-USE-ITM = "Y" DISPLAY S07-ITM AT LINE LIN ELSE 021070 DISPLAY S07 AT LINE LIN. 023510 DISPLAY (LIN, 21) SAL-SDSC WITH FOREGROUND-COLOR 3 HIGHLIGHT BACKGROUND-COLOR 0. 029290 MOVE SAL-QNT TO W10-QUANT. 029300 DISPLAY S26-QNT AT LINE LIN. 029310 MOVE SAL-SELL TO W10-SELL. 029320 DISPLAY S26-PRC AT LINE LIN. 029330 MOVE SAL-VAL TO W100-EXT. 023570 DISPLAY (, 70) W100-EXT WITH FOREGROUND-COLOR 3 HIGHLIGHT BACKGROUND-COLOR 0. * * **** I S T H E S C R E E N F U L L * 029350 BC40. 029360 IF LIN < 18 029370 ADD 1 TO LIN WS-SALKEY WS-LINES 029380 GO TO BC35. BC45. EXIT. * * **** D I S P L A Y O P T I O N S * 029390 BC50. 029400 IF WS-LINES < 11 029410 IF WS-FIRST = 1 029420 MOVE "Print P/'S'lip - 'E'xit" TO WS-ERR-MES MOVE ZERO TO WS-LINES 029440 ELSE 029450 MOVE "Print P/'S'lip - 'P'revious screen - 'E'xit" TO WS-ERR-MES 029480 MOVE 2 TO WS-LINES 029490 ELSE 029500 IF WS-SALKEY < WS-LAST 029510 IF WS-FIRST = 1 029520 MOVE "Print P/'S'lip - 'N'ext screen - 'E'xit" TO WS-ERR-MES 029550 MOVE 1 TO WS-LINES 029560 ELSE 029570 MOVE "Print P/'S'lip,'N'ext,'P'revious screen,'E'xit" TO WS-ERR-MES 029600 MOVE 3 TO WS-LINES 029610 ELSE 029620 MOVE 2 TO WS-LINES 029630 MOVE "Print P/'S'lip - 'P'revious screen - 'E'xit" TO WS-ERR-MES. 029660 BC55. MOVE SPACE TO WS-OPTION. PERFORM OPT-MESSAGE TEST AFTER UNTIL WS-OPTION = "S" OR "E" OR "N" OR "P". 029750 IF WS-OPTION = "E" 029760 GO TO BC05. 029770 IF WS-OPTION = "S" 029780 GO TO BC65. * * **** I S P R E V I O U S S C R E E N R E Q U I R E D * 029790 IF WS-LINES = 2 OR 3 029800 IF WS-OPTION = "P" 029810 PERFORM BC60 029830 SUBTRACT 11 FROM WS-FIRST 029840 GO TO BC30. * * **** I S N E X T S C R E E N R E Q U I R E D * 029850 IF WS-LINES = 1 OR 3 029860 IF WS-OPTION = "N" 029870 PERFORM BC60 029890 ADD 11 TO WS-FIRST 029900 GO TO BC30. 029910 GO TO BC55. 029920 BC60. * * **** C L E A R S C R E E N * 029930 MOVE 8 TO LIN. 029940 PERFORM BC115 UNTIL LIN > 18. 029950 MOVE 8 TO LIN. 029960 MOVE 1 TO WS-LINES. * * **** R E A D D E T A I L S A N D P R I N T S L I P * BC65. IF WS-PGADV = "Y" OPEN OUTPUT PRNDSK CALL X"91" USING X91-RES X91-FUN PRNDSK. DISPLAY CLEAR-L25. 025200 DISPLAY "Printing Picking Slip" AT 2502 WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 HIGHLIGHT BLINK. 025220 MOVE ZERO TO WS-SALKEY. 025230 PERFORM AY60 THRU AY999. * * **** R E A D O R D E R F I L E A N D P R I N T * 026210 BC70. 026330 MOVE W90-REF TO SOR-REF. MOVE ZERO TO SOR-SQN. PERFORM START-AT-ORDER-NO THRU READ-SORDER-EXIT. IF WS-F-ERROR = 20 MOVE "Database corrupted" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO BC599. BC75. PERFORM READ-SORDER-NEXT THRU READ-SORDER-EXIT. IF WS-F-ERROR = 20 GO TO BC100. IF SOR-REF NOT = W90-REF GO TO BC100. IF SOR-TYPE = 0 ADD 1 TO W90-PICK PERFORM BB050 GO TO BC75. IF SOR-TYPE = 9 GO TO BC100. IF SOR-TYPE NOT = 1 IF SOR-TYPE = 2 OR 5 GO TO BC75 ELSE MOVE SOR-DESC TO REP-DESC PERFORM BC80 GO TO BC75. MOVE SOR-EXT-ITEM TO PRT-EXT-ITEM. IF WS-USE-ITM = "Y" MOVE SOR-ITEM TO REP-ITM1 MOVE "/" TO REP-SL MOVE SOR-ITM TO REP-ITM ELSE MOVE SOR-EXT-ITEM TO REP-EXT-ITEM. MOVE SOR-DESC TO REP-DESC. MOVE SOR-QNT TO REP-QTY. IF WS-PIC-PRC = "Y" MOVE SOR-VAL TO REP-PRICE ELSE IF WS-ITMPRC = "Y" MOVE SOR-SELL TO REP-PRICE. 020530 PERFORM READ-SPARTS THRU READ-SPARTS-EXIT. 020510 IF WS-F-ERROR = 21 * MOVE SOR-QNT TO REP-QNT PERFORM BC80 021310 GO TO BC75. BC80. IF LINAGE-COUNTER OF PRNDSK < WS-PRN-LENGTH MOVE 1 TO REP-LN WRITE REP-L2 BEFORE 1 LINES ELSE MOVE "PAGE" TO REP-PG WRITE REP-L2 BEFORE PAGE MOVE WS-EXPP TO REP-DETAIL2 MOVE ZERO TO REP-LN WRITE REP-L2 BEFORE 0 LINES MOVE "PICKING SL
COBOL
IP - CONTINUED..." TO REP-H1 WRITE REP-L2 BEFORE 0 LINES MOVE 2 TO REP-LN WRITE REP-L2 BEFORE 2 LINES PERFORM BB60 THRU BB65 IF WS-TYPE = "P" MOVE WS-12CPI TO REP-DETAIL2 MOVE ZERO TO REP-LN WRITE REP-L2 BEFORE 0 LINES MOVE 1 TO REP-LN. MOVE SPACES TO REP-DETAIL2. * * **** P R O D U C T I O N D E T A I L S * BC85. MOVE "P" TO WS-TYPE. MOVE WS-12CPI TO REP-DETAIL2. MOVE ZERO TO REP-LN. WRITE REP-L2 BEFORE 0 LINES. MOVE SPACES TO REP-DETAIL2. MOVE 1 TO REP-LN. 021370 MOVE 1 TO WS-S6. 021420 BC90. 021430 IF PRT-CODE (WS-S6) = SPACES 021440 ADD 1 TO WS-S6 021450 GO TO BC95. IF WS-USE-ITM = "Y" MOVE PRT-CODE(WS-S6) TO REP-ITM2 MOVE "/" TO REP-SL2 MOVE PRT-PITM(WS-S6) TO REP-ITM3 ELSE MOVE PRT-EXT-CODE(WS-S6) TO REP-EXT-ITEM2. 021480 MULTIPLY PRT-QUANT(WS-S6) BY SOR-QNT GIVING REP-QNT. 021490 PERFORM CA000. 021500 IF WS-F-ERROR = 22 021510 ADD 1 TO WS-S6 021520 GO TO BC95. 021540 MOVE STK-DESC TO REP-DSCR. PERFORM BC80 021600 ADD 1 TO WS-S6. 021660 BC95. 021670 IF WS-S6 < 31 021680 GO TO BC90. MOVE "I" TO WS-TYPE. MOVE WS-NORM TO REP-DETAIL2. MOVE ZERO TO REP-LN. WRITE REP-L2 BEFORE 0 LINES. MOVE SPACES TO REP-DETAIL2. MOVE 1 TO REP-LN. WRITE REP-L2 BEFORE 1 LINES. MOVE 2 TO REP-LN. GO TO BC75. * * **** U P D A T E O R D E R F I L E * BC100. MOVE SPACES TO REP-DETAIL2. MOVE 1 TO REP-LN WRITE REP-L2 BEFORE 1 LINES. MOVE ALL "=" TO REP-DETAIL1. 026330 MOVE W90-REF TO SOR-REF. MOVE 100 TO SOR-SQN. PERFORM READ-SORDER-LOCK THRU READ-SORDER-EXIT. ADD 1 TO SOR-PICNO. PERFORM REWRITE-SORDER-UNLOCK THRU WRITE-SORDER-EXIT. PERFORM AY70 THRU AY999. BC110. * MOVE "Advance to next page (Y/N) [Y]" * TO WS-ERR-MES. MOVE "Y" TO WS-OPTION. * PERFORM OPT-MESSAGE. 029730* IF NOT (WS-OPTION = "N" OR "Y") * GO TO BC110. MOVE WS-OPTION TO WS-PGADV. * IF WS-OPTION = "N" * IF LINAGE-COUNTER OF PRNDSK < (WS-PRN-LENGTH - 8) * MOVE 2 TO REP-LN * WRITE REP-L2 BEFORE 2 LINES * ELSE * MOVE "PAGE" TO REP-PG * WRITE REP-L2 BEFORE PAGE * ELSE MOVE "PAGE" TO REP-PG WRITE REP-L2 BEFORE PAGE CLOSE PRNDSK PERFORM BB400. MOVE SPACES TO REP-DETAIL2. GO TO BC05. 023520 BC115. 036820 DISPLAY (LIN, 1) "³" WITH BACKGROUND-COLOR 0 FOREGROUND-COLOR 3 WS-INV78 WITH FOREGROUND-COLOR 3 "³" WITH BACKGROUND-COLOR 0 FOREGROUND-COLOR 3. 023540 ADD 1 TO LIN. BC599. EXIT. / * **** P I C K I N G S L I P S * 018500 BD000 SECTION 5. 018570 BD05. MOVE LS-SLS-ORDNO TO W90-REF W10-SORD. PERFORM GET-SORDER. IF WS-ERROR NOT = ZERO MOVE "Database corrupted" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO BD599. * * **** R E A D D E T A I L S A N D P R I N T S L I P * BD65. 025200 DISPLAY "Printing Picking Slip" AT 2502 WITH BACKGROUND-COLOR 3 FOREGROUND-COLOR 6 HIGHLIGHT BLINK. 025220 MOVE ZERO TO WS-SALKEY. 025230 PERFORM AY60 THRU AY999. * * **** R E A D O R D E R F I L E A N D P R I N T * 026210 BD70. 026330 MOVE W90-REF TO SOR-REF. MOVE ZERO TO SOR-SQN. PERFORM START-AT-ORDER-NO THRU READ-SORDER-EXIT. IF WS-F-ERROR = 20 MOVE "Database corrupted" TO WS-ERR-STRING 003260 PERFORM ERROR-MESSAGE GO TO BD599. BD75. PERFORM READ-SORDER-NEXT THRU READ-SORDER-EXIT. IF WS-F-ERROR = 20 GO TO BD100. IF SOR-REF NOT = W90-REF GO TO BD100. IF SOR-TYPE = 0 ADD 1 TO W90-PICK PERFORM BB050 GO TO BD75. IF SOR-TYPE = 9 GO TO BD100. IF SOR-TYPE NOT = 1 IF SOR-TYPE = 2 OR 5 GO TO BD75 ELSE MOVE SOR-DESC TO REP-DESC PERFORM BD80 GO TO BD75. MOVE SOR-EXT-ITEM TO PRT-EXT-ITEM. IF WS-USE-ITM = "Y" MOVE SOR-ITEM TO REP-ITM1 MOVE "/" TO REP-SL MOVE SOR-ITM TO REP-ITM ELSE MOVE SOR-EXT-ITEM TO REP-EXT-ITEM. MOVE SOR-DESC TO REP-DESC. MOVE SOR-QNT TO REP-QTY. IF WS-PIC-PRC = "Y" MOVE SOR-VAL TO REP-PRICE ELSE IF WS-ITMPRC = "Y" MOVE SOR-SELL TO REP-PRICE. 020530 PERFORM READ-SPARTS THRU READ-SPARTS-EXIT. 020510 IF WS-F-ERROR = 21 * MOVE SOR-QNT TO REP-QNT PERFORM BD80 021310 GO TO BD75. BD80. IF LINAGE-COUNTER OF PRNDSK < WS-PRN-LENGTH MOVE 1 TO REP-LN WRITE REP-L2 BEFORE 1 LINES ELSE MOVE "PAGE" TO REP-PG WRITE REP-L2 BEFORE PAGE MOVE WS-EXPP TO REP-DETAIL2 MOVE ZERO TO REP-LN WRITE REP-L2 BEFORE 0 LINES MOVE "PICKING SLIP - CONTINUED..." TO REP-H1 WRITE REP-L2 BEFORE 0 LINES MOVE 2 TO REP-LN WRITE REP-L2 BEFORE 2 LINES PERFORM BB60 THRU BB65. MOVE SPACES TO REP-DETAIL2. * * **** P R O D U C T I O N D E T A I L S * BD85. 021370 MOVE 1 TO WS-S6. 021420 BD90. 021430 IF PRT-CODE (WS-S6) = SPACES 021440 ADD 1 TO WS-S6 021450 GO TO BD95. IF WS-USE-ITM = "Y" MOVE PRT-CODE(WS-S6) TO REP-ITM2 MOVE "/" TO REP-SL2
COBOL
MOVE PRT-PITM(WS-S6) TO REP-ITM3 ELSE MOVE PRT-EXT-CODE(WS-S6) TO REP-EXT-ITEM2. 021470 MOVE PRT-EXT-CODE(WS-S6) TO W10-EXT-ITEM. 021480 MULTIPLY PRT-QUANT (WS-S6) BY SOR-QNT GIVING REP-QNT. 021490 PERFORM CA000. 021500 IF WS-F-ERROR = 22 021510 ADD 1 TO WS-S6 021520 GO TO BD95. 021540 MOVE STK-DESC TO REP-DSCR. PERFORM BD80 021600 ADD 1 TO WS-S6. 021660 BD95. 021670 IF WS-S6 < 31 021680 GO TO BD90. GO TO BD75. * * **** U P D A T E O R D E R F I L E * BD100. MOVE SPACES TO REP-DETAIL2. MOVE 1 TO REP-LN WRITE REP-L2 BEFORE 1 LINES. MOVE ALL "=" TO REP-DETAIL1. 026330 MOVE W90-REF TO SOR-REF. MOVE 100 TO SOR-SQN. PERFORM READ-SORDER-LOCK THRU READ-SORDER-EXIT. ADD 1 TO SOR-PICNO. PERFORM REWRITE-SORDER-UNLOCK THRU WRITE-SORDER-EXIT. PERFORM AY70 THRU AY999. BD110. MOVE "Advance to next page (Y/N) [Y]" TO WS-ERR-MES. MOVE "Y" TO WS-OPTION. PERFORM OPT-MESSAGE TEST AFTER UNTIL WS-OPTION = "N" OR "Y". IF WS-OPTION = "N" IF LINAGE-COUNTER OF PRNDSK < (WS-PRN-LENGTH - 8) MOVE 2 TO REP-LN WRITE REP-L2 BEFORE 2 LINES ELSE MOVE "PAGE" TO REP-PG WRITE REP-L2 BEFORE PAGE ELSE MOVE "PAGE" TO REP-PG WRITE REP-L2 BEFORE PAGE CLOSE PRNDSK PERFORM BB400. MOVE SPACES TO REP-DETAIL2. BD599. EXIT. / 049180 ZA000-INIT SECTION 9. 049190 ZA000-OPEN. PERFORM ZA55 THRU ZA60. MOVE LS-PARID TO WS-PARID. MOVE LS-L-OR-N TO W02-L-OR-N. MOVE WS-SYS-ID TO W02-SYSID. MOVE LS-TODAY-DDMMYY TO TODAY-DDMMYY. MOVE LS-USUB TO WS-USUB. 049200 DISPLAY CLR-SCREEN. * * **** S E T U P T H E F U N C T I O N K E Y S * MOVE 1 TO USER-ACTION USER-SETTING. * * ESC, F1 to F10 keys * MOVE ZERO TO USER-NUMBER. MOVE 11 TO USER-KEYS. CALL X"AF" USING SET-BIT-PAIRS, USER-KEY-CONTROL. * * PAGE-UP AND PAGE-DOWN KEYS * MOVE 53 TO USER-NUMBER. MOVE 2 TO USER-KEYS. CALL X"AF" USING SET-BIT-PAIRS, USER-KEY-CONTROL. * * **** A C T I V A T E M O U S E * MOVE 64 TO MOUSE-FUNC. MOVE 1 TO MOUSE-PARAM. CALL X"AF" USING MOUSE-FUNC MOUSE-PARAM. IF MOUSE-FUNC NOT = 255 MOVE "Y" TO MOUSE-ATTACHED MOVE 66 TO MOUSE-FUNC MOVE 0 TO MOUSE-PARAM CALL X"AF" USING MOUSE-FUNC MOUSE-PARAM ELSE GO TO ZA00A. * * **** S E T M O U S E K E Y T O A C T * A S F U N C T I O N K E Y * MOVE 3 TO USER-ACTION. MOVE 27 TO USER-NUMBER. MOVE 2 TO USER-KEYS. CALL X"AF" USING SET-BIT-PAIRS, USER-KEY-CONTROL. * * **** P A R A M E T E R F I L E * ZA00A. MOVE "PARAM" TO AFID-KEY. ZA00-READ-APACFIDS. 000030 READ APACFIDS WITH IGNORE LOCK KEY IS AFID-KEY. IF WS-STATUS = "00" GO TO ZA00-READ-APACFIDS-EXIT. 006260 STRING "Missing " DELIMITED SIZE AFID-KEY DELIMITED BY " " " file ID - Status " DELIMITED SIZE WS-STATUS DELIMITED SIZE INTO WS-ERR-MES. PERFORM ERROR-LENGTH THRU ERROR-EXIT. 006370 STOP RUN. ZA00-READ-APACFIDS-EXIT. EXIT. ZA00A-CONTINUE. MOVE AFID-PATH TO W02-PARAM. MOVE "DEBTOR" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-DEBTOR. MOVE "DEPART" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-DEPART. * ************************************************************* * **** C O N T R O L F I L E **** * ************************************************************* MOVE "NETWORK" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-NETWORK. MOVE "PRNDISK" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. INSPECT AFID-PATH REPLACING FIRST "XXX" BY LS-USER. MOVE AFID-PATH TO W02-PRNDISK. MOVE "SALE" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. INSPECT AFID-PATH REPLACING FIRST "XXX" BY LS-USER. MOVE AFID-PATH TO W02-SALE. MOVE "SHARED" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-SHARED. MOVE "SORDER" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-SORDER. MOVE "SPARTS" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-SPARTS. MOVE "STOCKF" TO AFID-KEY. PERFORM ZA00-READ-APACFIDS THRU ZA00-READ-APACFIDS-EXIT. MOVE AFID-PATH TO W02-STOCKF. 049320 MOVE 3 TO WS-PARKEY. 049330 PERFORM READ-PARAM THRU READ-PARAM-EXIT. IF NOT (PAR-STOCK = "A" OR "N") MOVE "A" TO PAR-STOCK. MOVE PAR-STOCK TO W10-STCK. IF PAR-STOCK = "N" MOVE PAR-SLNGTH TO W10-SLNGTH ELSE MOVE 14 TO W10-SLNGTH. IF W10-SLNGTH < 3 MOVE 3 TO W10-SLNGTH ELSE IF W10-SLNGTH > 14 MOVE 14 TO W10-SLNGTH. MOVE PAR-PACKS TO WS-USE-PACKS. MOVE PAR-USE-ITM TO WS-USE-ITM. MOVE PAR-EXT-STK TO WS-EXT-STK. IF LS-USER NUMERIC IF LS-USE >
COBOL
ZERO AND < 110 MOVE LS-USE TO WS-USUB GO TO ZA01A. MOVE 110 TO WS-USUB. ZA01A. 014240 ADD 2549 WS-USUB GIVING W25-RESULT. MOVE W25-KEY TO WS-PARKEY. ADD 1 W25-SUB GIVING WS-S6. 014250 PERFORM READ-PARAM THRU READ-PARAM-EXIT. IF TRM-PICP(WS-S6) = 1 MOVE "LPT1" TO W02-PRINTER MOVE ZERO TO WS-PRN-NO ELSE IF TRM-PICP(WS-S6) = 2 MOVE "LPT2" TO W02-PRINTER MOVE 1 TO WS-PRN-NO ELSE IF TRM-PICP(WS-S6) = 3 MOVE "LPT3" TO W02-PRINTER MOVE 2 TO WS-PRN-NO ELSE IF TRM-PICP(WS-S6) = 4 MOVE "COM1" TO W02-PRINTER ELSE IF TRM-PICP(WS-S6) = 5 MOVE "COM2" TO W02-PRINTER ELSE IF TRM-PICP(WS-S6) = 9 MOVE LS-USER TO W02-USER. ADD 501 TRM-PRN1(WS-S6) GIVING W25-RESULT. DIVIDE W25-RESULT BY 2 GIVING WS-PARKEY REMAINDER WS-S6. ADD 1 TO WS-S6. PERFORM READ-PARAM THRU READ-PARAM-EXIT. MOVE TRM-CONP(WS-S6) TO WS-COND. MOVE TRM-NORP(WS-S6) TO WS-NORM. MOVE TRM-EXPP(WS-S6) TO WS-EXPP. MOVE TRM-ECAN(WS-S6) TO WS-ECAN. MOVE TRM-8LPI(WS-S6) TO WS-8LPI. MOVE TRM-6LPI(WS-S6) TO WS-6LPI. MOVE TRM-10CPI(WS-S6) TO WS-10CPI. MOVE TRM-12CPI(WS-S6) TO WS-12CPI. MOVE TRM-17CPI(WS-S6) TO WS-17CPI. MOVE TRM-LENGTH(WS-S6) TO WS-PRN-LENGTH. MOVE TRM-PAGE(WS-S6) TO WS-PGE-LENGTH. ZA01B. MOVE PAR-VAT-REG TO W05-VATNO. ZA02. 050280 OPEN OUTPUT SALE. 050290 CLOSE SALE. 050300 OPEN I-O SALE. 050520 MOVE 5 TO WS-PARKEY. 050530 PERFORM READ-PARAM THRU READ-PARAM-EXIT. 050560 MOVE PAR-DISCOUNT TO W15-DISCOUNT. MOVE 1 TO W05-V-RATE. ZA05-VAT. MOVE W05-VAT-CODE TO DPT-CODE. PERFORM READ-DEPART THRU READ-DEPART-EXIT. MOVE DPT-R-DATE TO WS-VAT-DATE(W05-V-RATE). MOVE DPT-RATE TO W05-VAT(W05-V-RATE). ADD 6 W05-V-RATE GIVING WS-S1. MOVE DPT-P-RATE TO W05-VAT(WS-S1). IF W05-V-RATE < 6 ADD 1 TO W05-V-RATE GO TO ZA05-VAT. MOVE PAR-PIC-PRC TO WS-PIC-PRC. MOVE PAR-DELIV TO WS-DELIV. MOVE PAR-PS-PRC TO WS-ITMPRC. 050580 MOVE 1 TO WS-PARKEY. 050590 PERFORM READ-PARAM THRU READ-PARAM-EXIT. 050600 MOVE PAR-DMY TO W12-TODAY. 050610 MOVE PAR-YMD TO W12-T-YMD. 050620 MOVE PAR-COMPANY TO W95-COMP. 050640 MOVE PAR-TELEPHONE TO W95-TEL. 050690 ADD 1 TO WS-PARKEY. 050700 PERFORM READ-PARAM THRU READ-PARAM-EXIT. 050710 MOVE PAR-ADDRESS1 TO W95-ADD1. 050720 MOVE PAR-ADDRESS2 TO W95-ADD2. 050730 MOVE PAR-ADDRESS3 TO W95-ADD3. 050740 MOVE PAR-ADDRESS4 TO W95-ADD4. 050750 MOVE PAR-POST-CDE TO W95-POST. 050760 IF W95-ADD4 = SPACES 050770 MOVE W95-PC TO W95-ADD4 050780 MOVE SPACES TO W95-PC. 050790 IF W95-ADD3 = SPACES 050800 MOVE W95-ADD4 TO W95-ADD3 050810 MOVE SPACES TO W95-ADD4. 050820 IF W95-ADD2 = SPACES 050830 MOVE W95-ADD3 TO W95-ADD2 050840 MOVE SPACES TO W95-ADD3. 050850 IF W95-ADD1 = SPACES 050860 MOVE W95-ADD2 TO W95-ADD1 050870 MOVE SPACES TO W95-ADD2. 050890 MOVE 7 TO WS-PARKEY. 050900 PERFORM READ-PARAM THRU READ-PARAM-EXIT. 050910 MOVE PAR-CASH-AC TO WS-CASH-AC. IF WS-PRN-NO < 3 PERFORM ZA210 THRU ZA215 IF WS-ERROR = 1 GO TO ZA205 ELSE DISPLAY "Waiting for printer response" AT 1412 WITH FOREGROUND-COLOR 6 HIGHLIGHT BLINK. 049880 OPEN OUTPUT PRNREP. CALL X"91" USING X91-RES X91-FUN PRNREP. MOVE WS-10CPI TO PRN-DETAIL2. WRITE PRN-L1 BEFORE 0 LINES. MOVE SPACES TO PRN-DETAIL2. 012670 MOVE 1 TO WS-NETKEY. 012680 PERFORM READ-CONTROL THRU READ-CONTROL-EXIT. 012700 MOVE NET-DEBTOR TO W70-DEBT. IF W70-ORD-SYS = "Y" * GET HARD DRIVE ID AND IF LOCAL DRIVE (C) * CHANGE ORDER FILE-ID TO SORD??? (??? = USER NO) CALL "PC_READ_DRIVE" USING WS-LOCAL-DRIVE RETURNING WS-STATUS CALL "CBL_TOUPPER" USING WS-LOCAL-DRIVE BY VALUE WS-LENGTH RETURNING WS-STATUS IF WS-LOCAL-DRIVE = "C" CLOSE SORDER MOVE W02-SORDER TO WS-SORDER-STR MOVE LS0-NO TO WS-USER-ID MOVE WS-LOCAL-ID TO W02-SORDER OPEN I-O SORDER. 051530 GO TO ZA999. COPY ZA49.PRO. * * **** S E T U P T H E S C R E E N G R A P H I C S * ZA55. 051090 MOVE 1 TO WS-S1. 040060 MOVE SPACES TO WS-MD-LINE. 040090 ZA60. 040130 MOVE WS-G1 TO WS-TCA(WS-S1) WS-BCA(WS-S1). 040150 IF WS-S1 < 80 040160 ADD 1 TO WS-S1 040170 GO TO ZA60. 040220 MOVE WS-G14 TO WS-TCA(1) WS-BCA(1). 040260 MOVE WS-G13 TO WS-TCA(80) WS-BCA(80). 040300 MOVE WS-G2 TO WS-TCA(10) WS-TCA(17) 040360 WS-TCA(47) WS-TCA(56) 040370 WS-TCA(59) WS-TCA(68). 040400 MOVE WS-G3 TO WS-MCA(1) WS-MCA(80) 040470 WS-MCA(10) WS-MCA(17) 040480 WS-MCA(45) WS-MCA(56) 040490 WS-MCA(59) WS-MCA(68). 040550 MOVE WS-G4 TO WS-BCA(10) WS-BCA(17) 040610 WS-BCA(47) WS-BCA(56) 040620 WS-BCA(59) WS-BC
COBOL
IDENTIFICATION DIVISION. PROGRAM-ID. MULTIPLIER. DATA DIVISION. WORKING-STORAGE SECTION. 01 Num1 PIC 9 VALUES ZEROES. 01 Num2 PIC 9 VALUES ZEROES. 01 Result PIC 99 VALUES ZEROES. PROCEDURE DIVISION. BEGIN. *> DISPLAY "ENTER FIRST NUMBER (1 DIGIT):" WITH NO ADVANCING. *> DISPLAY + [WITH NO ADVANCING]. 表示不加換行符號; *> 沒+ [WITH NO ADVANCING]. 則會自動加換行符號. DISPLAY "ENTER FIRST NUMBER (1 DIGIT):" WITH NO ADVANCING. ACCEPT Num1. DISPLAY "ENTER second NUMBER (1 DIGIT):" WITH NO ADVANCING. ACCEPT Num2. MULTIPLY Num1 BY Num2 GIVING Result. DISPLAY "Result is = ", Result. STOP RUN. <|end_of_text|>000010*======================================================================== 000020* 一般保存メソッド    −サンプルプログラム「従業員管理(永続化)」− 000030* 000040*   SELFオブジェクトが保持する一般従業員に固有なデータを,従業員マス 000050*  タクラスのファクトリデータに設定する. 000060*   SUPER クラスのデータ保存メソッドを呼びだす。 000070* 000080* 〇参照クラス 000090*  1)従業員マスタクラス (MemberMaster-class) 000100* 2)一般クラス     (Member-class)     ←所属クラス 000110* 000120* Copyright 1998-2015 FUJITSU LIMITED 000130*======================================================================== 000140 METHOD-ID. Store-method OF Member-class. 000150 ENVIRONMENT DIVISION. 000160 CONFIGURATION SECTION. 000170 REPOSITORY. 000180 CLASS MemberMaster-class 000190 CLASS Member-class. 000200 DATA DIVISION. 000210 WORKING-STORAGE SECTION. 000220 LINKAGE SECTION. 000230 PROCEDURE DIVISION. 000240* 000250 MOVE 時間外手当 TO 時間外手当 OF MemberMaster-class. 000260 MOVE 残業時間 TO 残業時間 OF MemberMaster-class. 000270 INVOKE SUPER "Store-method". 000280* 000290 END METHOD Store-method. <|end_of_text|>IDENTIFICATION DIVISION. PROGRAM-ID. conv. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT STANDARD-OUTPUT ASSIGN TO DISPLAY. DATA DIVISION. FILE SECTION. FD STANDARD-OUTPUT. 01 STDOUT-RECORD PICTURE X(80). WORKING-STORAGE SECTION. 01 FORMATTED-INTEGER PIC Z(04)9. 77 SUMM PIC 9(10) VALUE 0. 77 GOOD PIC 9(1) VALUE 0. 01 PREV PIC X(1) VALUE''. 77 I PICTURE S99 USAGE IS COMPUTATIONAL. LINKAGE SECTION. 77 IN-LINE PIC X(30). 01 W-SUB PIC 9(2). PROCEDURE DIVISION USING In-Line, W-SUB. *>Reset variables MOVE 0 TO SUMM MOVE'' TO PREV PERFORM VARYING I FROM 1 BY 1 UNTIL I IS GREATER THAN W-SUB + 1 *>Reset valid roman numerial flag MOVE 0 TO GOOD IF I IS GREATER THAN 1 MOVE IN-LINE(I - 1:1) TO PREV END-IF *>Start IF/ELSEIF code block for parsing IF IN-LINE(I:1) IS EQUAL TO 'M' COMPUTE SUMM = SUMM + 1000 MOVE 1 TO GOOD *>Ugly way of reducing previous inputs IF PREV IS EQUAL TO 'I' COMPUTE SUMM = SUMM - 2 END-IF IF PREV IS EQUAL TO 'X' COMPUTE SUMM = SUMM - 2 * 10 END-IF IF PREV IS EQUAL TO 'L' COMPUTE SUMM = SUMM - 2 * 50 END-IF IF PREV IS EQUAL TO 'C' COMPUTE SUMM = SUMM - 2 * 100 END-IF ELSE IF IN-LINE(I:1) IS EQUAL TO 'D' COMPUTE SUMM = SUMM + 500 MOVE 1 TO GOOD IF PREV IS EQUAL TO 'X' COMPUTE SUMM = SUMM - 2 * 10 END-IF IF PREV IS EQUAL TO 'L' COMPUTE SUMM = SUMM - 2 * 50 END-IF IF PREV IS EQUAL TO 'C' COMPUTE SUMM = SUMM - 2 * 100 END-IF ELSE IF IN-LINE(I:1) IS EQUAL TO 'C' COMPUTE SUMM = SUMM + 100 MOVE 1 TO GOOD IF PREV IS EQUAL TO 'I' COMPUTE SUMM = SUMM - 2 END-IF IF PREV IS EQUAL TO 'X' COMPUTE SUMM = SUMM - 2 * 10 END-IF IF PREV IS EQUAL TO 'L' COMPUTE SUMM = SUMM - 2 * 50 END-IF ELSE IF IN-LINE(I:1) IS EQUAL TO 'L' COMPUTE SUMM = SUMM + 50 MOVE 1 TO GOOD IF PREV IS EQUAL TO 'I' COMPUTE SUMM = SUMM - 2 END-IF IF PREV IS EQUAL TO 'X' COMPUTE SUMM = SUMM - 2 * 10 END-IF ELSE IF IN-LINE(I:1) IS EQUAL TO 'X' COMPUTE SUMM = SUMM + 10 MOVE 1 TO GOOD IF PREV IS EQUAL TO 'I' COMPUTE SUMM = SUMM - 2 END-IF ELSE IF IN-LINE(I:1) IS EQUAL TO 'V' COMPUTE SUMM = SUMM + 5 MOVE 1 TO GOOD IF PREV IS EQUAL TO 'I' COMPUTE SUMM = SUMM - 2 END-IF ELSE IF IN-LINE(I:1) IS EQUAL TO 'I' COMPUTE SUMM = SUMM + 1 MOVE 1 TO GOOD ELSE *>IF an invalid roman numeral is detected show an error and terminate loop IF GOOD IS EQUAL TO 0 AND IN-LINE IS NOT EQUAL TO "Q" DISPLAY "NOT VALID!" MOVE 0 TO GOOD MOVE 0 TO SUMM EXIT PERFORM END-IF END-IF END-IF END-IF END-IF END-IF END-IF END-IF END-PERFORM *>Only output the sum if the roman numerals are all valid IF GOOD IS EQUAL TO 1 MOVE SUMM TO FORMATTED-INTEGER DISPLAY In-Line FORMATTED-INTEGER END-IF. <|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. DIAMOND. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 Char-Value. 05 Numeric-Value USAGE BINARY-CHAR. 01 Curr-Char-Value VALUE 'A'. 05 Curr-Numeric-Value USAGE BINARY-CHAR. 01 Counter PIC 99. 01 DiamondSize PIC 99. 01 TempSize PIC 99. 01 NumberOfSpaces PIC 99. PROCEDURE DIVISION. DISPLAY "Enter capital letter:" ACCEPT Char-Value PERFORM Calculate-Diamond-Size COMPUTE Counter = DiamondSize - 1 * Print the first 'A' Row PERFORM PRINT-HEAD-COLUMN * Print all rows until the middle one PERFORM Counter TIMES Add 1 to Curr-Numeric-Value PERFORM PRINT-MIDDLE-COLUMN END-PERFORM * Print the middle row Add 1 to Curr-Numeric-Value PERFORM PRINT-MIDDLE-COLUMN * Print all rows until the final row PERFORM Counter TIMES Add -1 to Curr-Numeric-Value PERFORM PRINT-MIDDLE-COLUMN END
COBOL
-PERFORM * Print the final 'A' row Add -1 to Curr-Numeric-Value PERFORM PRINT-HEAD-COLUMN GOBACK. PRINT-HEAD-COLUMN Section. PERFORM Calculate-Spaces-Before Perform Print-Spaces DISPLAY "A" WITH NO ADVANCING Perform Print-Spaces DISPLAY " " Exit. PRINT-MIDDLE-COLUMN Section. PERFORM Calculate-Spaces-Before Perform Print-Spaces DISPLAY Curr-Char-Value WITH NO ADVANCING PERFORM Calculate-Spaces-Within Perform Print-Spaces DISPLAY Curr-Char-Value WITH NO ADVANCING PERFORM Calculate-Spaces-Before Perform Print-Spaces DISPLAY " " Exit. Calculate-Diamond-Size SECTION. * Calculating the Dimanond Size (A=65). COMPUTE DiamondSize = Numeric-Value - 65. EXIT. Calculate-Spaces-Within SECTION. PERFORM Calculate-Spaces-Before COMPUTE NumberOfSpaces = (2 * (DiamondSize - (NumberOfSpaces + 1))) + 1 . EXIT. Calculate-Spaces-Before SECTION. COMPUTE NumberOfSpaces = Numeric-Value - Curr-Numeric-Value . EXIT. Print-Spaces SECTION. PERFORM NumberOfSpaces TIMES DISPLAY " " WITH NO ADVANCING END-PERFORM EXIT. END PROGRAM DIAMOND. <|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. KBG430. ***************************************************** * PROGRAM : •”–εή—Ώ•Κ@Žd“ό–ΎΧ•\ * * PRINTER TYPE : JIPS * * SCREEN : ****** * * COMPILE TYPE : COBOL * ***************************************************** ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. SYSTEM3100. OBJECT-COMPUTER. SYSTEM3100. DATA DIVISION. WORKING-STORAGE SECTION. 77 ERR-STAT PIC X(002). 77 WK0128ID PIC X(009) VALUE SPACE. 01 STN-NO. 02 STN-NO1 PIC X(003). 02 STN-NO2 PIC X(003). 01 W-FID. 02 W-FID1 PIC X(006) VALUE "WK0128". 02 W-FID2 PIC X(003). 01 HEAD1. 02 W-20K PIC X(005) VALUE X"1A24212474". 02 F PIC X(026) VALUE SPACE. 02 F PIC N(021) VALUE "–––@@•”–εή—Ώ•Κ@Žd“ό–ΎΧ•\@@–––". 02 F PIC X(012) VALUE SPACE. 02 F PIC X(005) VALUE "DATE ". 02 H-DATE PIC 99B99B99. 02 F PIC X(007) VALUE " P.". 02 H-PAGE PIC Z9. 01 HEAD2. 02 W-15K PIC X(005) VALUE X"1A24212078". 02 F PIC X(003) VALUE SPACE. 02 F PIC N(006) VALUE "•”@–ε@–Ό@". 02 F PIC X(007) VALUE SPACE. 02 F PIC N(002) VALUE "“`‹ζ". 02 F PIC X(002) VALUE SPACE. 02 F PIC X(006) VALUE "Ί°Δή ". 02 F PIC N(008) VALUE "ή@@—Ώ@@–Ό@". 02 F PIC X(031) VALUE SPACE. 02 F PIC N(004) VALUE "”@@—Κ". 02 F PIC X(005) VALUE SPACE. 02 F PIC N(004) VALUE "’P@@‰Ώ". 02 F PIC X(006) VALUE SPACE. 02 F PIC N(004) VALUE "‹ΰ@@Šz". 01 W-P. 02 P-BKC PIC 9(002). 02 F PIC X(001). 02 P-BMN PIC N(010). 02 F PIC X(002). 02 P-DC PIC 9(002). 02 F PIC X(001). 02 P-JCD PIC 9(006). 02 F PIC X(001). 02 P-JNA PIC N(024). 02 P-SU PIC --,---,--9.99. 02 P-T PIC ----,--9.99. 02 P-KIN PIC ----,---,--9. 01 W-DATA. 02 W-PAGE PIC 9(002). 02 W-SBKC PIC 9(002). 02 W-EBKC PIC 9(002). 02 W-DMM PIC 9(001). 02 CHK. 03 CHK1 PIC 9(001). 03 CHK2 PIC 9(001). 02 W-BKC PIC 9(002). 02 W-DC PIC 9(002). 02 W-JCD1 PIC 9(001). 02 W-JCD PIC 9(006). 02 W-D. 03 W-SU PIC S9(007)V9(02). 03 W-T PIC S9(006)V9(02). 03 W-KIN PIC S9(009). 02 WN-KIN PIC S9(009). 02 WT-KIN PIC S9(009). 02 WS-KIN PIC S9(009). 02 WA-KIN PIC S9(009). 02 CNT PIC 9(005). COPY LSTAT. * COPY LIBFDD. COPY LIJM. COPY BUMONF. COPY LSJSSW. COPY LSPF. * 77 ESTAT PIC X(002). 77 RESU PIC 9(001). 77 RESP PIC 9(001). 77 RET PIC 9(001) VALUE ZERO. 77 LINAGECOUNTER PIC 9(003). 77 USER_ID PIC X(006) VALUE SPACE. 77 COMPLETION_CODE PIC X(003) VALUE ZERO. * 01 C-CLEAR. 02 C-CL PIC X(012) VALUE "CLEAR SCREEN". 01 C-MID. 02 FILLER PIC N(021) VALUE "–––––––––––––––––––––". 02 FILLER PIC N(021) VALUE "–––––––––––––––––––––". 02 FILLER PIC N(021) VALUE "–––@@@@@@@@@@@@@@@–––". 02 FILLER PIC N(021) VALUE "–––@@•”–εή—Ώ•Κ@Žd“ό–ΎΧ•\@@–––". 02 FILLER PIC N(021) VALUE "–––@@@@@@@@@@@@@@@–––". 02 FILLER PIC N(021) VALUE "–––––––––––––––––––––". 02 FILLER PIC N(021) VALUE "–
COBOL
––––––––––––––––––––". 02 FILLER PIC X(018) VALUE "•”–εΊ°Δή 00 ` 99". 02 FILLER PIC X(022) VALUE "Šm”F OK=1 NO=9 Ψΐ°έ". 01 C-ACP. 02 FILLER. 03 A-SBKC PIC 9(002). 03 A-EBKC PIC 9(002). 02 A-DMM PIC 9(001). 01 C-ERR. 02 FILLER. 03 E-ME1 PIC X(017) VALUE "*** DATA ΕΌ ***". 03 E-ME98 PIC X(005) VALUE X"1B4A05". 03 E-ME99 PIC X(005) VALUE X"1B4205". COPY LIBSCR. PROCEDURE DIVISION. *Initialize CALL "SD_Initialize" RETURNING RESU. CALL "PR_Initialize" USING "999" RETURNING RESP. CALL "DB_Initialize" USING BY REFERENCE ERR-STAT RETURNING RET. CALL "DB_Open". *C-CLEAR CALL "SD_Init" USING "C-CLEAR" " " "0" "0" "12" " " " " RETURNING RESU. CALL "SD_Init" USING "C-CL" "X" "1" "0" "12" " " "C-CLEAR" RETURNING RESU. *C-MID CALL "SD_Init" USING "C-MID" " " "0" "0" "334" " " " " RETURNING RESU. CALL "SD_Init" USING "01C-MID" "N" "3" "10" "42" " " "C-MID" RETURNING RESU. CALL "SD_Init" USING "02C-MID" "N" "4" "10" "42" "01C-MID" " " RETURNING RESU. CALL "SD_Init" USING "03C-MID" "N" "5" "10" "42" "02C-MID" " " RETURNING RESU. CALL "SD_Init" USING "04C-MID" "N" "6" "10" "42" "03C-MID" " " RETURNING RESU. CALL "SD_Init" USING "05C-MID" "N" "7" "10" "42" "04C-MID" " " RETURNING RESU. CALL "SD_Init" USING "06C-MID" "N" "8" "10" "42" "05C-MID" " " RETURNING RESU. CALL "SD_Init" USING "07C-MID" "N" "9" "10" "42" "06C-MID" " " RETURNING RESU. CALL "SD_Init" USING "08C-MID" "X" "14" "22" "18" "07C-MID" " " RETURNING RESU. CALL "SD_Init" USING "09C-MID" "X" "20" "40" "22" "08C-MID" " " RETURNING RESU. *C-ACP CALL "SD_Init" USING "C-ACP" " " "0" "0" "5" " " " " RETURNING RESU. CALL "SD_Init" USING "01C-ACP" " " "14" "0" "4" " " "C-ACP" RETURNING RESU. CALL "SD_Init" USING "A-SBKC" "9" "14" "32" "2" " " "01C-ACP" RETURNING RESU. CALL "SD_Using" USING "A-SBKC" BY REFERENCE W-SBKC "2" "0" RETURNING RESU. CALL "SD_Init" USING "A-EBKC" "9" "14" "38" "2" "A-SBKC" " " RETURNING RESU. CALL "SD_Using" USING "A-EBKC" BY REFERENCE W-EBKC "2" "0" RETURNING RESU. CALL "SD_Init" USING "A-DMM" "9" "20" "57" "1" "01C-ACP" " " RETURNING RESU. CALL "SD_Using" USING "A-DMM" BY REFERENCE W-DMM "1" "0" RETURNING RESU. *C-ERR CALL "SD_Init" USING "C-ERR" " " "0" "0" "27" " " " " RETURNING RESU. CALL "SD_Init" USING "01C-ERR" " " "24" "0" "27" " " "C-ERR" RETURNING RESU. CALL "SD_Init" USING "E-ME1" "X" "24" "15" "17" " " "01C-ERR" RETURNING RESU. CALL "SD_Init" USING "E-ME98" "X" "24" "75" "5" "E-ME1" " " RETURNING RESU. CALL "SD_Init" USING "E-ME99" "X" "24" "75" "5" "E-ME98" " " RETURNING RESU. * COPY LIBSCR_P. * ACCEPT USER_ID FROM ARGUMENT-VALUE. ACCEPT COMPLETION_CODE FROM ARGUMENT-VALUE. * M-05. CALL "SD_Output" USING "C-CLEAR" C-CLEAR "p" RETURNING RESU. CALL "SD_Output" USING "C-MID" C-MID "p" RETURNING RESU. MOVE ZERO TO W-DATA. MOVE 99 TO W-EBKC. M-10. CALL "SD_Accept" USING BY REFERENCE A-SBKC "A-SBKC" "9" "2" BY REFERENCE ESTAT RETURNING RESU. IF ESTAT = PF9 GO TO M-95 END-IF IF ESTAT NOT = HTB AND SKP GO TO M-10 END-IF. M-15. CALL "SD_Accept" USING BY REFERENCE A-EBKC "A-EBKC" "9" "2" BY REFERENCE ESTAT RETURNING RESU. IF ESTAT = BTB GO TO M-10 END-IF IF ESTAT NOT = HTB AND SKP GO TO M-15 END-IF IF W-SBKC > W-EBKC GO TO M-15 END-IF. M-20. CALL "SD_Accept" USING BY REFERENCE A-DMM "A-DMM" "9" "1" BY REFERENCE ESTAT RETURNING RESU. IF ESTAT = BTB GO TO M-15 END-IF IF ESTAT NOT = HTB AND SKP GO TO M-20 END-IF IF W-DMM = 9 GO TO M-10 END-IF IF W-DMM NOT = 1 GO TO M-20 END-IF * CALL "CBLSTNNO" USING STN-NO USER_ID. MOVE STN-NO2 TO W-FID2. MOVE W-FID TO WK0128ID. MOVE WK0128ID TO JSSR-F_PNAME1. CALL "DB_F_Open" USING "INPUT" JSSR-F_PNAME1 " " BY REFERENCE JSSR-F_IDLST "0". M-25. * READ JSSR-F AT END *////////////////////// CALL "DB_Read" USING "AT END" JSSR-F_PNAME1 BY REFERENCE JSSR-R " " RETURNING RET. IF RET = 1 CALL "DB_F_Close" USING BY REFERENCE JSSR-F_IDLST JSSR-F_PNAME1 CALL "SD_Output" USING "E-ME1" E-ME1 "p" RETURNING RESU CALL "SD_Output" USING "E-ME99" E-ME99 "p" RETURNING RESU GO TO M-95 END-IF IF JR-BKC > W-EBKC CALL "DB_F_Close" USING BY REFERENCE JSSR-F_IDLST JSSR-F_PNAME1 CALL "SD_Output" USING "E-ME1
COBOL
" E-ME1 "p" RETURNING RESU CALL "SD_Output" USING "E-ME99" E-ME99 "p" RETURNING RESU GO TO M-95 END-IF IF JR-BKC = ZERO GO TO M-25 END-IF IF JR-BKC < W-SBKC GO TO M-25 END-IF IF JR-DC = 30 GO TO M-25 END-IF IF JR-JCD2 > 89 GO TO M-25 END-IF * COPY LIBCPR. MOVE DATE-05R TO H-DATE. CALL "DB_F_Open" USING "INPUT" J-M_PNAME1 "SHARED" BY REFERENCE J-M_IDLST "1" "J-KEY" BY REFERENCE J-KEY. CALL "DB_F_Open" USING "INPUT" BNM_PNAME1 "SHARED" BY REFERENCE BNM_IDLST "1" "BNM-KEY" BY REFERENCE BNM-KEY. CALL "PR_Open" RETURNING RESP. PERFORM S-10 THRU S-15. MOVE ZERO TO WA-KIN. M-30. MOVE ZERO TO WS-KIN CHK. MOVE JR-BKC TO W-BKC. MOVE ZERO TO BNM-KEY. MOVE W-BKC TO BNM-BU. * READ BNM WITH UNLOCK INVALID KEY */////////////// CALL "DB_Read" USING "INVALID KEY" BNM_PNAME1 BY REFERENCE BNM-REC "UNLOCK" RETURNING RET. IF RET = 1 MOVE SPACE TO BNMNMN END-IF. M-35. MOVE ZERO TO WT-KIN CHK2. MOVE JR-DC TO W-DC. M-37. MOVE ZERO TO WN-KIN. MOVE JR-JCD1 TO W-JCD1. M-40. MOVE ZERO TO W-D. MOVE JR-JCD TO W-JCD. MOVE W-JCD TO J-KEY. * READ J-M WITH UNLOCK INVALID KEY */////////////// CALL "DB_Read" USING "INVALID KEY" J-M_PNAME1 BY REFERENCE J-R "UNLOCK" RETURNING RET. IF RET = 1 MOVE SPACE TO J-NAME MOVE "@–@ή—Ώ‚Θ‚΅@–" TO J-NAME END-IF. M-45. IF JR-DC2 NOT = 2 AND 3 ADD JR-SU TO W-SU END-IF ADD JR-KIN TO W-KIN. M-50. * READ JSSR-F AT END *////////////////////// CALL "DB_Read" USING "AT END" JSSR-F_PNAME1 BY REFERENCE JSSR-R " " RETURNING RET. IF RET = 1 GO TO M-65 END-IF IF JR-BKC > W-EBKC GO TO M-65 END-IF IF JR-BKC = ZERO GO TO M-50 END-IF IF JR-DC = 30 GO TO M-50 END-IF IF JR-JCD2 > 89 GO TO M-50 END-IF IF JR-BKC NOT = W-BKC GO TO M-60 END-IF IF JR-DC NOT = W-DC GO TO M-55 END-IF IF JR-JCD1 NOT = W-JCD1 GO TO M-52 END-IF IF JR-JCD = W-JCD GO TO M-45 END-IF PERFORM S-20 THRU S-25. GO TO M-40. M-52. PERFORM S-20 THRU S-25. PERFORM S-26 THRU S-27. GO TO M-37. M-55. PERFORM S-20 THRU S-25. PERFORM S-26 THRU S-27. PERFORM S-30 THRU S-40. GO TO M-35. M-60. PERFORM S-20 THRU S-25. PERFORM S-26 THRU S-27. PERFORM S-30 THRU S-40. PERFORM S-45 THRU S-50. GO TO M-30. M-65. PERFORM S-20 THRU S-25. PERFORM S-26 THRU S-27. PERFORM S-30 THRU S-40. PERFORM S-45 THRU S-50. PERFORM S-55 THRU S-60. M-90. CALL "PR_Close" RETURNING RESP. CALL "DB_F_Close" USING BY REFERENCE J-M_IDLST J-M_PNAME1. CALL "DB_F_Close" USING BY REFERENCE JSSR-F_IDLST JSSR-F_PNAME1. CALL "DB_F_Close" USING BY REFERENCE BNM_IDLST BNM_PNAME1. M-95. CALL "SD_Output" USING "C-CLEAR" C-CLEAR "p" RETURNING RESU. CALL "DB_Close". STOP RUN. S-05. MOVE SPACE TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. CALL "PR_NewPage" RETURNING RESP. S-10. ADD 1 TO W-PAGE. MOVE W-PAGE TO H-PAGE. MOVE SPACE TO SP-R. MOVE HEAD1 TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. MOVE SPACE TO SP-R. MOVE HEAD2 TO SP-R. CALL "PR_LineFeed" USING "2" RETURNING RESP. CALL "PR_Write" USING SP-R RETURNING RESP. MOVE SPACE TO SP-R. S-15. EXIT. S-20. IF ZERO = W-SU AND W-T AND W-KIN GO TO S-25 END-IF IF W-KIN NOT = ZERO IF W-SU NOT = ZERO COMPUTE W-T ROUNDED = W-KIN / W-SU END-IF END-IF * MOVE SPACE TO W-P. MOVE SPACE TO P-BMN P-JNA. IF CHK1 = 0 MOVE 1 TO CHK1 MOVE W-BKC TO P-BKC MOVE BNMNMN TO P-BMN END-IF IF CHK2 = 0 MOVE 1 TO CHK2 MOVE W-DC TO P-DC END-IF MOVE W-JCD TO P-JCD. MOVE J-NAME TO P-JNA. MOVE W-SU TO P-SU. MOVE W-T TO P-T. MOVE W-KIN TO P-KIN. CALL "PR_Get_Linage" RETURNING LINAGECOUNTER. IF LINAGECOUNTER > 60 MOVE W-BKC TO P-BKC MOVE BNMNMN TO P-BMN PERFORM S-05 THRU S-15 END-IF MOVE SPACE TO SP-R. MOVE W-P TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. MOVE SPACE TO SP-R. ADD W-KIN TO WN-KIN. ADD 1 TO CNT. S-25. EXIT. S-26. MOVE SPACE TO W-P. MOVE SPACE TO P-BMN P-JNA. MOVE "@@@@@@@@@@@@@@@o@Œv@p" TO P-JNA. MOVE WN-KIN TO P-KIN. CALL "PR_Get_Linage" RETURNING LINAGECOUNTER. IF LINAGECOUNTER > 60 MOVE W-BKC TO P-BKC MOVE BNMNMN TO P-BMN MOVE W-DC TO P-DC PERFORM S-05 THRU S-15 END-IF MOVE SPACE TO SP-R. MOVE W-P TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. MOVE SPACE TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. ADD WN-KIN TO WT-KIN. S-27. EXIT. S-30. MOVE SPACE TO W-P. MOVE SPACE TO P-BMN P-JNA. MOVE "@@@@@@@@@@@i@¬Œv@j@" TO P-JNA. MOVE WT-KIN TO P-KIN. CALL "PR_Get_Linage" RETURNING LINAGECOUNTER. IF LINAGECOUNTER > 60 MOVE W-BKC TO P-BKC MOVE BNMNMN TO
COBOL
P-BMN MOVE W-DC TO P-DC PERFORM S-05 THRU S-15 END-IF MOVE SPACE TO SP-R. MOVE W-P TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. MOVE SPACE TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. ADD WT-KIN TO WS-KIN. S-40. EXIT. S-45. MOVE SPACE TO W-P. MOVE SPACE TO P-BMN P-JNA. MOVE "@@@@@@m@‡@Œv@n@" TO P-JNA. MOVE WS-KIN TO P-KIN. CALL "PR_Get_Linage" RETURNING LINAGECOUNTER. IF LINAGECOUNTER > 60 MOVE W-BKC TO P-BKC MOVE BNMNMN TO P-BMN PERFORM S-05 THRU S-15 END-IF MOVE SPACE TO SP-R. MOVE W-P TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. MOVE SPACE TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. ADD WS-KIN TO WA-KIN. S-50. EXIT. S-55. MOVE SPACE TO W-P. MOVE SPACE TO P-BMN P-JNA. MOVE "@y@@‘@‡@Œv@@z@" TO P-JNA. MOVE WA-KIN TO P-KIN. CALL "PR_Get_Linage" RETURNING LINAGECOUNTER. IF LINAGECOUNTER > 60 PERFORM S-05 THRU S-15 END-IF MOVE SPACE TO SP-R. MOVE W-P TO SP-R. CALL "PR_Write" USING SP-R RETURNING RESP. MOVE SPACE TO SP-R. S-60. EXIT. <|end_of_text|> ******************************************************************* * Project code name "ORCA" * 日医標準レセプトソフト(JMA standard receipt software) * Copyright(C) 2002 JMA (Japan Medical Association) * * This program is part of "JMA standard receipt software". * * This program is distributed in the hope that it will be useful * for further advancement in medical care, according to JMA Open * Source License, but WITHOUT ANY WARRANTY. * Everyone is granted permission to use, copy, modify and * redistribute this program, but only under the conditions described * in the JMA Open Source License. You should have received a copy of * this license along with this program. If not, stop using this * program and contact JMA, 2-28-16 Honkomagome, Bunkyo-ku, Tokyo, * 113-8621, Japan. ******************************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. ORCGP029. ***************************************************************** * システム名 : ORCA * サブシステム名 : 患者登録 * コンポーネント名 : 患者番号登録処理 * 管理者 : * 作成日付 作業者 記述 * 00/12/01 MCC-太田 新規作成 ***************************************************************** * プログラム修正履歴 * Maj/Min/Rev 修正者 日付 内容 * 01.00.01 MCC-太田 01/04/13 帳票出力時パラメータ誤り * 01.00.02 MCC-太田 01/05/24 パラメタの変更 * 01.00.03 MCC-多々納 01/06/13 登録後、診療行為遷移を追加 * 01.00.04 MCC-多々納 02/04/05 労災保険の追加 * 01.00.05 MCC-多々納 02/06/18 月代り受給者番号の追加 * 02.00.00 MCC-多々納 02/06/25 患者情報・旧姓履歴・患者番号 * をパラメタからSPAで更新へ * 02.00.01 NACL-多々納 02/07/31 パラメタファイルをDBへ * 02.00.02 NACL-多々納 03/03/24 公費負担額追加 * 02.00.03 NACL-多々納 03/04/22 保険組合変更時メッセージ追加 * 02.00.04 NACL-多々納 03/06/27 カスタマイズ帳票名取得サブ追加 * 02.00.05 NACL-多々納 05/11/11 MONFUNC 対応 他 * 02.00.06 NACL-多々納 06/02/27 主科対応 * 03.04.00 NACL-藤原 07/02/06 月途中の受給者番号変更に対応 * 03.04.01 NACL-多々納 07/02/16 QRデータ対応 * 03.05.00 NACL-多々納 07/05/XX グループ診療対応 * 03.05.01 NACL-多々納 07/06/11 氏名変更の予約・受付対応 * 04.03.00 NACL-多々納 08/07/22 特記事項追加 * 04.05.00 NACL-多々納 09/07/XX 患者公費負担額機能追加 * 04.07.00 NACL-多々納 11/08/XX 患者保険確認履歴追加 * 04.07.00 NACL-多々納 12/01/12 印刷処理移動 * 04.07.00 NACL-多々納 12/11/22 患者地域連携追加 * 04.07.00 NACL-多々納 12/12/21 レセプト分割対応 * 04.07.00 NACL-多々納 14/02/XX 患者介護情報追加対応 * 04.07.00 NACL-多々納 14/03/XX 地域包括診療対象疾病対応 * 04.08.00 NACL-多々納 15/11/XX APIV3(HAORI)対応 * 04.08.00 NACL-多々納 16/03/XX 平成28年4月改正対応 * 05.00.00 NACL-多々納 16/12/15 患者個人番号対応 * 05.00.00 NACL-多々納 19/06/XX 難病等+生保保険組合せ作成対応 ***************************************************************** * ENVIRONMENT DIVISION. CONFIGURATION SECTION. INPUT-OUTPUT SECTION. FILE-CONTROL. * DATA DIVISION. *FILE SECTION. * WORKING-STORAGE SECTION. * * スパ領域 COPY "COMMON-SPA". * 患者登録スパ領域 COPY "P02COMMON-SPA". * 患者登録全画面スパ領域 COPY "P02SCR-SPA". * * フラグ領域 01 FLG-AREA. 03 FLG-END PIC 9(01). 03 FLG-PARA PIC 9(01). 03 FLG-PTINF PIC 9(01). 03 FLG-PTHKNINF PIC 9(01). 03 FLG-PTKOHINF PIC 9(01). 03 FLG-UKETUKE PIC 9(01). 03 FLG-HKNCOMBI PIC 9(01). 03 FLG-KYUSEIRRK PIC 9(01). 03 FLG-KNJSAI PIC 9(01). 03 FLG-PTNUM PIC 9(01). 03 FLG-YY
COBOL
K PIC 9(01). 03 FLG-TSYRRK PIC 9(01). 03 FLG-TNKRRK PIC 9(01). 03 FLG-SYSKANRI PIC 9(01). 03 FLG-PTRSIINF PIC 9(01). 03 FLG-MONTHLYNUM PIC 9(01). 03 FLG-PTKOHFTN PIC 9(01). 03 FLG-JYURRK PIC 9(01). 03 FLG-PTTOKKI PIC 9(01). 03 FLG-PTBYOMEI PIC 9(01). 03 FLG-QRCDHKN PIC 9(01). 03 FLG-PTSAME PIC 9(01). 03 FLG-PTKOHFTNETC PIC 9(01). 03 FLG-PTPUBLIC PIC 9(01). 03 FLG-PTHDISTDAY PIC 9(01). 03 FLG-PTCONF PIC 9(01). 03 FLG-PTCARE-HKNINF PIC 9(01). 03 FLG-PTCARE-NINTEI PIC 9(01). 03 FLG-PTMYNUMBER PIC 9(01). * 03 FLG-SYORI PIC X(01). 03 FLG-SYORI2 PIC X(01). 03 FLG-TSYRRK2 PIC X(01). 03 FLG-TNKRRK2 PIC X(01). 03 FLG-KYUSEIRRK2 PIC 9(01). * 03 FLG-OK PIC 9(01). * * カウント領域 01 CNT-AREA. 03 CNT-ERR PIC 9(06). * * システム領域 01 SYS-AREA. 03 SYS-YMD. 05 SYS-YY PIC 9(02). 05 SYS-MM PIC 9(02). 05 SYS-DD PIC 9(02). 03 SYS-TIME. 05 SYS-THH PIC 9(02). 05 SYS-TMM PIC 9(02). 05 SYS-TSS PIC 9(02). 05 SYS-TDD PIC 9(02). * * 添字領域 01 IDX-AREA. 03 IDX PIC 9(04). 03 IDX2 PIC 9(04). 03 IDX5 PIC 9(04). 03 IDH1 PIC 9(02). * 03 IDH2 PIC 9(02). 03 IDH3 PIC 9(02). * * 一時領域 01 WRK-AREA. 03 WRK-SYSYMD. 05 WRK-SYSYY PIC 9(04). 05 WRK-SYSMM PIC 9(02). 05 WRK-SYSDD PIC 9(02). * 03 WRK-WSYSYMD. 05 WRK-WGO PIC X(01). 05 WRK-WYY PIC 9(02). 05 WRK-WMM PIC 9(02). 05 WRK-WDD PIC 9(02). 03 WRK-SYMD. 05 WRK-SYY PIC 9(04). 05 WRK-SMM PIC 9(02). 05 WRK-SDD PIC 9(02). * 03 WRK-ERRCD PIC X(04). 03 WRK-PIDCD PIC X(04). * 03 WRK-UKEID PIC 9(05). 03 WRK-HKN-CNT PIC 9(04). 03 WRK-KOH-CNT PIC 9(04). * 03 WRK-MCP-TABLE PIC X(64). 03 WRK-MCP-PATHNAME PIC X(64). * 03 WRK-CREYMD PIC X(08). * 03 WRK-PTSAME-CNT PIC 9(02). * * 患者個別設定 設定KEY 03 WRK-CONF-CKEY PIC X(25). * 設定データ 03 WRK-CONF-CDATA PIC X(10). * * カルテPG名 * 03 WRK-KARUTE-PG PIC X(20). * 処方せんPG名 * 03 WRK-SYOHOU-PG PIC X(20). * 01 WRK-HENSYU-AREA. 03 WRK-HENYMD. 05 WRK-HGO PIC X(01). 05 WRK-HYY PIC Z9. 05 FILLER PIC X(01) VALUE ".". 05 WRK-HMM PIC Z9. 05 FILLER PIC X(01) VALUE ".". 05 WRK-HDD PIC Z9. * 03 WRK-HENTIME. 05 WRK-THH PIC 99. 05 FILLER PIC X(01) VALUE ":". 05 WRK-TMM PIC 99. * *公費一部負担件数 01 MAX-KOHFTN PIC 9(03) VALUE 300. * * ***************************************************************** * ファイルレイアウト ***************************************************************** * * システム管理マスタ COPY "CPSYSKANRI.INC". * 患者番号構成管理マスタ COPY "CPSK1009.INC". *  (帳票プログラム) * COPY "CPSK1032.INC". * * 患者マスタ 01 PTINF-REC. COPY "CPPTINF.INC". * * 保険マスタ 01 PTHKNINF-REC. COPY "CPPTHKNINF.INC". * * 公費マスタ 01 PTKOHINF-REC. COPY "CPPTKOHINF.INC". * * 受診内容 01 UKETUKE-REC. COPY "CPUKETUKE.INC". * * 予約マスター 01 YYK-REC. COPY "CPYYK.INC". * * 保険組合せ 01 HKNCOMBI-REC. COPY "CPHKNCOMBI.INC". * * 旧姓履歴 01 KYUSEIRRK-REC. COPY "CPKYUSEIRRK.INC". * * 低所得 01 TSYRRK-REC. COPY "CPTSYRRK.INC". * * 年金 01 TNKRRK-REC. COPY "CPTNKRRK.INC". * * 患者番号変換(管理) 01 PTNUM-REC. COPY "CPPTNUM.INC". * * 患者労災保険情報 01 PTRSIINF-REC. COPY "CPPTRSIINF.INC". * * 月代り受給者番号 01 MONTHLYNUM-REC. COPY "CPMONTHLYNUM.INC". * * 患者公費負担 01 PTKOHFTN-REC. COPY "CPPTKOHFTN.INC". * * 患者特記事項マスタ 01 PTTOKKI-REC. COPY "CPPTTOKKI.INC". * * 患者レセプト分割テーブル 01 PT-HDIST-DAY-REC. COPY "CPPT-HDIST-DAY.INC". * * 患者公費負担額 01 PTKOHFTNETC-REC. COPY "CPPTKOHFTNETC.INC". * * QR
COBOL
コード(被保険者証) 01 QRCDHKN-REC. COPY "CPQRCDHKN.INC". * * パラメタテーブル 01 PARA-REC. COPY "CPPARA.INC". * * 受診履歴 01 JYURRK-REC. COPY "CPJYURRK.INC". * * 保険組合せ 01 HZN-HKNCOMBI-REC. COPY "CPHKNCOMBI.INC" REPLACING //COMB-// BY //HZN-COMB-//. * 保険マスタ 01 HZN-PTHKNINF-REC. COPY "CPPTHKNINF.INC" REPLACING //PTHKN-// BY //HZN-PTHKN-//. * 公費マスタ 01 HZN-PTKOHINF-REC. COPY "CPPTKOHINF.INC" REPLACING //PTKOH-// BY //HZN-PTKOH-//. * 低所得 01 HZN-TSYRRK-REC. COPY "CPTSYRRK.INC" REPLACING //TSYRRK-// BY //HZN-TSYRRK-//. * * 年金 01 HZN-TNKRRK-REC. COPY "CPTNKRRK.INC" REPLACING //TNKRRK-// BY //HZN-TNKRRK-//. * 患者労災保険情報 01 HZN-PTRSIINF-REC. COPY "CPPTRSIINF.INC" REPLACING //PTRSI-// BY //HZN-PTRSI-//. * * 患者病名 01 PTBYOMEI-REC. COPY "CPPTBYOMEI.INC". * * 同一患者識別テーブル 01 PTSAME-REC. COPY "CPPTSAME.INC". * * 同一患者識別テーブル 01 HZN-PTSAME-REC. COPY "CPPTSAME.INC" REPLACING //PTSAME-// BY //HZN-PTSAME-//. * * * 患者地域連携テーブル 01 PTPUBLIC-REC. COPY "CPPTNUM-PUBLIC.INC". * * * 患者個別設定テーブル 01 PTCONF-REC. COPY "CPPTCONF.INC". * * 患者介護保険情報テーブル 01 PTCARE-HKNINF-REC. COPY "CPPTCARE-HKNINF.INC". * * 患者介護認定者情報テーブル 01 PTCARE-NINTEI-REC. COPY "CPPTCARE-NINTEI.INC". *H28.12 * 患者個人番号テーブル 01 PTMYNUMBER-REC. COPY "CPPTMYNUMBER.INC". * ***************************************************************** * サブプロ用 領域 ***************************************************************** * * DB検索 COPY "MCPDATA.INC". * * オンライン帳票名・出力先プリンタ名取得パラ ** COPY "CPORCSPRTNM.INC". * * マシン日付取得サブ COPY "CPORCSMCNDATE.INC". * * レセプト作成管理マスタ更新サブ COPY "CPORCSRECEUPD.INC". * * 主情報アクセス用パラメタ 01 ORCSSYUACCAREA. COPY "CPORCSSYUACC.INC". * * 保険確認年月日履歴登録サブ COPY "CPORCSPTHKNRRK.INC". * ***************************************************************** * 連絡 領域 ***************************************************************** LINKAGE SECTION. * COPY "MCPAREA". COPY "ORCA-SPA". * PROCEDURE DIVISION USING MCPAREA SPAAREA . * ***************************************************************** * 主  処理 ***************************************************************** 000-PROC-SEC SECTION. * MOVE SPA-COMMON TO SPA-AREA MOVE SPA-WORK TO SPA-P02KYOUTU MOVE SPA-FREE TO SPA-P02SCRAREA * * 初期 処理 PERFORM 100-INIT-SEC * * 保険組合せ変更の期間外チェック IF (SPA-P02-SYORI NOT = 1 ) AND (SPA-KEI2-FLG = ZERO ) PERFORM 1001-HKNCOMBI-KIKANCHK-SEC MOVE 1 TO FLG-END END-IF *APIV3 チェックのみ IF SPA-P02-GAMEN = "APICHK" MOVE 1 TO FLG-END END-IF * IF FLG-END = ZERO IF SPA-P02-GAMEN = "API" * API更新処理 PERFORM 300-API-KOUSIN-SEC ELSE * * DB更新処理 PERFORM 200-MAIN-SEC END-IF END-IF * MOVE SPA-P02KYOUTU TO SPA-WORK MOVE SPA-AREA TO SPA-COMMON MOVE SPA-P02SCRAREA TO SPA-FREE * . EXIT PROGRAM . ***************************************************************** * 初期 処理 ***************************************************************** 100-INIT-SEC SECTION. * INITIALIZE FLG-AREA INITIALIZE CNT-AREA INITIALIZE WRK-AREA * * 更新日取得 INITIALIZE ORCSMCNDATEAREA CALL "ORCSMCNDATE" USING ORCSMCNDATEAREA * . 100-INIT-EXT. EXIT. * ***************************************************************** * 保険組合せ変更の期間外チェック処理 ***************************************************************** 1001-HKNCOMBI-KIKANCHK-SEC SECTION. * MOVE SPACE TO SPA-KEI-ERRCD MOVE SPACE TO WRK-PIDCD * パラメタファイルより INITIALIZE PARA-REC MOVE SPA-HOSPNUM TO PARA-HOSPNUM MOVE "P02" TO PARA-GYOUMUID MOVE SPA-TERMID TO PARA-TERMID MOVE "HKNCOMBI" TO PARA-FILEMEI * MOVE PARA-REC TO MCPDATA-REC MOVE "tbl_para" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_para" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME PERFORM 990-PARA-READ-SEC ELSE INITIALIZE PARA-REC MOVE 1 TO FLG-PARA END-IF PERFORM UNTIL (FLG-PARA = 1 ) OR (SPA-KEI-ERRCD NOT = SPACE ) MOVE PARA-DATA-REC TO HKNCOMBI-REC MOVE SPA-GMN-PTID TO COMB-PTID MOVE HKNCOMBI-REC TO MCPDATA-REC PERFORM 940-HKNCOMBI-READ-SEC * 保険変更による受診履歴修正の有無チェック IF FLG-HKNCOMBI = ZERO IF (HZN-COMB-TEKSTYMD NOT = COMB-TEKSTYMD) OR (HZN-COMB-TEKEDYMD NOT = COMB-TEKEDYMD) OR (HZN-COMB-DELKBN NOT = COMB-DELKBN ) PERFORM 2501-HKNCOMBI-CHK-SEC END-IF END-IF MOVE "tbl_para" TO MCP-TABLE
COBOL
MOVE "key5" TO MCP-PATHNAME PERFORM 990-PARA-READ-SEC END-PERFORM MOVE "tbl_para" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * MOVE 1 TO SPA-KEI2-FLG MOVE SPACE TO SPA-KEI-ERRCD IF WRK-PIDCD NOT = SPACE MOVE WRK-PIDCD TO SPA-PIDCD END-IF . 1001-HKNCOMBI-KIKANCHK-EXT. EXIT. ***************************************************************** * 主  処理 ***************************************************************** 200-MAIN-SEC SECTION. * * 患者番号情報更新 PERFORM 280-PTNUM-SYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 200-MAIN-EXT END-IF * * 患者情報更新 PERFORM 210-PTINF-SYORI-SEC *ver.4.7 * 患者地域連携情報更新 PERFORM 210-PTPUBLIC-SYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 200-MAIN-EXT END-IF *ver.4.7 * 患者個別設定情報更新 PERFORM 211-PTCONF-SYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 200-MAIN-EXT END-IF * * 旧姓履歴更新 PERFORM 260-KYUSEIRRK-SYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 200-MAIN-EXT END-IF * * 公費負担額 INITIALIZE PTKOHFTN-REC MOVE SPA-HOSPNUM TO PTKOHFTN-HOSPNUM MOVE SPA-GMN-PTID TO PTKOHFTN-PTID MOVE PTKOHFTN-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_ptkohftn" TO MCP-TABLE MOVE "del1" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * 患者レセプト分割テーブル削除 PERFORM 300-PTHDISTDAY-DELETE-SEC * * パラメタファイルより INITIALIZE PARA-REC MOVE "P02" TO PARA-GYOUMUID MOVE SPA-TERMID TO PARA-TERMID * MOVE SPA-HOSPNUM TO PARA-HOSPNUM MOVE PARA-REC TO MCPDATA-REC MOVE "tbl_para" TO MCP-TABLE MOVE "key3" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_para" TO MCP-TABLE MOVE "key3" TO MCP-PATHNAME PERFORM 990-PARA-READ-SEC ELSE INITIALIZE PARA-REC MOVE 1 TO FLG-PARA END-IF * PERFORM UNTIL (FLG-PARA = 1 ) OR (SPA-ERRCD NOT = SPACE ) EVALUATE PARA-FILEMEI WHEN "PTHKNINF" PERFORM 220-PTHKNINF-SYORI-SEC ADD 1 TO WRK-HKN-CNT WHEN "PTKOHINF" PERFORM 230-PTKOHINF-SYORI-SEC ADD 1 TO WRK-KOH-CNT WHEN "UKETUKE" PERFORM 240-UKETUKE-SYORI-SEC WHEN "HKNCOMBI" IF PARA-DATA-REC NOT = SPACE PERFORM 250-HKNCOMBI-SYORI-SEC ELSE CONTINUE END-IF ********** WHEN "KYUSEI" * PERFORM 260-KYUSEIRRK-SYORI-SEC * WHEN "PTNUM" ************* PERFORM 280-PTNUM-SYORI-SEC WHEN "TSYRRK" PERFORM 290-TSYRRK-SYORI-SEC WHEN "TNKRRK" PERFORM 291-TNKRRK-SYORI-SEC WHEN "PTRSIINF" * 患者労災保険情報 PERFORM 292-PTRSIINF-SYORI-SEC * WHEN "PTKOHFTN" * 公費負担情報更新 PERFORM 300-PTKOHFTN-SYORI-SEC *H24.12 WHEN "PTHDISTDAY" * 患者レセプト分割テーブル更新 PERFORM 300-PTHDISTDAY-SYORI-SEC END-EVALUATE * MOVE "tbl_para" TO MCP-TABLE MOVE "key3" TO MCP-PATHNAME PERFORM 990-PARA-READ-SEC END-PERFORM * MOVE "tbl_para" TO MCP-TABLE MOVE "key3" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * 患者公費負担額テーブル更新 IF SPA-ERRCD = SPACE PERFORM 3001-PTKOHFTNETC-SYORI-SEC END-IF * 特記事項テーブル更新 IF SPA-ERRCD = SPACE PERFORM 300-PTTOKKI-SYORI-SEC END-IF *ver.4.7 * 患者介護保険情報更新 IF SPA-ERRCD = SPACE PERFORM 2130-PTCARE-HKNINF-SYORI-SEC END-IF * 患者介護認定者情報更新 IF SPA-ERRCD = SPACE PERFORM 2140-PTCARE-NINTEI-SYORI-SEC END-IF *H28.12 * 患者個人番号情報更新 IF SPA-ERRCD = SPACE PERFORM 2150-MYNUMBER-SYORI-SEC END-IF * * レセプト作成管理マスタ更新 IF SPA-ERRCD = SPACE PERFORM 2009-RECEUPD-UPDATE-SEC END-IF * 主科情報設定 IF (SPA-ERRCD = SPACE ) AND (SPA-P02-SYORI = 1 ) AND (SPA-NAI-SYUKAYM NOT = SPACE ) PERFORM 2110-SYUKA-INSERT-SEC END-IF * 患者紐付(同一患者識別)設定 IF (SPA-ERRCD = SPACE ) AND (SPA-GRPHOSPKBN = 1 ) PERFORM 2110-PTSAME-SYORI-SEC END-IF * *** QR情報更新 * IF (SPA-ERRCD = SPACE ) AND * (SPA-QR-SYORI NOT = SPACE ) * PERFORM 2120-QRCDHKN-UPD-SEC **** END-IF * *ver.4.7 クライアント印刷対応の為、ORCGP02 へ移動 * カルテ/処方箋発行処理 ** PERFORM 2100-HC01-SYORI-SEC * IF WRK-ERRCD NOT = SPACE MOVE WRK-ERRCD TO SPA-ERRCD END-IF * . 200-MAIN-EXT. EXIT. * ***************************************************************** * レセプト作成管理マスタ更新
COBOL
処理 ***************************************************************** 2009-RECEUPD-UPDATE-SEC SECTION. * INITIALIZE ORCSRECEUPDAREA MOVE "1" TO LNK-UPD-SYORI MOVE SPA-HOSPNUM TO LNK-UPD-HOSPNUM MOVE SPA-GMN-PTID TO LNK-UPD-PTID MOVE SPA-TERMID TO LNK-UPD-TERMID MOVE SPA-OPID TO LNK-UPD-OPID CALL "ORCSRECEUPD" USING ORCSRECEUPDAREA SPA-AREA IF LNK-UPD-RC NOT = ZERO MOVE "9000" TO SPA-ERRCD DISPLAY "LNK-UPD-RC =>" LNK-UPD-RC END-IF * . 2009-RECEUPD-UPDATE-EXT. EXIT. ***************************************************************** * 患者マスター処理 ***************************************************************** 210-PTINF-SYORI-SEC SECTION. * * INITIALIZE PTINF-REC MOVE SPA-HOSPNUM TO PTINF-HOSPNUM MOVE SPA-GMN-PTID TO PTINF-PTID MOVE PTINF-REC TO MCPDATA-REC PERFORM 900-PTINF-READ-SEC * IF FLG-PTINF = 1 INITIALIZE PTINF-REC MOVE SPA-HOSPNUM TO PTINF-HOSPNUM MOVE SPA-GMN-PTID TO PTINF-PTID * 入力値編集 PERFORM 2101-PTINF-HENSYU-SEC * 作成年月日 MOVE SMCNDATE-YMD TO PTINF-CREYMD * 更新年月日 MOVE SMCNDATE-YMD TO PTINF-UPYMD MOVE SMCNDATE-HMS TO PTINF-UPHMS * MOVE SPA-OPID TO PTINF-OPID * MOVE PTINF-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTINF INS ERR:" MCP-RC ",KEY:" PTINF-KEY MOVE "9000" TO SPA-ERRCD END-IF ELSE MOVE MCPDATA-REC TO PTINF-REC * 入力値編集 PERFORM 2101-PTINF-HENSYU-SEC * 更新年月日 MOVE SMCNDATE-YMD TO PTINF-UPYMD MOVE SMCNDATE-HMS TO PTINF-UPHMS MOVE SPA-OPID TO PTINF-OPID * MOVE PTINF-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_ptinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTINF UPD ERR:" MCP-RC ",KEY:" PTINF-KEY MOVE "9000" TO SPA-ERRCD END-IF END-IF . 210-PTINF-SYORI-EXT. EXIT. ***************************************************************** * 患者情報編集処理 ***************************************************************** 2101-PTINF-HENSYU-SEC SECTION. * MOVE SPA-GMN-NAME TO PTINF-NAME MOVE SPA-GMN-KANANAME TO PTINF-KANANAME MOVE SPA-GMN-SEX TO PTINF-SEX IF SPA-NAI-BIRTHDAY = SPACE OR ZERO MOVE SPACE TO PTINF-BIRTHDAY ELSE MOVE SPA-NAI-BIRTHDAY TO PTINF-BIRTHDAY END-IF MOVE SPA-GMN-NICKNAME TO PTINF-NICKNAME MOVE SPA-GMN-DEATHKBN TO PTINF-DEATHKBN MOVE SPA-GMN-POST TO PTINF-HOME-POST MOVE SPA-GMN-EDITADRS-NAME TO PTINF-HOME-ADRS MOVE SPA-GMN-BANTI TO PTINF-HOME-BANTI MOVE SPA-GMN-TEL1 TO PTINF-HOME-TEL1 MOVE SPA-GMN-TEL2 TO PTINF-HOME-TEL2 MOVE SPA-GMN-SETAINUSI TO PTINF-SETAINUSI MOVE SPA-GMN-ZOKUGARA TO PTINF-ZOKUGARA MOVE SPA-GMN-DISCOUNTKBN TO PTINF-DISCOUNT-KBN MOVE SPA-GMN-DISCOUNT TO PTINF-DISCOUNT MOVE SPA-GMN-NYUKIN-HOHO TO PTINF-NYUKIN-HOHO MOVE SPA-GMN-SKYPRTFLG TO PTINF-SKYPRTFLG MOVE SPA-GMN-CONDITION(1) TO PTINF-CONDITION-1 MOVE SPA-GMN-CONDITION(2) TO PTINF-CONDITION-2 MOVE SPA-GMN-CONDITION(3) TO PTINF-CONDITION-3 MOVE SPA-GMN-COMMENT-1 TO PTINF-COMMENT-1 MOVE SPA-GMN-COMMENT-2 TO PTINF-COMMENT-2 MOVE SPA-GMN-TABOO-1 TO PTINF-TABOO-1 MOVE SPA-GMN-TABOO-2 TO PTINF-TABOO-2 MOVE SPA-GMN-ALLERGY-1 TO PTINF-ALLERGY-1 MOVE SPA-GMN-ALLERGY-2 TO PTINF-ALLERGY-2 MOVE SPA-GMN-KANSENSYO-1 TO PTINF-KANSENSYO-1 MOVE SPA-GMN-KANSENSYO-2 TO PTINF-KANSENSYO-2 * * テスト患者番号区分 MOVE SPA-GMN-TSTPTNUMKBN TO PTINF-TSTPTNUMKBN * * 連絡先 MOVE SPA-GMN21-FAX TO PTINF-FAX MOVE SPA-GMN21-KEITAI-TEL TO PTINF-KEITAI-TEL MOVE SPA-GMN21-EMAIL TO PTINF-EMAIL MOVE SPA-GMN21-JOB TO PTINF-JOB MOVE SPA-GMN21-RENRAKU-NAME TO PTINF-RENRAKU-NAME MOVE SPA-GMN21-RENRAKU-ZOKUGARA TO PTINF-RENRAKU-ZOKUGARA MOVE SPA-GMN21-RENRAKU-POST TO PTINF-RENRAKU-POST MOVE SPA-GMN21-RENRAKU-ADRS TO PTINF-RENRAKU-ADRS MOVE SPA-GMN21-RENRAKU-BANTI TO PTINF-RENRAKU-BANTI MOVE SPA-GMN21-RENRAKU-TEL1 TO PTINF-RENRAKU-TEL1 MOVE SPA-GMN21-RENRAKU-TEL2 TO PTINF-RENRAKU-TEL2 MOVE SPA-GMN21-OFFICE-NAME TO PTINF-OFFICE-NAME MOVE SPA-GMN21-OFFICE-POST TO PTINF-OFFICE-POST MOVE SPA-GMN21-OFFICE-ADRS TO PTINF-OFFICE-ADRS MOVE SPA-GMN21-OFFICE-BANTI TO PTINF-OFFICE-BANTI MOVE SPA-GMN21-OFFICE-TEL TO PTINF-OFFICE-TEL MOVE SPA-GMN21-KISEI-
COBOL
NAME TO PTINF-KISEI-NAME MOVE SPA-GMN21-KISEI-POST TO PTINF-KISEI-POST MOVE SPA-GMN21-KISEI-ADRS TO PTINF-KISEI-ADRS MOVE SPA-GMN21-KISEI-BANTI TO PTINF-KISEI-BANTI MOVE SPA-GMN21-KISEI-TEL TO PTINF-KISEI-TEL * * . 2101-PTINF-HENSYUI-EXT. EXIT. *ver.4.7 ***************************************************************** * 患者地域連携情報更新処理 ***************************************************************** 210-PTPUBLIC-SYORI-SEC SECTION. * INITIALIZE PTPUBLIC-REC MOVE SPA-HOSPNUM TO PTPUBLIC-HOSPNUM MOVE SPA-GMN-PTID TO PTPUBLIC-PTID MOVE PTPUBLIC-REC TO MCPDATA-REC PERFORM 900-PTPUBLIC-READ-SEC * IF FLG-PTPUBLIC = ZERO IF (SPA-GMN28-PATIENTID1 = SPACE ) AND (SPA-GMN28-AGREEMENT = SPACE ) * 地域連携IDが空白なら削除 MOVE PTPUBLIC-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_ptnum_public" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTPUBLIC DEL ERR:" MCP-RC ",KEY:" PTPUBLIC-KEY MOVE "9000" TO SPA-ERRCD END-IF ELSE * 更新 PERFORM 2101-PTPUBLIC-UPS-SEC END-IF ELSE IF (SPA-GMN28-PATIENTID1 = SPACE ) AND (SPA-GMN28-AGREEMENT = SPACE ) CONTINUE ELSE * 地域連携情ID・同意区分あれば登録 PERFORM 2101-PTPUBLIC-INS-SEC END-IF END-IF . 210-PTPUBLIC-SYORI-EXT. EXIT. ***************************************************************** * 患者地域連携データ登録処理 ***************************************************************** 2101-PTPUBLIC-INS-SEC SECTION. * INITIALIZE PTPUBLIC-REC MOVE SPA-HOSPNUM TO PTPUBLIC-HOSPNUM MOVE SPA-GMN-PTID TO PTPUBLIC-PTID * 入力値編集 MOVE SPA-GMN28-PATIENTID1 TO PTPUBLIC-PATIENT-ID1 MOVE SPA-GMN28-AGREEMENT TO PTPUBLIC-AGREEMENT * 作成年月日 MOVE SMCNDATE-YMD TO PTPUBLIC-CREYMD MOVE SMCNDATE-YMD TO PTPUBLIC-UPYMD MOVE SMCNDATE-HMS TO PTPUBLIC-UPHMS MOVE SPA-OPID TO PTPUBLIC-OPID * MOVE PTPUBLIC-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptnum_public" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTPUBLIC INS ERR:" MCP-RC ",KEY:" PTPUBLIC-KEY MOVE "9000" TO SPA-ERRCD END-IF . 2101-PTPUBLIC-INS-EXT. EXIT. ***************************************************************** * 患者地域連携データ更新処理 ***************************************************************** 2101-PTPUBLIC-UPS-SEC SECTION. * MOVE MCPDATA-REC TO PTPUBLIC-REC * 入力値編集 MOVE SPA-GMN28-PATIENTID1 TO PTPUBLIC-PATIENT-ID1 MOVE SPA-GMN28-AGREEMENT TO PTPUBLIC-AGREEMENT * 更新年月日 MOVE SMCNDATE-YMD TO PTPUBLIC-UPYMD MOVE SMCNDATE-HMS TO PTPUBLIC-UPHMS MOVE SPA-OPID TO PTPUBLIC-OPID * MOVE PTPUBLIC-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_ptnum_public" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTPUBLIC UPD ERR:" MCP-RC ",KEY:" PTPUBLIC-KEY MOVE "9000" TO SPA-ERRCD END-IF . 2101-PTPUBLIC-UPS-EXT. EXIT. *ver.4.7 ***************************************************************** * 患者個別設定情報更新処理 ***************************************************************** 211-PTCONF-SYORI-SEC SECTION. * * お薬手帳QR区分 MOVE SPA-GMN28-MNOTE-QRKBN TO WRK-CONF-CDATA MOVE "MNOTEQR" TO WRK-CONF-CKEY PERFORM 2111-PTCONF-DBSYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 211-PTCONF-SYORI-EXT END-IF * * お薬手帳データフォーマット区分 MOVE SPA-GMN28-MNOTE-CSV TO WRK-CONF-CDATA MOVE "MNOTEVER" TO WRK-CONF-CKEY PERFORM 2111-PTCONF-DBSYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 211-PTCONF-SYORI-EXT END-IF * * 日医データフォーマット区分 MOVE SPA-GMN28-JMAMRVER TO WRK-CONF-CDATA MOVE "JMAMRVER" TO WRK-CONF-CKEY PERFORM 2111-PTCONF-DBSYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 211-PTCONF-SYORI-EXT END-IF * *H26.1 * 出生時体重 IF SPA-GMN-BIRTHWEIGHT = ZERO MOVE SPACE TO WRK-CONF-CDATA ELSE MOVE SPA-GMN-BIRTHWEIGHT-X TO WRK-CONF-CDATA END-IF MOVE "BIRTHWEIGHT" TO WRK-CONF-CKEY PERFORM 2111-PTCONF-DBSYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 211-PTCONF-SYORI-EXT END-IF * *H26.4 * 地域包括診療対象疾病 PERFORM VARYING IDH1 FROM 1 BY 1 UNTIL IDH1 > 4 IF SPA-GMN28-CHKHKTBYO(IDH1) = SPACE MOVE "0" TO SPA-GMN28-CHKHKTBYO(IDH1) END-IF END-PERFORM IF SPA-GMN28-CHKHKTBYO-AREA = ZERO MOVE SPACE TO WRK-CONF-CDATA ELSE MOVE SPA-GMN28-CHKHKTBYO-AREA TO WRK-CONF-CDATA END-IF MOVE "TIIKIHOKATU" TO WRK-CONF-CKEY PERFORM 2111-PTCONF
COBOL
-DBSYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 211-PTCONF-SYORI-EXT END-IF *H28.4 * 認知症地域包括診療 IF SPA-GMN28-NNCHIKBN = ZERO MOVE SPACE TO SPA-GMN28-NNCHIKBN END-IF MOVE SPA-GMN28-NNCHIKBN TO WRK-CONF-CDATA MOVE "NINTIHOKATU" TO WRK-CONF-CKEY PERFORM 2111-PTCONF-DBSYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 211-PTCONF-SYORI-EXT END-IF * 小児かかりつけ診療 IF SPA-GMN28-SYOUNIKBN = ZERO MOVE SPACE TO SPA-GMN28-SYOUNIKBN END-IF MOVE SPA-GMN28-SYOUNIKBN TO WRK-CONF-CDATA MOVE "SYOUNIKAKARI" TO WRK-CONF-CKEY PERFORM 2111-PTCONF-DBSYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 211-PTCONF-SYORI-EXT END-IF *H30.4 * 妊婦区分 IF SPA-GMN28-NINPUKBN = ZERO MOVE SPACE TO SPA-GMN28-NINPUKBN END-IF MOVE SPA-GMN28-NINPUKBN TO WRK-CONF-CDATA MOVE "NINPUKBN" TO WRK-CONF-CKEY PERFORM 2111-PTCONF-DBSYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 211-PTCONF-SYORI-EXT END-IF *H28.12 * 指導料等自動算定 MOVE ZERO TO IDH2 PERFORM VARYING IDH1 FROM 1 BY 1 UNTIL (IDH1 > 3 ) OR (SPA-ERRCD NOT = SPACE ) IF SPA-GMN28-AUTOSRYCD(IDH1) = SPACE CONTINUE ELSE ADD 1 TO IDH2 MOVE SPA-GMN28-AUTOSRYCD(IDH1) TO WRK-CONF-CDATA EVALUATE IDH2 WHEN 1 MOVE "JIDOSANTEI-1" TO WRK-CONF-CKEY WHEN 2 MOVE "JIDOSANTEI-2" TO WRK-CONF-CKEY WHEN 3 MOVE "JIDOSANTEI-3" TO WRK-CONF-CKEY END-EVALUATE PERFORM 2111-PTCONF-DBSYORI-SEC END-IF END-PERFORM IF IDH2 < 3 COMPUTE IDH3 = IDH2 + 1 PERFORM VARYING IDH1 FROM IDH3 BY 1 UNTIL (IDH1 > 3 ) OR (SPA-ERRCD NOT = SPACE ) MOVE SPACE TO WRK-CONF-CDATA EVALUATE IDH1 WHEN 1 MOVE "JIDOSANTEI-1" TO WRK-CONF-CKEY WHEN 2 MOVE "JIDOSANTEI-2" TO WRK-CONF-CKEY WHEN 3 MOVE "JIDOSANTEI-3" TO WRK-CONF-CKEY END-EVALUATE PERFORM 2111-PTCONF-DBSYORI-SEC END-PERFORM END-IF * *R01.6 * 難病等+生保保険組合せ作成区分 IF SPA-GMN27-COMBKBN = ZERO MOVE SPACE TO SPA-GMN27-COMBKBN END-IF MOVE SPA-GMN27-COMBKBN TO WRK-CONF-CDATA MOVE "COMBKBN" TO WRK-CONF-CKEY PERFORM 2111-PTCONF-DBSYORI-SEC IF SPA-ERRCD NOT = SPACE GO TO 211-PTCONF-SYORI-EXT END-IF . 211-PTCONF-SYORI-EXT. EXIT. ***************************************************************** * 患者個別設定登録処理 ***************************************************************** 2111-PTCONF-DBSYORI-SEC SECTION. * * INITIALIZE PTCONF-REC MOVE PTINF-HOSPNUM TO PTCONF-HOSPNUM MOVE PTINF-PTID TO PTCONF-PTID MOVE WRK-CONF-CKEY TO PTCONF-CKEY * MOVE PTCONF-REC TO MCPDATA-REC MOVE "tbl_ptconf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME MOVE "DBSELECT" TO MCP-FUNC PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptconf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 930-PTCONF-READ-SEC ELSE MOVE 1 TO FLG-PTCONF INITIALIZE PTCONF-REC END-IF MOVE "tbl_ptconf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * * DBあり IF FLG-PTCONF = ZERO IF WRK-CONF-CDATA = SPACE * DB削除 MOVE PTCONF-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_ptconf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTCONF DEL ERR:" MCP-RC ",KEY:" PTCONF-KEY MOVE "9000" TO SPA-ERRCD END-IF ELSE * DB更新 PERFORM 21111-PTCONF-UPS-SEC END-IF ELSE IF WRK-CONF-CDATA NOT = SPACE * 登録 PERFORM 21112-PTCONF-INS-SEC END-IF END-IF * . 2111-PTCONF-DBSYORI-EXT. EXIT. ***************************************************************** * 患者個別設定データ登録処理 ***************************************************************** 21112-PTCONF-INS-SEC SECTION. * INITIALIZE PTCONF-REC MOVE SPA-HOSPNUM TO PTCONF-HOSPNUM MOVE SPA-GMN-PTID TO PTCONF-PTID MOVE WRK-CONF-CKEY TO PTCONF-CKEY * 入力値編集 MOVE WRK-CONF-CDATA TO PTCONF-CDATA * 作成年月日 MOVE SMCNDATE-YMD TO PTCONF-CREYMD MOVE SMCNDATE-YMD TO PTCONF-UPYMD MOVE SMCNDATE-HMS TO PTCONF-UPHMS MOVE SPA-OPID TO PTCONF-OPID * MOVE PTCONF-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptconf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF
COBOL
MCP-RC NOT = ZERO DISPLAY "P029 PTCONF INS ERR:" MCP-RC ",KEY:" PTCONF-KEY MOVE "9000" TO SPA-ERRCD END-IF . 21112-PTCONF-INS-EXT. EXIT. ***************************************************************** * 患者個別設定データ更新処理 ***************************************************************** 21111-PTCONF-UPS-SEC SECTION. * * 入力値編集 MOVE WRK-CONF-CDATA TO PTCONF-CDATA * 更新年月日 MOVE SMCNDATE-YMD TO PTCONF-UPYMD MOVE SMCNDATE-HMS TO PTCONF-UPHMS MOVE SPA-OPID TO PTCONF-OPID * MOVE PTCONF-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_ptconf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTCONF UPD ERR:" MCP-RC ",KEY:" PTCONF-KEY MOVE "9000" TO SPA-ERRCD END-IF . 21111-PTCONF-UPS-EXT. EXIT. * * ***************************************************************** * 患者保険マスター処理 ***************************************************************** 220-PTHKNINF-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO PTHKNINF-REC * MOVE SPA-GMN-PTID TO PTHKN-PTID MOVE PTHKNINF-REC TO MCPDATA-REC PERFORM 910-PTHKNINF-READ-SEC * IF FLG-PTHKNINF = 1 * 更新情報 MOVE SMCNDATE-YMD TO PTHKN-CREYMD MOVE SMCNDATE-YMD TO PTHKN-UPYMD MOVE SMCNDATE-HMS TO PTHKN-UPHMS * MOVE SPA-OPID TO PTHKN-OPID * MOVE PTHKNINF-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_pthkninf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTHKNINF INS ERR:" MCP-RC ",PTHKN-KEY:" PTHKN-KEY ",PTHKN-TEKSTYMD:" PTHKN-TEKSTYMD MOVE "9000" TO SPA-ERRCD END-IF ELSE * 更新情報 *D MOVE MCPDATA-REC TO HZN-PTHKNINF-REC MOVE HZN-PTHKN-CREYMD TO PTHKN-CREYMD MOVE SMCNDATE-YMD TO PTHKN-UPYMD MOVE SMCNDATE-HMS TO PTHKN-UPHMS * MOVE SPA-OPID TO PTHKN-OPID * MOVE PTHKNINF-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_pthkninf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTHKNINF UPD ERR:" MCP-RC ",PTHKN-KEY:" PTHKN-KEY ",PTHKN-TEKSTYMD:" PTHKN-TEKSTYMD MOVE "9000" TO SPA-ERRCD END-IF * 確認年月日履歴 IF (SPA-ERRCD = SPACE ) AND (HZN-PTHKN-KAKUNINYMD NOT = SPACE ) AND (PTHKN-KAKUNINYMD NOT = SPACE ) IF HZN-PTHKN-KAKUNINYMD = PTHKN-KAKUNINYMD CONTINUE ELSE * 今回変更あり PERFORM 2209-PTHKNRRK-ADD-SEC END-IF END-IF END-IF . 220-PTHKNINF-SYORI-EXT. EXIT. ***************************************************************** * 患者保険確認年月日履歴処理 ***************************************************************** 2209-PTHKNRRK-ADD-SEC SECTION. * INITIALIZE ORCSPTHKNRRKAREA MOVE SPA-GMN-PTID TO ORCSHKNRRK-PTID MOVE PTHKN-HKNID TO ORCSHKNRRK-HKNID MOVE HZN-PTHKN-KAKUNINYMD TO ORCSHKNRRK-KAKUNINYMD CALL "ORCSPTHKNRRK" USING SPA-AREA ORCSPTHKNRRKAREA IF ORCSHKNRRK-RC = 9 DISPLAY "P029 PTHKNRRK UPD ERR:" ORCSHKNRRK-RC ",PTHKN-HKNID:" PTHKN-HKNID MOVE "9000" TO SPA-ERRCD END-IF . 2209-PTHKNRRK-ADD-EXT. EXIT. ***************************************************************** * 患者公費マスター処理 ***************************************************************** 230-PTKOHINF-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO PTKOHINF-REC * MOVE SPA-GMN-PTID TO PTKOH-PTID MOVE PTKOHINF-REC TO MCPDATA-REC PERFORM 920-PTKOHINF-READ-SEC * IF FLG-PTKOHINF = 1 MOVE SPA-GMN-PTID TO PTKOH-PTID * 更新情報 MOVE SMCNDATE-YMD TO PTKOH-CREYMD MOVE SMCNDATE-YMD TO PTKOH-UPYMD MOVE SMCNDATE-HMS TO PTKOH-UPHMS * MOVE SPA-OPID TO PTKOH-OPID * MOVE PTKOHINF-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptkohinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTKOHINF INS ERR:" MCP-RC ",KEY:" PTKOH-KEY MOVE "9000" TO SPA-ERRCD END-IF ELSE * 更新情報 *D MOVE MCPDATA-REC TO HZN-PTKOHINF-REC MOVE HZN-PTKOH-CREYMD TO PTKOH-CREYMD MOVE SMCNDATE-YMD TO PTKOH-UPYMD MOVE SMCNDATE-HMS TO PTKOH-UPHMS * MOVE SPA-OPID TO PTKOH-OPID * MOVE PTKOHINF-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_ptkohinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTKOHINF UPD ERR:" MCP-
COBOL
RC ",KEY:" PTKOH-KEY MOVE "9000" TO SPA-ERRCD END-IF END-IF * * 月代り受給者番号登録(生活保護で、新規登録の時) IF PTKOH-KOHNUM = "012" * 残留邦人追加 OR "025" PERFORM 2301-MONTHLYNUM-SYORI-SEC END-IF . 230-PTKOHINF-SYORI-EXT. EXIT. ***************************************************************** * 月代り受給者番号マスター処理 ***************************************************************** 2301-MONTHLYNUM-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO PTKOHINF-REC MOVE SPA-GMN-PTID TO PTKOH-PTID * IF PTKOH-SAKJOKBN = "1" * 削除分 MOVE SPACE TO MONTHLYNUM-REC INITIALIZE MONTHLYNUM-REC MOVE PTKOH-HOSPNUM TO MONTHLYNUM-HOSPNUM MOVE PTKOH-PTID TO MONTHLYNUM-PTID MOVE PTKOH-KOHNUM TO MONTHLYNUM-KOHNUM MOVE "2" TO MONTHLYNUM-NYUGAIKBN * 適用開始年月日 MOVE PTKOH-TEKSTYMD(1:6) TO MONTHLYNUM-SRYYM MOVE "tbl_monthlynum" TO WRK-MCP-TABLE MOVE "key" TO WRK-MCP-PATHNAME PERFORM 925-MONTHLYNUM-READ-SEC IF FLG-MONTHLYNUM = ZERO MOVE MONTHLYNUM-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_monthlynum" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA END-IF ELSE * 編集 MOVE SPACE TO MONTHLYNUM-REC INITIALIZE MONTHLYNUM-REC MOVE PTKOH-HOSPNUM TO MONTHLYNUM-HOSPNUM MOVE PTKOH-PTID TO MONTHLYNUM-PTID MOVE PTKOH-KOHID TO MONTHLYNUM-KOHID MOVE "2" TO MONTHLYNUM-NYUGAIKBN * 適用開始年月日 MOVE PTKOH-TEKSTYMD(1:6) TO MONTHLYNUM-SRYYM MOVE "tbl_monthlynum" TO WRK-MCP-TABLE MOVE "key4" TO WRK-MCP-PATHNAME PERFORM 925-MONTHLYNUM-READ-SEC IF FLG-MONTHLYNUM = ZERO * 修正分 IF (PTKOH-JKYSNUM NOT = SPACE ) AND (PTKOH-JKYSNUM NOT = MONTHLYNUM-JKYSNUM) MOVE PTKOH-JKYSNUM TO MONTHLYNUM-JKYSNUM * 更新情報 MOVE SMCNDATE-YMD TO MONTHLYNUM-UPYMD MOVE SMCNDATE-HMS TO MONTHLYNUM-UPHMS * MOVE SPA-OPID TO MONTHLYNUM-OPID * MOVE MONTHLYNUM-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_monthlynum" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 MONTHLYNUM UPD ERR:" MCP-RC ",KEY:" MONTHLYNUM-KEY MOVE "9000" TO SPA-ERRCD END-IF END-IF ELSE ** MOVE SPACE TO MONTHLYNUM-REC * INITIALIZE MONTHLYNUM-REC * MOVE PTKOH-HOSPNUM TO MONTHLYNUM-HOSPNUM * MOVE PTKOH-PTID TO MONTHLYNUM-PTID * MOVE PTKOH-KOHNUM TO MONTHLYNUM-KOHNUM * MOVE "2" TO MONTHLYNUM-NYUGAIKBN * 適用開始年月日 * MOVE PTKOH-TEKSTYMD(1:6) TO MONTHLYNUM-SRYYM * MOVE "tbl_monthlynum" TO WRK-MCP-TABLE * MOVE "key" TO WRK-MCP-PATHNAME * PERFORM 925-MONTHLYNUM-READ-SEC * IF FLG-MONTHLYNUM = ZERO * 修正分 * IF (PTKOH-JKYSNUM NOT = SPACE ) AND * (PTKOH-JKYSNUM NOT = * MONTHLYNUM-JKYSNUM) * MOVE PTKOH-JKYSNUM TO MONTHLYNUM-JKYSNUM * 更新情報 * MOVE SMCNDATE-YMD TO MONTHLYNUM-UPYMD * MOVE SMCNDATE-HMS TO MONTHLYNUM-UPHMS * * MOVE SPA-OPID TO MONTHLYNUM-OPID * * MOVE MONTHLYNUM-REC TO MCPDATA-REC * MOVE "DBUPDATE" TO MCP-FUNC * MOVE "tbl_monthlynum" * TO MCP-TABLE * MOVE "key" TO MCP-PATHNAME grpsys* CALL "ORCDBMAIN" USING MCPAREA * MCPDATA-REC * SPA-AREA * IF MCP-RC NOT = ZERO * DISPLAY "P029 MONTHLYNUM UPD ERR:" MCP-RC * ",KEY:" MONTHLYNUM-KEY * MOVE "9000" TO SPA-ERRCD * END-IF * END-IF ********* ELSE IF PTKOH-JKYSNUM = SPACE GO TO 2301-MONTHLYNUM-SYORI-EXT END-IF * 新規 MOVE SPACE TO MONTHLYNUM-REC INITIALIZE MONTHLYNUM-REC MOVE PTKOH-HOSPNUM TO MONTHLYNUM-HOSPNUM MOVE PTKOH-PTID TO MONTHLYNUM-PTID MOVE PTKOH-KOHNUM TO MONTHLYNUM-KOHNUM MOVE PTKOH-KOHID TO MONTHLYNUM-KOHID MOVE PTKOH-TEKSTYMD(1:6) TO MONTHLYNUM-SRYYM MOVE "2" TO MONTHLYNUM-NYUGAIKBN MOVE PTKOH-JKYSNUM TO MONTHLYNUM-JKYSNUM * MOVE SMCNDATE-YMD TO MONTHLYNUM-CREYMD MOVE SMCNDATE-YMD TO MONTHLYNUM-UPYMD MOVE SMCNDATE-HMS TO MONTHLYNUM-UPHMS * MOVE SPA-OPID TO MONTHLYNUM-OPID * MOVE MONTHLYNUM-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_monthlynum" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 MONTHLYNUM INS ERR:" MCP-RC ",KEY:" MONTHLYNUM-KEY MOVE "9000" TO SPA-ERRCD END-IF END-IF ********
COBOL
END-IF END-IF * * . 2301-MONTHLYNUM-SYORI-EXT. EXIT. ***************************************************************** * 受診受付マスター処理 ***************************************************************** 240-UKETUKE-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO UKETUKE-REC * * 削除以外の診療科、ドクターを診療行為入力の為SPAへセット IF (UKE-UPYMD NOT = ALL "9") AND (UKE-KAIKEITIME = ZERO ) MOVE UKE-SRYKA TO SPA-SRYKA MOVE UKE-DRCD TO SPA-DRCD END-IF * MOVE SPA-GMN-PTID TO UKE-PTID MOVE UKETUKE-REC TO MCPDATA-REC PERFORM 930-UKETUKE-READ-SEC * IF FLG-UKETUKE = 1 * 追加の時、受付IDを取得 MOVE SPA-HOSPNUM TO UKE-HOSPNUM MOVE SPA-SYSYMD TO UKE-UKEYMD MOVE ZERO TO UKE-UKEID MOVE UKETUKE-REC TO MCPDATA-REC PERFORM 930-UKETUKE-READ-SEC IF FLG-UKETUKE = ZERO ADD 1 TO UKE-PTID IF UKE-PTID > 99999 MOVE "9001" TO SPA-ERRCD GO TO 240-UKETUKE-SYORI-EXT END-IF MOVE UKE-PTID TO WRK-UKEID * MOVE SMCNDATE-YMD TO UKE-UPYMD MOVE SMCNDATE-HMS TO UKE-UPHMS * MOVE SPA-OPID TO UKE-OPID * MOVE UKETUKE-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_uketuke" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 UKETUKE UPD ERR:" MCP-RC ",KEY:" UKE-KEY MOVE "9002" TO SPA-ERRCD END-IF ELSE INITIALIZE UKETUKE-REC MOVE SPA-HOSPNUM TO UKE-HOSPNUM MOVE SPA-SYSYMD TO UKE-UKEYMD MOVE ZERO TO UKE-UKEID MOVE 1 TO UKE-PTID MOVE UKE-PTID TO WRK-UKEID * MOVE SMCNDATE-YMD TO UKE-CREYMD MOVE SMCNDATE-YMD TO UKE-UPYMD MOVE SMCNDATE-HMS TO UKE-UPHMS * MOVE SPA-OPID TO UKE-OPID * MOVE UKETUKE-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_uketuke" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 UKETUKE INS ERR:" MCP-RC ",KEY:" UKE-KEY MOVE "9002" TO SPA-ERRCD END-IF END-IF * MOVE PARA-DATA-REC TO UKETUKE-REC MOVE SPA-GMN-PTID TO UKE-PTID MOVE WRK-UKEID TO UKE-UKEID * MOVE SMCNDATE-YMD TO UKE-CREYMD MOVE SMCNDATE-YMD TO UKE-UPYMD MOVE SMCNDATE-HMS TO UKE-UPHMS * MOVE SPA-OPID TO UKE-OPID * MOVE UKETUKE-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_uketuke" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 UKETUKE INS ERR:" MCP-RC ",KEY:" UKE-KEY MOVE "9002" TO SPA-ERRCD END-IF ELSE MOVE PARA-DATA-REC TO UKETUKE-REC MOVE SPA-GMN-PTID TO UKE-PTID * IF UKE-UPYMD = ALL "9" * 削除 MOVE UKETUKE-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_uketuke" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 UKETUKE UPD ERR:" MCP-RC ",KEY:" UKE-KEY END-IF ELSE * MOVE SMCNDATE-YMD TO UKE-UPYMD MOVE SMCNDATE-HMS TO UKE-UPHMS * MOVE SPA-OPID TO UKE-OPID * * 更新 MOVE UKETUKE-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_uketuke" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 UKETUKE UPD ERR:" MCP-RC ",KEY:" UKE-KEY MOVE "9002" TO SPA-ERRCD END-IF END-IF END-IF * * 予約者の来院済みを処理 IF UKE-KEYYYKTIME NOT = SPACE PERFORM 2401-YYK-SYORI-SEC END-IF . 240-UKETUKE-SYORI-EXT. EXIT. * ***************************************************************** * 予約処理 ***************************************************************** 2401-YYK-SYORI-SEC SECTION. * INITIALIZE YYK-REC MOVE UKE-HOSPNUM TO YYK-HOSPNUM MOVE UKE-SRYNAIYO TO YYK-SRYNAIYO MOVE UKE-DRCD TO YYK-DRCD MOVE UKE-UKEYMD TO YYK-YYKYMD MOVE UKE-KEYYYKTIME TO YYK-KEYYYKTIME MOVE UKE-YYKID TO YYK-YYKID * MOVE YYK-REC TO MCPDATA-REC MOVE "tbl_yyk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_yyk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 980-YYK-READ-SEC ELSE MOVE
COBOL
1 TO FLG-YYK END-IF MOVE "tbl_yyk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * *H26.8 ドクター・診療内容を変更した場合 IF FLG-YYK = ZERO IF (YYK-PTID NOT = ZERO ) AND (YYK-PTID NOT = UKE-PTID) MOVE 1 TO FLG-YYK END-IF END-IF * IF FLG-YYK = ZERO * MOVE SMCNDATE-YMD TO YYK-UPYMD MOVE SMCNDATE-HMS TO YYK-UPHMS * MOVE SPA-OPID TO YYK-OPID * IF UKE-UPYMD = ALL "9" IF YYK-RAIINZUMI = "1" MOVE SPACE TO YYK-RAIINZUMI MOVE YYK-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_yyk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA END-IF ELSE IF (YYK-RAIINZUMI = SPACE ) OR (YYK-PTID = ZERO ) OR (YYK-NAME NOT = SPA-GMN-NAME ) MOVE "1" TO YYK-RAIINZUMI * 患者ID IF (YYK-PTID = ZERO ) MOVE SPA-GMN-PTID TO YYK-PTID END-IF * 氏名変更 MOVE SPA-GMN-NAME TO YYK-NAME * MOVE YYK-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_yyk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA END-IF END-IF END-IF * . 2401-YYK-SYORI-EXT. EXIT. * ***************************************************************** * 保険組合せ処理 ***************************************************************** 250-HKNCOMBI-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO HKNCOMBI-REC * 非表示区分設定 PERFORM 2502-HKNCOMBI-HYOJI-SEC * MOVE SPA-GMN-PTID TO COMB-PTID MOVE HKNCOMBI-REC TO MCPDATA-REC PERFORM 940-HKNCOMBI-READ-SEC * 保険変更による受診履歴修正の有無チェック IF FLG-HKNCOMBI = ZERO *D MOVE MCPDATA-REC TO HZN-HKNCOMBI-REC IF (HZN-COMB-TEKSTYMD NOT = COMB-TEKSTYMD) OR (HZN-COMB-TEKEDYMD NOT = COMB-TEKEDYMD) OR (HZN-COMB-DELKBN NOT = COMB-DELKBN ) PERFORM 2501-HKNCOMBI-CHK-SEC END-IF END-IF * 新規設定を変更区分クリア IF COMB-CHGKBN = "A" MOVE SPACE TO COMB-CHGKBN END-IF * IF FLG-HKNCOMBI = 1 * MOVE SMCNDATE-YMD TO COMB-CREYMD MOVE SMCNDATE-YMD TO COMB-UPYMD MOVE SMCNDATE-HMS TO COMB-UPHMS * MOVE SPA-OPID TO COMB-OPID * MOVE HKNCOMBI-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_hkncombi" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 HKNCOMBI INS ERR:" MCP-RC ",KEY:" COMB-KEY MOVE "9003" TO SPA-ERRCD END-IF ELSE * MOVE HZN-COMB-CREYMD TO COMB-CREYMD MOVE SMCNDATE-YMD TO COMB-UPYMD MOVE SMCNDATE-HMS TO COMB-UPHMS * MOVE SPA-OPID TO COMB-OPID * MOVE HKNCOMBI-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_hkncombi" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 HKNCOMBI UPD ERR:" MCP-RC ",KEY:" COMB-KEY MOVE "9003" TO SPA-ERRCD END-IF END-IF . 250-HKNCOMBI-SYORI-EXT. EXIT. * ***************************************************************** * 保険変更による受診履歴修正の有無チェック処理 ***************************************************************** 2502-HKNCOMBI-HYOJI-SEC SECTION. * PERFORM VARYING IDX5 FROM 1 BY 1 UNTIL (IDX5 > SPA-HYO-MAX ) IF (COMB-HKNCOMBINUM = SPA-HYO-HKNCOMBINUM(IDX5)) AND (COMB-HKNNUM = SPA-HYO-HKNNUM (IDX5)) AND (COMB-KOH1HKNNUM = SPA-HYO-KOH1HKNNUM (IDX5)) AND (COMB-KOH2HKNNUM = SPA-HYO-KOH2HKNNUM (IDX5)) AND (COMB-KOH3HKNNUM = SPA-HYO-KOH3HKNNUM (IDX5)) AND (COMB-KOH4HKNNUM = SPA-HYO-KOH4HKNNUM (IDX5)) MOVE SPA-HYO-HYOJIKBN (IDX5) TO COMB-HYOJIKBN MOVE 1 TO FLG-OK END-IF END-PERFORM * . 2502-HKNCOMBI-HYOJI-EXT. EXIT. * ***************************************************************** * 保険変更による受診履歴修正の有無チェック処理 ***************************************************************** 2501-HKNCOMBI-CHK-SEC SECTION. * MOVE SPACE TO JYURRK-REC INITIALIZE JYURRK-REC MOVE HZN-COMB-HOSPNUM TO JYURRK-HOSPNUM MOVE HZN-COMB-PTID TO JYURRK-PTID MOVE HZN-COMB-HKNCOMBINUM TO JYURRK-HKNCOMBINUM * MOVE JYURRK-REC TO MCPDATA-REC MOVE "tbl_jyurrk" TO MCP-TABLE MOVE "key41" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_jyurrk" TO MCP-TABLE MOVE "key41" TO MCP-PATHNAME PERFORM 970-JYURRK-READ-SEC ELSE
COBOL
MOVE SPACE TO JYURRK-REC INITIALIZE JYURRK-REC MOVE 1 TO FLG-JYURRK END-IF MOVE "tbl_jyurrk" TO MCP-TABLE MOVE "key41" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * IF FLG-JYURRK = ZERO IF COMB-DELKBN = SPACE IF (JYURRK-SRYYMD < COMB-TEKSTYMD) OR (JYURRK-SRYYMD > COMB-TEKEDYMD) MOVE "9100" TO SPA-KEI-ERRCD MOVE "K910" TO WRK-PIDCD END-IF ELSE * 削除の時 MOVE "9100" TO SPA-KEI-ERRCD MOVE "K910" TO WRK-PIDCD END-IF END-IF * * 病名チェック MOVE SPACE TO PTBYOMEI-REC INITIALIZE PTBYOMEI-REC MOVE HZN-COMB-HOSPNUM TO PTBYO-HOSPNUM MOVE HZN-COMB-PTID TO PTBYO-PTID MOVE HZN-COMB-HKNCOMBINUM TO PTBYO-HKNCOMBI * MOVE PTBYOMEI-REC TO MCPDATA-REC MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_ptbyomei" TO MCP-TABLE MOVE "key8" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptbyomei" TO MCP-TABLE MOVE "key8" TO MCP-PATHNAME PERFORM 980-PTBYOMEI-READ-SEC ELSE MOVE SPACE TO PTBYOMEI-REC INITIALIZE PTBYOMEI-REC MOVE 1 TO FLG-PTBYOMEI END-IF MOVE "tbl_ptbyomei" TO MCP-TABLE MOVE "key8" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * IF FLG-PTBYOMEI = ZERO IF COMB-DELKBN = SPACE IF (PTBYO-SRYYMD < COMB-TEKSTYMD) OR (PTBYO-SRYYMD > COMB-TEKEDYMD) IF SPA-KEI-ERRCD = SPACE MOVE "9101" TO SPA-KEI-ERRCD MOVE "K911" TO WRK-PIDCD ELSE MOVE "9102" TO SPA-KEI-ERRCD MOVE "K912" TO WRK-PIDCD END-IF END-IF ELSE * 削除の時 IF SPA-KEI-ERRCD = SPACE MOVE "9101" TO SPA-KEI-ERRCD MOVE "K911" TO WRK-PIDCD ELSE MOVE "9102" TO SPA-KEI-ERRCD MOVE "K912" TO WRK-PIDCD END-IF END-IF END-IF * . 2501-HKNCOMBI-CHK-EXT. EXIT. * ***************************************************************** * 旧姓履歴マスター処理 ***************************************************************** 260-KYUSEIRRK-SYORI-SEC SECTION. * * 旧姓履歴はすべて削除 PERFORM 260-KYUSEIRRK-DEL-SEC * * PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > SPA-NAI25-KYU-MAX IF SPA-GMN25-KYU-DELKBN (IDX) = SPACE INITIALIZE KYUSEIRRK-REC MOVE SPA-HOSPNUM TO KYUSEI-HOSPNUM MOVE SPA-GMN-PTID TO KYUSEI-PTID MOVE SPA-GMN25-KYU-CHGYMD (IDX) TO KYUSEI-CHGYMD MOVE SPA-GMN25-KYU-KANANAME (IDX) TO KYUSEI-KANANAME MOVE SPA-GMN25-KYU-NAME (IDX) TO KYUSEI-NAME MOVE SPA-GMN25-KYU-NICKNAME (IDX) TO KYUSEI-NICKNAME ************ MOVE SPA-GMN25-KYU-UPYMD (IDX) * TO KYUSEI-UPYMD * MOVE SPA-GMN25-KYU-CREYMD (IDX) ************* TO KYUSEI-CREYMD * * 更新日が当日以外は更新とする IF SPA-GMN25-KYU-UPYMD (IDX) = SMCNDATE-YMD MOVE SMCNDATE-YMD TO KYUSEI-CREYMD MOVE SMCNDATE-YMD TO KYUSEI-UPYMD MOVE SMCNDATE-HMS TO KYUSEI-UPHMS ELSE MOVE SMCNDATE-YMD TO KYUSEI-UPYMD MOVE SMCNDATE-HMS TO KYUSEI-UPHMS END-IF * MOVE SPA-OPID TO KYUSEI-OPID * MOVE "DBINSERT" TO MCP-FUNC MOVE KYUSEIRRK-REC TO MCPDATA-REC MOVE "tbl_kyuseirrk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 KYUSEIRRK INS ERR:" MCP-RC ",KEY:" KYUSEI-KEY MOVE "9000" TO SPA-ERRCD END-IF END-IF END-PERFORM * . 260-KYUSEIRRK-SYORI-EXT. EXIT. * ***************************************************************** * 旧姓履歴マスター処理 ***************************************************************** 260-KYUSEIRRK-DEL-SEC SECTION. * INITIALIZE KYUSEIRRK-REC MOVE SPA-HOSPNUM TO KYUSEI-HOSPNUM MOVE SPA-GMN-PTID TO KYUSEI-PTID MOVE KYUSEIRRK-REC TO MCPDATA-REC * MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_kyuseirrk" TO MCP-TABLE MOVE "del1" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 260-KYUSEIRRK-DEL-EXT. EXIT. ***************************************************************** * 患者番号変換(管理)マスター処理 ***************************************************************** 280-PTNUM-SYORI-SEC SECTION. * * 患者ID決定 IF SPA-GMN-PTID = ZERO * 患者番号採番検索 INITIALIZE SYS-1009-REC MOVE "1009" TO SYS-1009-KANRICD MOVE "*" TO SYS-1009-KBNCD MOVE SPA-SYSYMD TO SYS-1009-STYUKYMD MOVE SPA-SYSYMD TO SYS-1009-EDYUKYMD MOVE SPA-HOSPNUM TO SYS-1009-HOSPNUM MOVE SYS-1009-REC TO MCPDATA-REC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key10" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP
COBOL
-RC = ZERO MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key10" TO MCP-PATHNAME PERFORM 960-SYSKANRI-READ-SEC IF FLG-SYSKANRI = ZERO MOVE MCPDATA-REC TO SYS-1009-REC END-IF ELSE MOVE 1 TO FLG-SYSKANRI END-IF MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key10" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC IF FLG-SYSKANRI = 1 MOVE "1011" TO SPA-ERRCD DISPLAY "P29 SYS1009(PTGETNUM)ERR:" MCP-RC "." GO TO 280-PTNUM-SYORI-EXT END-IF IF SYS-1009-PTID = ALL "9" MOVE "8001" TO SPA-ERRCD MOVE ZERO TO SYS-1009-PTID END-IF COMPUTE SYS-1009-PTID = SYS-1009-PTID + 1 * PTID=ゼロ はなし IF SYS-1009-PTID = ZERO MOVE "8001" TO SPA-ERRCD MOVE 1 TO SYS-1009-PTID END-IF MOVE SYS-1009-PTID TO SPA-GMN-PTID * MOVE SMCNDATE-YMD TO SYS-1009-UPYMD MOVE SMCNDATE-HMS TO SYS-1009-UPHMS MOVE SPA-OPID TO SYS-1009-OPID * 患者番号採番 更新 MOVE SPA-HOSPNUM TO SYS-1009-HOSPNUM MOVE SYS-1009-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO MOVE "1011" TO SPA-ERRCD DISPLAY "P012 SYSKANRI UPDATE:" MCP-RC "." GO TO 280-PTNUM-SYORI-EXT END-IF END-IF * * INITIALIZE PTNUM-REC MOVE SPA-HOSPNUM TO PTNUM-HOSPNUM MOVE SPA-GMN-PTID TO PTNUM-PTID * MOVE PTNUM-REC TO MCPDATA-REC MOVE "tbl_ptnum" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptnum" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 950-PTNUM-READ-SEC ELSE MOVE 1 TO FLG-PTNUM END-IF MOVE "tbl_ptnum" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * IF FLG-PTNUM = 1 INITIALIZE PTNUM-REC MOVE SPA-HOSPNUM TO PTNUM-HOSPNUM MOVE SPA-GMN-PTID TO PTNUM-PTID MOVE SPA-GMN-PTNUM TO PTNUM-PTNUM MOVE SPA-PTNUM-HKNID TO PTNUM-HKNID MOVE SPA-PTNUM-KOHID TO PTNUM-KOHID MOVE SPA-PTNUM-AUTOCOMBINUM TO PTNUM-AUTOCOMBINUM MOVE SPA-PTNUM-MANUCOMBINUM TO PTNUM-MANUCOMBINUM * MOVE SMCNDATE-YMD TO PTNUM-CREYMD MOVE SMCNDATE-YMD TO PTNUM-UPYMD MOVE SMCNDATE-HMS TO PTNUM-UPHMS * MOVE SPA-OPID TO PTNUM-OPID * MOVE PTNUM-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptnum" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTNUM INS ERR:" MCP-RC ",KEY:" PTNUM-KEY "." MOVE "9000" TO SPA-ERRCD END-IF ELSE IF SPA-GMN-PTNUM NOT = PTNUM-PTNUM MOVE "8003" TO SPA-ERRCD GO TO 280-PTNUM-SYORI-EXT END-IF MOVE SPA-HOSPNUM TO PTNUM-HOSPNUM MOVE SPA-GMN-PTID TO PTNUM-PTID MOVE SPA-GMN-PTNUM TO PTNUM-PTNUM MOVE SPA-PTNUM-HKNID TO PTNUM-HKNID MOVE SPA-PTNUM-KOHID TO PTNUM-KOHID MOVE SPA-PTNUM-AUTOCOMBINUM TO PTNUM-AUTOCOMBINUM MOVE SPA-PTNUM-MANUCOMBINUM TO PTNUM-MANUCOMBINUM * MOVE SMCNDATE-YMD TO PTNUM-UPYMD MOVE SMCNDATE-HMS TO PTNUM-UPHMS * MOVE SPA-OPID TO PTNUM-OPID * MOVE PTNUM-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_ptnum" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTNUM UPD ERR:" MCP-RC "." ",KEY:" PTNUM-KEY "." MOVE "9000" TO SPA-ERRCD END-IF END-IF . 280-PTNUM-SYORI-EXT. EXIT. ***************************************************************** * 低所得マスター処理 ***************************************************************** 290-TSYRRK-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO TSYRRK-REC MOVE SPA-GMN-PTID TO TSYRRK-PTID * EVALUATE TRUE * 削除 WHEN ( TSYRRK-UPYMD = ALL "9" ) MOVE TSYRRK-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_tsyrrk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 TSYRRK DEL ERR:" MCP-RC ",KEY:" TSYRRK-KEY END-IF * 変更 WHEN ( TSYRRK-NINSTYMD-O NOT = SPACE ) * *DD MOVE MCPDATA-REC TO HZN-TSYRRK-REC *DD MOVE HZN-TSYRRK-CREYMD TO TSYRRK-CREYMD MOVE SMCNDATE-YMD TO TSYRRK-UPYMD MOVE SMCNDATE-HMS TO TSYRRK-UPHMS
COBOL
* MOVE SPA-OPID TO TSYRRK-OPID * MOVE TSYRRK-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_tsyrrk" TO MCP-TABLE MOVE "upd1" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 TSYRRK UPD ERR:" MCP-RC ",KEY:" TSYRRK-KEY MOVE "9000" TO SPA-ERRCD END-IF * 追加 WHEN OTHER MOVE SPA-GMN-PTID TO TSYRRK-PTID * MOVE SMCNDATE-YMD TO TSYRRK-CREYMD MOVE SMCNDATE-YMD TO TSYRRK-UPYMD MOVE SMCNDATE-HMS TO TSYRRK-UPHMS * MOVE SPA-OPID TO TSYRRK-OPID * MOVE TSYRRK-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_tsyrrk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 TSYRRK INS ERR:" MCP-RC ",KEY:" TSYRRK-KEY MOVE "9000" TO SPA-ERRCD END-IF END-EVALUATE * . 290-TSYRRK-SYORI-EXT. EXIT. ***************************************************************** * 年金マスター処理 ***************************************************************** 291-TNKRRK-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO TNKRRK-REC MOVE SPA-GMN-PTID TO TNKRRK-PTID * EVALUATE TRUE * 削除 WHEN ( TNKRRK-UPYMD = ALL "9" ) MOVE TNKRRK-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_tnkrrk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 TNKRRK DEL ERR:" MCP-RC ",KEY:" TNKRRK-KEY END-IF * 変更 WHEN ( TNKRRK-STYMD-O NOT = SPACE ) * *DD MOVE MCPDATA-REC TO HZN-TNKRRK-REC *DD MOVE HZN-TNKRRK-CREYMD TO TNKRRK-CREYMD MOVE SMCNDATE-YMD TO TNKRRK-UPYMD MOVE SMCNDATE-HMS TO TNKRRK-UPHMS * MOVE SPA-OPID TO TNKRRK-OPID * MOVE TNKRRK-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_tnkrrk" TO MCP-TABLE MOVE "upd1" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 TNKRRK UPD ERR:" MCP-RC ",KEY:" TNKRRK-KEY MOVE "9000" TO SPA-ERRCD END-IF * 追加 WHEN OTHER MOVE SPA-GMN-PTID TO TNKRRK-PTID * MOVE SMCNDATE-YMD TO TNKRRK-CREYMD MOVE SMCNDATE-YMD TO TNKRRK-UPYMD MOVE SMCNDATE-HMS TO TNKRRK-UPHMS * MOVE SPA-OPID TO TNKRRK-OPID * MOVE TNKRRK-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_tnkrrk" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 TNKRRK INS ERR:" MCP-RC ",KEY:" TNKRRK-KEY MOVE "9000" TO SPA-ERRCD END-IF END-EVALUATE . 291-TNKRRK-SYORI-EXT. EXIT. * ***************************************************************** * 患者労災保険情報マスター処理 ***************************************************************** 292-PTRSIINF-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO PTRSIINF-REC * MOVE SPA-GMN-PTID TO PTRSI-PTID MOVE PTRSIINF-REC TO MCPDATA-REC PERFORM 990-PTRSIINF-READ-SEC * IF FLG-PTRSIINF = 1 * MOVE SMCNDATE-YMD TO PTRSI-CREYMD MOVE SMCNDATE-YMD TO PTRSI-UPYMD MOVE SMCNDATE-HMS TO PTRSI-UPHMS * MOVE SPA-OPID TO PTRSI-OPID * MOVE PTRSIINF-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptrsiinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTRSIINF INS ERR:" MCP-RC ",KEY:" PTRSI-KEY MOVE "9000" TO SPA-ERRCD END-IF ELSE * MOVE HZN-PTRSI-CREYMD TO PTRSI-CREYMD MOVE SMCNDATE-YMD TO PTRSI-UPYMD MOVE SMCNDATE-HMS TO PTRSI-UPHMS * MOVE SPA-OPID TO PTRSI-OPID * MOVE PTRSIINF-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_ptrsiinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTRSIINF UPD ERR:" MCP-RC ",KEY:" PTRSI-KEY MOVE "9000" TO SPA-ERRCD END-IF END-IF . 292-PTRSIINF-SYORI-EXT. EXIT. * ***************************************************************** * 公費負担情報更新処理 ***************************************************************** 300-PTKOHFTN-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO PTKOHFTN-REC * 公費負担読込み MOVE SPA-GMN-PTID TO PTKOHFTN-PTID MOVE PTKOHFTN-REC TO MCPDATA-REC MOVE "tbl_ptkohftn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME
COBOL
PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptkohftn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 991-PTKOHFTN-READ-SEC ELSE MOVE 1 TO FLG-PTKOHFTN END-IF MOVE "tbl_ptkohftn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * IF FLG-PTKOHFTN = 1 MOVE PARA-DATA-REC TO PTKOHFTN-REC * MOVE SMCNDATE-YMD TO PTKOHFTN-CREYMD MOVE SMCNDATE-YMD TO PTKOHFTN-UPYMD MOVE SMCNDATE-HMS TO PTKOHFTN-UPHMS * MOVE SPA-OPID TO PTKOHFTN-OPID MOVE SPACE TO PTKOHFTN-TERMID * * 新規 MOVE SPA-GMN-PTID TO PTKOHFTN-PTID MOVE PTKOHFTN-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptkohftn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTKOHFTN INS ERR:" MCP-RC ",KEY:" PTKOHFTN-KEY MOVE "9000" TO SPA-ERRCD END-IF ELSE MOVE PTKOHFTN-CREYMD TO WRK-CREYMD MOVE PARA-DATA-REC TO PTKOHFTN-REC * MOVE WRK-CREYMD TO PTKOHFTN-CREYMD MOVE SMCNDATE-YMD TO PTKOHFTN-UPYMD MOVE SMCNDATE-HMS TO PTKOHFTN-UPHMS * MOVE SPA-OPID TO PTKOHFTN-OPID * * 更新 MOVE PTKOHFTN-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_ptkohftn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTKOHFTN UPD ERR:" MCP-RC ",KEY:" PTKOHFTN-KEY MOVE "9000" TO SPA-ERRCD END-IF END-IF . 300-PTKOHFTN-SYORI-EXT. EXIT. ***************************************************************** * 特記事項情報更新処理 ***************************************************************** 300-PTTOKKI-SYORI-SEC SECTION. * * 特記事項はすべて削除 INITIALIZE PTTOKKI-REC MOVE SPA-HOSPNUM TO PTTOKKI-HOSPNUM MOVE SPA-GMN-PTID TO PTTOKKI-PTID MOVE PTTOKKI-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_pttokki" TO MCP-TABLE MOVE "del" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > SPA-GMN26-TMAX INITIALIZE PTTOKKI-REC MOVE SPA-HOSPNUM TO PTTOKKI-HOSPNUM MOVE SPA-GMN-PTID TO PTTOKKI-PTID MOVE SPA-NAI26-TNYUGIKBN(IDX) TO PTTOKKI-NYUGAIKBN MOVE IDX TO PTTOKKI-RENNUM * 特記事項 MOVE SPA-GMN26-TCD(IDX) TO PTTOKKI-CD MOVE SPA-GMN26-TNAIYO(IDX) TO PTTOKKI-NAIYO MOVE SPA-NAI26-TSTYM (IDX) TO PTTOKKI-STYM MOVE SPA-NAI26-TEDYM (IDX) TO PTTOKKI-EDYM * MOVE SMCNDATE-YMD TO PTTOKKI-CREYMD MOVE SMCNDATE-YMD TO PTTOKKI-UPYMD MOVE SMCNDATE-HMS TO PTTOKKI-UPHMS MOVE SPA-OPID TO PTTOKKI-OPID * 追加 MOVE PTTOKKI-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_pttokki" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTTOKKI INS ERR:" MCP-RC ",KEY:" PTTOKKI-KEY MOVE "9000" TO SPA-ERRCD END-IF END-PERFORM . 300-PTTOKKI-SYORI-EXT. EXIT. ***************************************************************** * 患者レセプト分割削除処理 ***************************************************************** 300-PTHDISTDAY-DELETE-SEC SECTION. * * 患者レセプト分割はすべて削除 INITIALIZE PT-HDIST-DAY-REC MOVE SPA-HOSPNUM TO PT-HDIST-DAY-HOSPNUM MOVE SPA-GMN-PTID TO PT-HDIST-DAY-PTID MOVE PT-HDIST-DAY-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_pt_hdist_day" TO MCP-TABLE MOVE "del" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA . 300-PTHDISTDAY-DELETE-EXT. EXIT. ***************************************************************** * 患者レセプト分割更新処理 ***************************************************************** 300-PTHDISTDAY-SYORI-SEC SECTION. * MOVE PARA-DATA-REC TO PT-HDIST-DAY-REC * MOVE SPA-HOSPNUM TO PT-HDIST-DAY-HOSPNUM MOVE SPA-GMN-PTID TO PT-HDIST-DAY-PTID * MOVE PT-HDIST-DAY-REC TO MCPDATA-REC MOVE "tbl_ptkohftn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptkohftn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 991-PTHDISTDAY-READ-SEC ELSE MOVE 1 TO FLG-PTHDISTDAY END-IF MOVE "tbl_ptkohftn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * IF FLG-PTHDISTDAY = 1 MOVE PARA-DATA-REC TO PT-HDIST-DAY-REC MOVE SPA-HOSPNUM TO PT-HDIST-DAY-HOSPNUM MOVE SPA-GMN-PTID TO PT-HDIST-DAY-
COBOL
PTID * MOVE SMCNDATE-YMD TO PT-HDIST-DAY-CREYMD MOVE SMCNDATE-YMD TO PT-HDIST-DAY-UPYMD MOVE SMCNDATE-HMS TO PT-HDIST-DAY-UPHMS * MOVE SPA-OPID TO PT-HDIST-DAY-OPID * * 新規 MOVE SPA-GMN-PTID TO PT-HDIST-DAY-PTID MOVE PT-HDIST-DAY-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_pt_hdist_day" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PT-HDIST-DAY INS ERR:" MCP-RC ",KEY:" PT-HDIST-DAY-KEY MOVE "9000" TO SPA-ERRCD END-IF ELSE MOVE PT-HDIST-DAY-CREYMD TO WRK-CREYMD MOVE PARA-DATA-REC TO PT-HDIST-DAY-REC * MOVE WRK-CREYMD TO PT-HDIST-DAY-CREYMD MOVE SMCNDATE-YMD TO PT-HDIST-DAY-UPYMD MOVE SMCNDATE-HMS TO PT-HDIST-DAY-UPHMS * MOVE SPA-OPID TO PT-HDIST-DAY-OPID * * 更新 MOVE PT-HDIST-DAY-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_pt_hdist_day" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PT-HDIST-DAY UPD ERR:" MCP-RC ",KEY:" PT-HDIST-DAY-KEY MOVE "9000" TO SPA-ERRCD END-IF END-IF . 300-PTHDISTDAY-SYORI-EXT. EXIT. ***************************************************************** * 患者公費負担額テーブル更新処理 ***************************************************************** 3001-PTKOHFTNETC-SYORI-SEC SECTION. * * 今回更新対象月分はすべて削除 PERFORM VARYING IDX FROM 1 BY 1 UNTIL (IDX > MAX-KOHFTN ) OR (SPA-NAI24-KOHFTN-ID (IDX) = ZERO) INITIALIZE PTKOHFTNETC-REC MOVE SPA-HOSPNUM TO PTKOHFTNETC-HOSPNUM MOVE SPA-GMN-PTID TO PTKOHFTNETC-PTID MOVE SPA-NAI24-KOHFTN-ID (IDX) TO PTKOHFTNETC-KOHID MOVE SPA-NAI24-KOHFTN-YM (IDX) TO PTKOHFTNETC-SRYYMD(1:6) MOVE "%" TO PTKOHFTNETC-SRYYMD(7:1) MOVE PTKOHFTNETC-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_ptkohftnetc" TO MCP-TABLE IF SPA-NAI24-KOHFTN-YM (IDX) = SPACE * 公費削除 MOVE "del2" TO MCP-PATHNAME ELSE MOVE "del3" TO MCP-PATHNAME END-IF CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA END-PERFORM * INITIALIZE PARA-REC MOVE "P02" TO PARA-GYOUMUID MOVE SPA-TERMID TO PARA-TERMID MOVE "PTKOHFTNETC" TO PARA-FILEMEI * MOVE SPA-HOSPNUM TO PARA-HOSPNUM MOVE PARA-REC TO MCPDATA-REC MOVE "tbl_para" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_para" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME PERFORM 990-PARA-READ-SEC ELSE INITIALIZE PARA-REC MOVE 1 TO FLG-PARA END-IF * PERFORM UNTIL FLG-PARA = 1 * PERFORM 30011-PTKOHFTNETC-DBSYORI-SEC * MOVE "tbl_para" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME PERFORM 990-PARA-READ-SEC END-PERFORM MOVE "tbl_para" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 3001-PTKOHFTNETC-SYORI-EXT. EXIT. ***************************************************************** * 公費負担情報更新処理 ***************************************************************** 30011-PTKOHFTNETC-DBSYORI-SEC SECTION. * MOVE PARA-DATA-REC TO PTKOHFTNETC-REC * 公費負担読込み MOVE SPA-GMN-PTID TO PTKOHFTNETC-PTID MOVE PTKOHFTNETC-REC TO MCPDATA-REC MOVE "tbl_ptkohftnetc" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptkohftnetc" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 991-PTKOHFTNETC-READ-SEC ELSE MOVE 1 TO FLG-PTKOHFTN END-IF MOVE "tbl_ptkohftnetc" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * IF FLG-PTKOHFTNETC = 1 MOVE PARA-DATA-REC TO PTKOHFTNETC-REC * MOVE SMCNDATE-YMD TO PTKOHFTNETC-CREYMD MOVE SMCNDATE-YMD TO PTKOHFTNETC-UPYMD MOVE SMCNDATE-HMS TO PTKOHFTNETC-UPHMS * MOVE SPA-OPID TO PTKOHFTNETC-OPID * * 新規 MOVE SPA-GMN-PTID TO PTKOHFTNETC-PTID MOVE PTKOHFTNETC-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptkohftnetc" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTKOHFTNETC INS ERR:" MCP-RC ",KEY:" PTKOHFTNETC-KEY MOVE "9000" TO SPA-ERRCD END-IF ELSE MOVE PTKOHFTNETC-CREYMD TO WRK-CREYMD MOVE PARA-DATA-REC TO PTKOHFTNETC-REC * MOVE WRK-CREYMD TO PTKOH
COBOL
FTNETC-CREYMD MOVE SMCNDATE-YMD TO PTKOHFTNETC-UPYMD MOVE SMCNDATE-HMS TO PTKOHFTNETC-UPHMS * MOVE SPA-OPID TO PTKOHFTNETC-OPID * * 更新 MOVE PTKOHFTNETC-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_ptkohftnetc" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTKOHFTNETC UPD ERR:" MCP-RC ",KEY:" PTKOHFTN-KEY MOVE "9000" TO SPA-ERRCD END-IF END-IF . 30011-PTKOHFTNETC-DBSYORI-EXT. EXIT. *ver.4.7 ***************************************************************** * 患者介護保険情報更新処理 ***************************************************************** 2130-PTCARE-HKNINF-SYORI-SEC SECTION. * * すべて削除 INITIALIZE PTCARE-HKNINF-REC MOVE SPA-HOSPNUM TO PTCRHKN-HOSPNUM MOVE SPA-GMN-PTID TO PTCRHKN-PTID MOVE PTCARE-HKNINF-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_ptcare_hkninf" TO MCP-TABLE MOVE "del1" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * PERFORM VARYING IDX FROM 1 BY 1 UNTIL (IDX > SPA-GMN28-CRHKN-MAX ) OR (SPA-ERRCD NOT = SPACE ) * 登録 PERFORM 21301-PTCAREHKNINF-INS-SEC END-PERFORM . 2130-PTCARE-HKNINF-SYORI-EXT. EXIT. ***************************************************************** * 患者介護保険情報データ登録処理 ***************************************************************** 21301-PTCAREHKNINF-INS-SEC SECTION. * INITIALIZE PTCARE-HKNINF-REC MOVE SPA-HOSPNUM TO PTCRHKN-HOSPNUM MOVE SPA-GMN-PTID TO PTCRHKN-PTID MOVE SPA-GMN28-TCRHKNJANUM (IDX) TO PTCRHKN-HKNJANUM MOVE SPA-GMN28-TCRHIHKNJANUM (IDX) TO PTCRHKN-HIHKNJANUM MOVE SPA-NAI28-TCRHSTRYMD(IDX) TO PTCRHKN-TEKSTYMD MOVE SPA-NAI28-TCRHENDYMD(IDX) TO PTCRHKN-TEKEDYMD * 作成年月日 MOVE SMCNDATE-YMD TO PTCRHKN-CREYMD MOVE SMCNDATE-YMD TO PTCRHKN-UPYMD MOVE SMCNDATE-HMS TO PTCRHKN-UPHMS MOVE SPA-OPID TO PTCRHKN-OPID * MOVE PTCARE-HKNINF-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptcare_hkninf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTCRHKN INS ERR:" MCP-RC ",KEY:" PTCRHKN-KEY MOVE "9000" TO SPA-ERRCD END-IF . 21301-PTCAREHKNINF-INS-EXT. EXIT. * ***************************************************************** * 患者介護認定者情報更新処理 ***************************************************************** 2140-PTCARE-NINTEI-SYORI-SEC SECTION. * * すべて削除 INITIALIZE PTCARE-NINTEI-REC MOVE SPA-HOSPNUM TO PTCRNIN-HOSPNUM MOVE SPA-GMN-PTID TO PTCRNIN-PTID MOVE PTCARE-NINTEI-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_ptcare_nintei" TO MCP-TABLE MOVE "del1" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > SPA-GMN28-CRNIN-MAX INITIALIZE PTCARE-NINTEI-REC MOVE SPA-HOSPNUM TO PTCRNIN-HOSPNUM MOVE SPA-GMN-PTID TO PTCRNIN-PTID MOVE SPA-NAI28-TCRSTRYMD(IDX) TO PTCRNIN-TEKSTYMD MOVE SPA-NAI28-TCRENDYMD(IDX) TO PTCRNIN-TEKEDYMD MOVE SPA-NAI28-TCAREJOTAI(IDX) TO PTCRNIN-CAREJOTAICD MOVE SPA-NAI28-TCRNINYMD (IDX) TO PTCRNIN-NINTEIYMD * MOVE SMCNDATE-YMD TO PTCRNIN-CREYMD MOVE SMCNDATE-YMD TO PTCRNIN-UPYMD MOVE SMCNDATE-HMS TO PTCRNIN-UPHMS MOVE SPA-OPID TO PTCRNIN-OPID * 追加 MOVE PTCARE-NINTEI-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptcare_nintei" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTCARE-NINTEI INS ERR:" MCP-RC ",KEY:" PTCRNIN-KEY MOVE "9000" TO SPA-ERRCD END-IF END-PERFORM . 2140-PTCARE-NINTEI-SYORI-EXT. EXIT. * *H28.12 ***************************************************************** * 患者個人番号情報更新処理 ***************************************************************** 2150-MYNUMBER-SYORI-SEC SECTION. * * すべて削除 INITIALIZE PTMYNUMBER-REC MOVE SPA-HOSPNUM TO PTMYNUM-HOSPNUM MOVE SPA-GMN-PTID TO PTMYNUM-PTID MOVE PTMYNUMBER-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_ptmynumber" TO MCP-TABLE MOVE "del1" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > SPA-GMN28-MYID-MAX INITIALIZE PTMYNUMBER-REC MOVE SPA-HOSPNUM TO PTMYNUM-HOSPNUM MOVE SPA-GMN-PTID TO PTMYNUM-PTID MOVE SPA-GMN28-TMYIDKEY(IDX) TO PTMYNUM-ID-KEY
COBOL
MOVE SPA-GMN28-TMYNUMBER(IDX) TO PTMYNUM-MY-NUMBER MOVE SPA-GMN28-TMYDESCRIP(IDX) TO PTMYNUM-DESCRIPTION * MOVE SMCNDATE-YMD TO PTMYNUM-CREYMD MOVE SMCNDATE-YMD TO PTMYNUM-UPYMD MOVE SMCNDATE-HMS TO PTMYNUM-UPHMS MOVE SPA-OPID TO PTMYNUM-OPID * 追加 MOVE PTMYNUMBER-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptmynumber" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTMYNUMBER INS ERR:" MCP-RC ",KEY:" PTMYNUM-KEY MOVE "9000" TO SPA-ERRCD END-IF END-PERFORM . 2150-MYNUMBER-SYORI-EXT. EXIT. * * ***************************************************************** * 主科情報設定処理 ***************************************************************** 2110-SYUKA-INSERT-SEC SECTION. * INITIALIZE ORCSSYUACCAREA * 処理区分 MOVE "02" TO LNK-SYUACC-I-KBN * 診療年月 MOVE SPA-NAI-SYUKAYM TO LNK-SYUACC-I-SRYYM MOVE SPA-NAI-SYUKA TO LNK-SYUACC-IO-H-SRYKA MOVE SPA-GMN-PTID TO SPA-PTID MOVE SPA-GMN-PTNUM TO SPA-PTNUM CALL "ORCSSYUKAMAIN" USING SPA-AREA ORCSSYUACCAREA IF LNK-SYUACC-RC NOT = ZERO DISPLAY "P029 ORCSSYUKAMAIN INS ERR:" LNK-SYUACC-RC MOVE "9000" TO SPA-ERRCD END-IF * . 2110-SYUKA-INSERT-EXT. EXIT. ***************************************************************** * 患者紐付(同一患者識別)更新処理 ***************************************************************** 2110-PTSAME-SYORI-SEC SECTION. * INITIALIZE PTSAME-REC MOVE SPA-HOSPNUM TO PTSAME-HOSPNUM MOVE SPA-GMN-PTID TO PTSAME-PTID MOVE PTSAME-REC TO MCPDATA-REC MOVE "tbl_ptsame" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "key" TO MCP-PATHNAME PERFORM 900-PTSAME-READ-SEC ELSE MOVE 1 TO FLG-PTSAME END-IF MOVE "tbl_ptsame" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * IF FLG-PTSAME = 1 IF SPA-NAI-GRPHOSPNUM NOT = ZERO * 同一患者識別追加 PERFORM 21101-PTSAME-ADD-SEC END-IF ELSE IF SPA-NAI-GRPHOSPNUM = ZERO * 同一識別削除 PERFORM 21102-PTSAME-DELETE-SEC ELSE IF (SPA-NAI-GRPHOSPNUM = PTSAME-SAME-HOSPNUM) AND (SPA-NAI-GRPPTID = PTSAME-SAME-PTID ) CONTINUE ELSE * 紐付け変更 * 同一識別削除 PERFORM 21102-PTSAME-DELETE-SEC * 同一患者識別追加 PERFORM 21101-PTSAME-ADD-SEC END-IF END-IF END-IF * . 2110-PTSAME-SYORI-EXT. EXIT. * ***************************************************************** * 同一患者識別追加処理 ***************************************************************** 21101-PTSAME-ADD-SEC SECTION. * INITIALIZE PTSAME-REC MOVE SPA-NAI-GRPHOSPNUM TO PTSAME-HOSPNUM MOVE SPA-NAI-GRPPTID TO PTSAME-PTID MOVE PTSAME-REC TO MCPDATA-REC MOVE "tbl_ptsame" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "key" TO MCP-PATHNAME PERFORM 900-PTSAME-READ-SEC ELSE MOVE 1 TO FLG-PTSAME END-IF MOVE "tbl_ptsame" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC IF FLG-PTSAME = ZERO * 既に同一患者識別が登録済み MOVE SPA-HOSPNUM TO PTSAME-HOSPNUM MOVE SPA-GMN-PTID TO PTSAME-PTID PERFORM 211011-PTSAME-INS-SEC ELSE * 同一患者識別なし INITIALIZE PTSAME-REC MOVE SPA-NAI-GRPHOSPNUM TO PTSAME-HOSPNUM MOVE SPA-NAI-GRPPTID TO PTSAME-PTID MOVE SPA-NAI-GRPHOSPNUM TO PTSAME-SAME-HOSPNUM MOVE SPA-NAI-GRPPTID TO PTSAME-SAME-PTID PERFORM 211011-PTSAME-INS-SEC * INITIALIZE PTSAME-REC MOVE SPA-HOSPNUM TO PTSAME-HOSPNUM MOVE SPA-GMN-PTID TO PTSAME-PTID MOVE SPA-NAI-GRPHOSPNUM TO PTSAME-SAME-HOSPNUM MOVE SPA-NAI-GRPPTID TO PTSAME-SAME-PTID PERFORM 211011-PTSAME-INS-SEC END-IF . 21101-PTSAME-ADD-EXT. EXIT. ***************************************************************** * 同一患者識別追加処理 ***************************************************************** 211011-PTSAME-INS-SEC SECTION. * MOVE SMCNDATE-YMD TO PTSAME-CREYMD MOVE SMCNDATE-YMD TO PTSAME-UPYMD MOVE SMCNDATE-HMS TO PTSAME-UPHMS * MOVE SPA-OPID TO PTSAME-OPID * MOVE PTSAME-REC TO MCPDATA-REC MOVE "DBINSERT" TO MCP-FUNC MOVE "tbl_ptsame" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO DISPLAY "P029 PTSAME INS ERR:" MCP-RC ",KEY:" PTSAME-KEY MOVE "9000" TO SPA-ERRCD END-IF . 211011-PTSAME-INS-EXT. EXIT. * ***************************************************************** * 同一識別削除加処理 ***************************************************************** 21102-PTSAME-DELETE-SEC SECTION. * MOVE PTSAME-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_ptsame " TO MCP-TABLE MOVE "del1" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * 同一患者がなくなった
COBOL
場合 MOVE PTSAME-REC TO MCPDATA-REC MOVE "tbl_ptsame" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptsame" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME PERFORM 900-PTSAME-READ-SEC ELSE MOVE 1 TO FLG-PTSAME END-IF MOVE ZERO TO WRK-PTSAME-CNT PERFORM UNTIL FLG-PTSAME = 1 ADD 1 TO WRK-PTSAME-CNT MOVE PTSAME-REC TO HZN-PTSAME-REC MOVE "tbl_ptsame" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME PERFORM 900-PTSAME-READ-SEC END-PERFORM MOVE "tbl_ptsame" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC IF WRK-PTSAME-CNT = 1 MOVE HZN-PTSAME-REC TO MCPDATA-REC MOVE "DBDELETE" TO MCP-FUNC MOVE "tbl_ptsame " TO MCP-TABLE MOVE "del1" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA END-IF * . 21102-PTSAME-DELETE-EXT. EXIT. * ***************************************************************** * QR情報更新処理 ***************************************************************** 2120-QRCDHKN-UPD-SEC SECTION. * INITIALIZE QRCDHKN-REC MOVE SPA-HOSPNUM TO QRCDHKN-HOSPNUM MOVE SPA-QR-REGISTYMD TO QRCDHKN-REGISTYMD MOVE SPA-QR-REGISTID TO QRCDHKN-REGISTID MOVE QRCDHKN-REC TO MCPDATA-REC MOVE "tbl_qrcdhkn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_qrcdhkn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 900-QRCDHKN-READ-SEC ELSE MOVE 1 TO FLG-QRCDHKN INITIALIZE QRCDHKN-REC END-IF MOVE "tbl_qrcdhkn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * IF FLG-QRCDHKN = ZERO MOVE SPA-GMN-PTID TO QRCDHKN-PTID MOVE 1 TO QRCDHKN-MOD-FLG MOVE SMCNDATE-YMD TO QRCDHKN-UPYMD MOVE SMCNDATE-HMS TO QRCDHKN-UPHMS * MOVE SPA-OPID TO QRCDHKN-OPID * MOVE QRCDHKN-REC TO MCPDATA-REC MOVE "DBUPDATE" TO MCP-FUNC MOVE "tbl_qrcdhkn" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC NOT = ZERO MOVE "9000" TO SPA-ERRCD DISPLAY "P029 QRCDHKN KEY UPD ERR:" MCP-RC ",KEY:" QRCDHKN-KEY END-IF END-IF * . 2120-QRCDHKN-UPD-EXT. EXIT. * ***************************************************************** * API患者保険情報更新処理 ***************************************************************** 300-API-KOUSIN-SEC SECTION. * * 保険・公費・保険組合せのみ * パラメタファイルより INITIALIZE PARA-REC MOVE "P02" TO PARA-GYOUMUID MOVE SPA-TERMID TO PARA-TERMID * MOVE SPA-HOSPNUM TO PARA-HOSPNUM MOVE PARA-REC TO MCPDATA-REC MOVE "tbl_para" TO MCP-TABLE MOVE "key3" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_para" TO MCP-TABLE MOVE "key3" TO MCP-PATHNAME PERFORM 990-PARA-READ-SEC ELSE INITIALIZE PARA-REC MOVE 1 TO FLG-PARA END-IF * PERFORM UNTIL (FLG-PARA = 1 ) EVALUATE PARA-FILEMEI WHEN "PTHKNINF" PERFORM 220-PTHKNINF-SYORI-SEC ADD 1 TO WRK-HKN-CNT WHEN "PTKOHINF" PERFORM 230-PTKOHINF-SYORI-SEC ADD 1 TO WRK-KOH-CNT WHEN "HKNCOMBI" PERFORM 250-HKNCOMBI-SYORI-SEC * 労災保険 WHEN "PTRSIINF" IF SPA-RSIAPI-FLG = "1" PERFORM 292-PTRSIINF-SYORI-SEC END-IF END-EVALUATE * MOVE "tbl_para" TO MCP-TABLE MOVE "key3" TO MCP-PATHNAME PERFORM 990-PARA-READ-SEC END-PERFORM * MOVE "tbl_para" TO MCP-TABLE MOVE "key3" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC . 300-API-KOUSIN-EXT. EXIT. ***************************************************************** * 患者マスター読み込み ***************************************************************** 900-PTINF-READ-SEC SECTION. * MOVE PTINF-REC TO MCPDATA-REC MOVE "tbl_ptinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE ZERO TO FLG-PTINF MOVE MCPDATA-REC TO PTINF-REC ELSE MOVE 1 TO FLG-PTINF END-IF ELSE MOVE 1 TO FLG-PTINF END-IF MOVE "tbl_ptinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 900-PTINF-READ-EXT. EXIT. ***************************************************************** * 保険マスター読み込み ***************************************************************** 910-PTHKNINF-READ-SEC SECTION. * MOVE PTHKNINF-REC TO MCPDATA-REC MOVE "tbl_pthkninf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_pthkninf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO HZN-PTHKNINF-REC MOVE ZERO TO
COBOL
FLG-PTHKNINF ELSE MOVE 1 TO FLG-PTHKNINF END-IF ELSE MOVE 1 TO FLG-PTHKNINF END-IF MOVE "tbl_pthkninf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 910-PTHKNINF-READ-EXT. EXIT. * ***************************************************************** * 公費マスター読み込み ***************************************************************** 920-PTKOHINF-READ-SEC SECTION. * MOVE PTKOHINF-REC TO MCPDATA-REC MOVE "tbl_ptkohinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptkohinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO HZN-PTKOHINF-REC MOVE ZERO TO FLG-PTKOHINF ELSE MOVE 1 TO FLG-PTKOHINF END-IF ELSE MOVE 1 TO FLG-PTKOHINF END-IF MOVE "tbl_ptkohinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 920-PTKOHINF-READ-EXT. EXIT. * ***************************************************************** * 公費マスター読み込み ***************************************************************** 925-MONTHLYNUM-READ-SEC SECTION. * MOVE MONTHLYNUM-REC TO MCPDATA-REC MOVE WRK-MCP-TABLE TO MCP-TABLE MOVE WRK-MCP-PATHNAME TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE WRK-MCP-TABLE TO MCP-TABLE MOVE WRK-MCP-PATHNAME TO MCP-PATHNAME PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE ZERO TO FLG-MONTHLYNUM MOVE MCPDATA-REC TO MONTHLYNUM-REC ELSE MOVE 1 TO FLG-MONTHLYNUM END-IF ELSE MOVE 1 TO FLG-MONTHLYNUM END-IF MOVE WRK-MCP-TABLE TO MCP-TABLE MOVE WRK-MCP-PATHNAME TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 925-MONTHLYNUM-READ-EXT. EXIT. * ***************************************************************** * 労災保険マスター読み込み ***************************************************************** 990-PTRSIINF-READ-SEC SECTION. * MOVE PTRSIINF-REC TO MCPDATA-REC MOVE "tbl_ptrsiinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptrsiinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO HZN-PTRSIINF-REC MOVE ZERO TO FLG-PTRSIINF ELSE MOVE 1 TO FLG-PTRSIINF END-IF ELSE MOVE 1 TO FLG-PTRSIINF END-IF MOVE "tbl_ptrsiinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 990-PTRSIINF-READ-EXT. EXIT. * ***************************************************************** * 受付マスター読み込み ***************************************************************** 930-UKETUKE-READ-SEC SECTION. * MOVE "tbl_uketuke" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_uketuke" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO UKETUKE-REC MOVE ZERO TO FLG-UKETUKE ELSE MOVE 1 TO FLG-UKETUKE END-IF ELSE MOVE 1 TO FLG-UKETUKE END-IF MOVE "tbl_uketuke" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 930-UKETUKE-READ-EXT. EXIT. ***************************************************************** * 患者番号変換読み込み ***************************************************************** 950-PTNUM-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO PTNUM-REC MOVE ZERO TO FLG-PTNUM ELSE MOVE 1 TO FLG-PTNUM END-IF * . 950-PTNUM-READ-EXT. EXIT. ***************************************************************** * 予約読み込み ***************************************************************** 980-YYK-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO YYK-REC MOVE ZERO TO FLG-YYK ELSE MOVE 1 TO FLG-YYK END-IF * . 980-YYK-READ-EXT. EXIT. ***************************************************************** * 保険組合せマスター読み込み ***************************************************************** 940-HKNCOMBI-READ-SEC SECTION. * MOVE "tbl_hkncombi" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_hkncombi" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO HZN-HKNCOMBI-REC MOVE ZERO TO FLG-HKNCOMBI ELSE INITIALIZE HZN-HKNCOMBI-REC MOVE 1 TO FLG-HKNCOMBI END-IF ELSE MOVE 1 TO FLG-HKNCOMBI END-IF MOVE "tbl_hkncombi" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 940-HKNCOMBI-READ-EXT. EXIT. ***************************************************************** * 公費負担マスター読み込み ***************************************************************** 991-PTKOHFTN-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO PTKOHFTN-REC MOVE ZERO TO FLG-PTKOHFTN ELSE INITIALIZE PTKOHFTN-REC MOVE 1 TO FLG-PTKOHFTN END-IF * . 991-PTKOHFTN-READ-EXT. EXIT. ***************************************************************** * 患者公費負担額マスター読み込み ***************************************************************** 991-PTKOHFTNETC-READ-SEC SECTION. * PERFORM 920-DBFETCH-
COBOL
SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO PTKOHFTNETC-REC MOVE ZERO TO FLG-PTKOHFTNETC ELSE INITIALIZE PTKOHFTNETC-REC MOVE 1 TO FLG-PTKOHFTNETC END-IF * . 991-PTKOHFTNETC-READ-EXT. EXIT. ***************************************************************** * 受診履歴マスター読込 ***************************************************************** 970-JYURRK-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO JYURRK-REC MOVE ZERO TO FLG-JYURRK ELSE INITIALIZE JYURRK-REC MOVE 1 TO FLG-JYURRK END-IF * . 970-JYURRK-READ-EXT. EXIT. ***************************************************************** * 病名マスター読込 ***************************************************************** 980-PTBYOMEI-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO PTBYOMEI-REC MOVE ZERO TO FLG-PTBYOMEI ELSE INITIALIZE PTBYOMEI-REC MOVE 1 TO FLG-PTBYOMEI END-IF * . 980-PTBYOMEI-READ-EXT. EXIT. * ***************************************************************** * システム管理マスタ読込 ***************************************************************** 960-SYSKANRI-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO ****** MOVE MCPDATA-REC TO SYS-1009-REC MOVE ZERO TO FLG-SYSKANRI ELSE MOVE 1 TO FLG-SYSKANRI END-IF * . * 960-SYSKANRI-READ-EXT. EXIT. * ***************************************************************** * 同一患者識別マスター読込処理 ***************************************************************** 900-PTSAME-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE ZERO TO FLG-PTSAME MOVE MCPDATA-REC TO PTSAME-REC ELSE MOVE 1 TO FLG-PTSAME END-IF * . 900-PTSAME-READ-EXT. EXIT. * ***************************************************************** * QRコード(被保険者証)読込 ***************************************************************** 900-QRCDHKN-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO QRCDHKN-REC MOVE ZERO TO FLG-QRCDHKN ELSE INITIALIZE QRCDHKN-REC MOVE 1 TO FLG-QRCDHKN END-IF . 900-QRCDHKN-READ-EXT. EXIT. * ***************************************************************** * 患者地域連携読み込み ***************************************************************** 900-PTPUBLIC-READ-SEC SECTION. * MOVE PTPUBLIC-REC TO MCPDATA-REC MOVE "tbl_ptnum_public" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptnum_public" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO PTPUBLIC-REC MOVE ZERO TO FLG-PTPUBLIC ELSE MOVE 1 TO FLG-PTPUBLIC END-IF ELSE MOVE 1 TO FLG-PTPUBLIC END-IF MOVE "tbl_ptnum_public" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 900-PTPUBLIC-READ-EXT. EXIT. ***************************************************************** * 患者レセプト分割テーブル読み込み ***************************************************************** 991-PTHDISTDAY-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO PT-HDIST-DAY-REC MOVE ZERO TO FLG-PTHDISTDAY ELSE INITIALIZE PT-HDIST-DAY-REC MOVE 1 TO FLG-PTHDISTDAY END-IF * . 991-PTHDISTDAY-READ-EXT. EXIT. ***************************************************************** * 患者個別設定テーブル読み込み ***************************************************************** 930-PTCONF-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO PTCONF-REC MOVE ZERO TO FLG-PTCONF ELSE INITIALIZE PTCONF-REC MOVE 1 TO FLG-PTCONF END-IF * . 930-PTCONF-READ-EXT. EXIT. * ***************************************************************** * 患者介護保険情読み込み ***************************************************************** 900-PTCAREHKNINF-READ-SEC SECTION. * MOVE PTCARE-HKNINF-REC TO MCPDATA-REC MOVE "tbl_ptcare_hkninf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 910-DBSELECT-SEC IF MCP-RC = ZERO MOVE "tbl_ptcare_hkninf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE MCPDATA-REC TO PTCARE-HKNINF-REC MOVE ZERO TO FLG-PTCARE-HKNINF ELSE MOVE 1 TO FLG-PTCARE-HKNINF MOVE SPACE TO PTCARE-HKNINF-REC END-IF ELSE MOVE 1 TO FLG-PTCARE-HKNINF END-IF MOVE "tbl_ptcare_hkninf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME PERFORM 990-DBCLOSE-SEC * . 900-PTCAREHKNINF-READ-EXT. EXIT. * ***************************************************************** * テーブル検索処理 ***************************************************************** 910-DBSELECT-SEC SECTION. * MOVE "DBSELECT" TO MCP-FUNC grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 910-DBSELECT-EXT. EXIT. ***************************************************************** * DB読み込み処理 ***************************************************************** 920-DBFETCH-SEC SECTION. * MOVE "DBFETCH" TO MCP-FUNC grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . * 920-DBFETCH-EXT. EXIT. * ***************************************************************** * DBクローズ処理 ***************************************************************** 990-DBCLOSE-SEC SECTION. * MOVE "DBCLOSECURSOR" TO MCP-FUNC grpsys CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 990-DBCLOSE-EXT. EXIT. ***************************************************************** * パラメタ情報読み込み ***************************************************************** 990-PARA-READ-SEC SECTION. * PERFORM 920-DBFETCH-SEC IF MCP-RC = ZERO MOVE
COBOL
MCPDATA-REC TO PARA-REC MOVE ZERO TO FLG-PARA ELSE INITIALIZE PARA-REC MOVE 1 TO FLG-PARA END-IF * . 990-PARA-READ-EXT. EXIT. * <|end_of_text|> 01 OUT-VEKTOR. 05 DIM-O PIC 9(04) COMP-3. * Output-Vector 05 XK PIC S9(06)V9(16) OCCURS 1 TO 1000 DEPENDING ON DIM-O COMP-3. <|end_of_text|>000010************************************************ 000020* (KAI_KIHON) 000030************************************************ 000040 01 ()Œ_–ñ”ԍ† PIC X(9). 000050 01 ()–¼Šñ‚¹ƒR[ƒh PIC X(8). 000060 01 ()ƒ†[ƒU[ƒR[ƒh PIC X(8). 000070 01 ()Žæˆøæ–¼Š¿Žš PIC N(30). 000080 01 ()Žæˆøæ–¼ƒJƒi PIC N(15). 000090 01 ()Ž–‹ÆŠƒR[ƒh PIC X(4). 000100 01 ()Œ_–ñ“ú PIC X(8). 000110 01 ()ŒŸŽû“ú PIC X(8). 000120 01 ()ƒŠ[ƒXŠúŠÔ PIC S9(3) COMP-3. 000130 01 ()Š¨’菈—ƒR[ƒh PIC X(2). 000140 01 ()’èŠzƒŠ[ƒX—¿ PIC S9(13) COMP-3. 000150 01 ()‘OŽóƒŠ[ƒX—¿ PIC S9(13) COMP-3. 000160 01 ()‘OŽóƒŠ[ƒX—¿“ü‹à“ú PIC X(8). 000170 01 ()Œ_–ñ‹àŠz PIC S9(13) COMP-3. 000180 01 ()ŒŽŠzŒÅ’莑ŽYÅ PIC S9(13) COMP-3. 000190 01 ()ŒŽŠz•ÛŒ¯—¿ PIC S9(13) COMP-3. 000200 01 ()ŒŽŠz•ÛŽç—¿ PIC S9(13) COMP-3. 000210 01 ()‚»‚Ì‘¼‚P PIC S9(13) COMP-3. 000220 01 ()‚»‚Ì‘¼‚Q PIC S9(13) COMP-3. 000230 01 ()Šî–{—˜‰ñ‚è PIC S9(2)V9(8) COMP-3. 000240 01 ()ŽÀŽ¿—˜‰ñ‚è PIC S9(2)V9(8) COMP-3. 000250 01 ()‰Šú”ï—p PIC S9(13) COMP-3. 000260 01 ()¿‹ƒTƒCƒNƒ‹ PIC S9(2) COMP-3. 000270 01 ()Žx•¥‰ñ” PIC S9(3) COMP-3. 000280 01 ()˜’uŒŽ” PIC S9(3) COMP-3. 000290 01 ()BEGIN‰ñ” PIC S9(1) COMP-3. 000300 01 ()Žc‰¿‰ñŽû“ú PIC X(8). 000310 01 ()“ü‹à“ú PIC X(2). 000320 01 ()‘æ‚P‰ñƒŠ[ƒX—¿“ü‹à“ú PIC X(8). 000330 01 ()‘æ‚Q‰ñƒŠ[ƒX—¿“ü‹à“ú PIC X(8). 000340 01 ()ÄƒŠ[ƒXƒR[ƒh PIC X(1). 000350 01 ()Žè”—¿¿‹ƒR[ƒh PIC X(2). 000360 01 ()ƒŠ[ƒXI—¹“ú PIC X(8). 000370 01 ()w“ü‹àŠz‡Œv PIC S9(13) COMP-3. 000380 01 ()Žc‰¿Šz‡Œv PIC S9(13) COMP-3. 000390 01 ()Á”ïÅ—¦ PIC S9(2)V9(1) COMP-3. 000400 01 ()Á”ïÅ’¥Žû‹æ•ª PIC X(1). 000410 01 ()Â–±‹¦’²ƒR[ƒh PIC X(2). 000420 01 ()ƒŠ[ƒX—¿[“–”NŒŽ‘OŒŽ PIC X(6). 000430 01 ()[“–‰ñ”‘OŒŽ PIC S9(3) COMP-3. 000440 01 ()ƒŠ[ƒX—¿‘OŒŽ PIC S9(13) COMP-3. 000450 01 ()ÂŒ Žc‚‘OŒŽ PIC S9(13) COMP-3. 000460 01 ()‘OŽóƒŠ[ƒX—¿Žc‚‘OŒŽ PIC S9(13) COMP-3. 000470 01 ()ƒŠ[ƒX—¿[“–”NŒŽ“–ŒŽ PIC X(6). 000480 01 ()[“–‰ñ”“–ŒŽ PIC S9(3) COMP-3. 000490 01 ()ƒŠ[ƒX—¿“–ŒŽ PIC S9(13) COMP-3. 000500 01 ()ÂŒ Žc‚“–ŒŽ PIC S9(13) COMP-3. 000510 01 ()‘OŽóƒŠ[ƒX—¿Žc‚“–ŒŽ PIC S9(13) COMP-3. 000520 01 ()ƒŠ[ƒX—¿[“–”NŒŽ—‚ŒŽ PIC X(6). 000530 01 ()[“–‰ñ”—‚ŒŽ PIC S9(3) COMP-3. 000540 01 ()ƒŠ[ƒX—¿—‚ŒŽ PIC S9(13) COMP-3. 000550 01 ()ÂŒ Žc‚—‚ŒŽ PIC S9(13) COMP-3. 000560 01 ()‘OŽóƒŠ[ƒX—¿Žc‚—‚ŒŽ PIC S9(13) COMP-3. 000570 01 ()–¢‰ñŽûŒ³–{Žc‚ PIC S9(13) COMP-3. 000580 01 ()–¢’¥Žû•ÛŒ¯—¿ PIC S9(13) COMP-3. 000590 01 ()–¢’¥ŽûTAX PIC S9(13) COMP-3. 000600 01 ()Œo‰ßŒŽ” PIC S9(3) COMP-3. 000610 01 ()‘OŽó[“–ŠJŽn”NŒŽ PIC X(6). 000620 01 ()‘OŽó[“–ŠJŽn[“–Šz PIC S9(13) COMP-3. 000630 01 ()‰ñŽû•ûŽ® PIC X(1). 000640 01 ()‹âsƒR[ƒh PIC X(7). 000650 01 ()‹âs–¼ƒJƒi PIC N(15). 000660 01 ()ŒûÀ”ԍ† PIC X(7). 000670 01 ()—a‹àŽí—Þ PIC X(1). 000680 01 ()¿‹æƒR[ƒh PIC X(8). 000690 01 ()ŒvŽZ•ûŽ® PIC X(1). 000700 01 ()ƒf[ƒ^Ž¯•ÊƒR[ƒh PIC X(2). 000710 01 ()•¶Œ¾”ԍ† PIC S9(2) COMP-3. 000720 01 ()•¶Œ¾ PIC N(300). 000730 01 ()ˆÙ—áFLG PIC
COBOL
X(1). 000740 01 ()“o˜^“ú PIC X(8). 000750 01 ()“o˜^Žž PIC X(6). 000760 01 ()“o˜^’S“–ŽÒƒR[ƒh PIC X(4). 000770 01 ()XV“ú PIC X(8). 000780 01 ()XVŽž PIC X(6). 000790 01 ()XV’S“–ŽÒƒR[ƒh PIC X(4). 000800 01 ()‰‰ñƒŠ[ƒX—¿ PIC S9(13) COMP-3. <|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. HWTHXCB1. * START OF SPECIFICATIONS * * * * * * * * * * * * * * * * * * * * * * * Beginning of Copyright and License * * * * Copyright 2019 IBM Corp. * * * * Licensed under the Apache License, Version 2.0 (the "License");* * you may not use this file except in compliance with the * * License. * * You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, * * software distributed under the License is distributed on an * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * * either express or implied. See the License for the specific * * language governing permissions and limitations under the * * License. * * * * End of Copyright and License * *----------------------------------------------------------------* * * * MODULE NAME=HWTHXCB1 * * * * DESCRIPTIVE NAME=Sample Cobol code calls to HTTP services * * * * FUNCTION * * * * This particular sample shows a sample invocation of a * * published REST API get Airport information. Using simple * * programming techniques, the sample connects to the host * * and then issues a simple HTTP request to get the desired * * info. To tie it all together, it then invokes the other * * part of the z/OS Client Web Enablement Toolkit (the z/OS * * JSON parser) to parse thru the values to quickly report on * * a couple of values returned that are of interest. * * * * Test your access to this URL in a browser * * (or better yet use CURL in OMVS): * * http://www.airport-data.com/api/ap_info.json?iata=LAX * * It should return something like this: * * {"icao":"KLAX","iata":"LAX", * * "name":"Los Angeles International Airport", * * "location":"Los Angeles, CA", * * "country":"United States", * * "country_code":"US", * * "longitude":"-118.408068", * * "latitude":"33.942495", * * "link":"http:\/\/www.airport-data.com\/airport\/LAX\/", * * "status":200} * * * * This module provides sample calls to these HTTP Enabler * * services: * * HWTHINIT - Initialize a connection and request instance. * * HWTHSET - Set various connection and request options * * HWTHCONN - Connect to a web server. * * HWTHRQST - Send an HTTP request over an existing * * connection * * HWTHDISC - Disconnect from a web server. * * HWTHTERM - Terminate a connection and request instance. * * * * OPERATION: * * * * CODE FLOW in this sample: * * Call HTTP-Init-Connection to create a connection instance. * * Call HTTP-Setup-Connection to set all the necessary * * connection options prior to connecting to the web server. * * Call HTTP-Connect to connect to the web server. * * Call HTTP-Init-Request to create a request instance. * * Call HTTP-Setup-Request to set necessary request options * * Call HTTP-Request to send the request over the established * * connection. * * * Response Header exit (HWTHHDRX) receives control for * * each response header received from the HTTP server * * * Response Body exit (HWTHBDYX) receives control with the * * response body received from the HTTP server. * * Call HTTP-Terminate to terminate the request instance. * * Call HTTP-Disconnect to disconnect the connection (socket) * * from the web server. * * Call HTTP-Terminate to terminate the connection instance. * * * * DEPENDENCIES * * * * 1. Include the copy library HWTHICOB. * * * * NOTES: * * * * No recovery logic has been supplied in this sample. * * * * JCL Method: * * ----------- * * * * Sample JCL to compile, link edit the program. * * * * //XCBLCLG JOB NOTIFY=????????, * * // REGION=0M,MSGLEVEL=1,MSGCLASS=H * * //* * * // JCLLIB ORDER=(SYS1.SIGYPROC) * * //* * * // Set SRC=HWTHXCB1 < INPUT... REQUIRED * * // Set SAMPLIB=SYS1.SAMPLIB < INPUT... REQUIRED * * // Set MACLIB=SYS1.MACLIB < COPYBOOK... REQUIRED * * // Set CSSLIB=SYS1.CSSLIB < CSSLIB... REQUIRED * * // Set LOAD=HWT.SAMPLE.PDSE.LOAD < OUTPUT... REQUIRED * * //* * * //CL EXEC PROC=IGYWCL, * * // PARM.COBOL='LIST', * * // PARM.LKED='REUS(RENT)', * * // LNGPRFX='SYS1', * * // LIBPRFX='ZOS220.CEE' * * //COBOL.SYSIN DD DSN=&SAMPLIB(&SRC),DISP=SHR * * //COBOL.SYSLIB DD DSN=&MACLIB,DISP=SHR * * //LKED.SYSLMOD DD DSN=&LOAD(&SRC),DISP=SHR * * //LKED.SYSLIB DD DSN=&CSSLIB,DISP=SHR * * // DD DSN=&LIBPRFX..SCEELKED,DISP=SHR * * // DD DSN=&LIBPRFX..SCEELKEX,DISP=SHR * * //GO EXEC PGM=&SRC,PARM='AIRPORT_NAME/POSIX(ON)' * * //STEPLIB DD DSN=&LOAD,DISP=SHR * * //SYSPRINT DD SYSOUT=* * * //* * * //* where AIRPORT_NAME is the IATA 3 character airport code * * //* (e.g. LAX) * * //* * * -------------------------------------------------------------- * * REFERENCE: * * See the z/OS MVS Programming: Callable Services for * * High-Level Languages publication for more information * * regarding the usage of HTTP Enabler APIs. * * * * Change Activity: * * $L0 ------ z/OS Client Web Enablement * * Tookit sample (HTTP) in Cobol programming language * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * * * * * * * DATA DIVISION. WORKING-STORAGE SECTION. * Global vars required for majority of HTTP services 01 Conn-Handle Pic X(12) Value Zeros. 01 Rqst-Handle Pic X(12) Value Zeros. 01 Diag-Area Pic X(136) Value Zeros. * Slist is used to pass custom HTTP headers on request 01 Slist-Handle Pic 9(9) Binary Value 0. * Dummy vars used by HWTHSET service 01 option-val-char Pic X(999) Value Spaces.
COBOL
01 option-val-numeric Pic 9(9) Binary Value 0. 01 option-val-addr Pointer Value Null. 01 option-val-len Pic 9(9) Binary Value 0. * Function pointers used to setup response exit routines 01 header-cb-ptr Function-Pointer Value Null. 01 rspbdy-cb-ptr Function-Pointer Value Null. * Data passed to the response header exit routine 01 hdr-udata. 05 hdr-udata-eye Pic X(8) Value 'HDRUDATA'. 05 hdr-rspcode-ptr Pointer Value Null. 05 hdr-count-ptr Pointer value Null. 05 hdr-flags-ptr Pointer Value Null. * Response status code returned from the server * This gets passed to the response header exit * through the header user data structure 01 http-resp-code Pic 9(9) Binary Value 0. * Count of HTTP headers processed by our exit 01 http-hdr-count Pic 9(9) Binary Value 0. * Data passed to the response body exit routine 01 body-udata. 05 body-udata-eye Pic X(8) Value 'BDYUDATA'. 05 hdr-flags-ptr Pointer Value Null. 05 resp-body-data-ptr Pointer Value Null. * Flag shared between response body and response header exits * Used by the response header exit to indicate that the response * body is JSON. 01 hdr-flags. 05 json-response-flag Pic 9. 88 json-response-true Value 1. 88 json-response-false Value 0. 01 request-status-flag Pic 9. 88 request-successful Value 1. 88 request-unsuccessful Value 0. * Structure for storing data returned from FAA website * Filled out by the response body exit 01 resp-body-data. 05 resp-body-data-eye Pic X(8) Value 'AIRPORT'. 05 airport-info. 10 airport-name Pic X(50). 10 airport-iata Pic X(6). 10 airport-state Pic X(30). 10 airport-country Pic X(50). 10 airport-lat Pic X(30). 10 airport-long Pic x(30). 10 airport-status-type Pic X(30). 10 airport-status-reason Pic X(30). 10 airport-average-delay Pic X(30). 10 airport-weather-cond Pic X(30). 10 airport-temp Pic X(30). 10 airport-wind Pic X(30). 10 airport-delay-flag Pic 9. 88 airport-delay-true Value 1. 88 airport-delay-false Value 0. * COPY HWTHICOB. * LINKAGE SECTION. * User-supplied parameter: expecting a 3-char IATA airport code 01 jcl-parm. 05 parm-len Pic S9(3) binary. 05 parm-string. 10 parm-char Pic X occurs 0 to 100 times depending on parm-len. PROCEDURE DIVISION using jcl-parm. Begin. Display "***********************************************". Display "** HTTP Web Enablement Toolkit Sample Begins **". If parm-len not equal 3 then Display "** Bogus IATA airport code specified! **" Display "** Terminating Sample **" Display "***********************************************" Stop Run End-if *> Initialize and set up a connection handle Perform HTTP-Init-Connection If (HWTH-OK) *> Set the required options before connecting to the server Perform HTTP-Setup-Connection If (HWTH-OK) *> Connect to the HTTP server Perform HTTP-Connect If (HWTH-OK) *> Initialize and set up a request Perform HTTP-Init-Request If (HWTH-OK) *> Set the necessary options before connecting *> to the server. Perform HTTP-Setup-Request If (HWTH-OK) *> Send the request Perform HTTP-Issue-Request If (HWTH-OK) *> If the response code was ok, write the data If http-resp-code equal 200 then Perform Display-Airport-Data Set request-successful to true End-If End-If End-If *> Terminate the request Perform HTTP-Terminate-Request End-If *> Disconnect the connection Perform HTTP-Disconnect End-If End-If *> Terminate the connection Perform HTTP-Terminate-Connection End-If *> If the last service was successful and the request *> completed successfully, then put successful message If HWTH-OK AND request-successful then Display "** Program Ended Successfully **" else Display "** Program Ended Unsuccessfully **" End-if Display "** HTTP Web Enablement Toolkit Sample Ends **". Display "***********************************************". STOP RUN. **************************************************************** * * * Function: HTTP-Init-Connection * * Initializes a connection handle using the HWTHINIT service * * * **************************************************************** HTTP-Init-Connection. Set HWTH-HANDLETYPE-CONNECTION to true. Call "HWTHINIT" using HWTH-RETURN-CODE HWTH-HANDLETYPE Conn-Handle HWTH-DIAG-AREA If (HWTH-OK) Display "** Initialize succeeded (HWTHINIT)" else Display "HWTHINIT FAILED: " Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . **************************************************************** * * * Function: HTTP-Init-Request * * Initializes a request handle using the HWTHINIT service * * * **************************************************************** HTTP-Init-Request. Set HWTH-HANDLETYPE-HTTPREQUEST to true. Call "HWTHINIT" using HWTH-RETURN-CODE HWTH-HANDLETYPE Rqst-Handle HWTH-DIAG-AREA If (HWTH-OK) Display "** Initialize succeeded (HWTHINIT)" else Display "HWTHINIT FAILED: " Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * Function: HTTP-Setup-Connection * * Sets the necessary connection options * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** HTTP-Setup-Connection. *> ______________________________________________________ *> | | *> | First, set the verbose option on. This option is | *> | handy when developing an application. Lots of | *> | informational error messages are written to | *> | standard output to help in debugging efforts. | *> | This option should likely be turned off with | *> | HWTH_VERBOSE_OFF or just not set at all (default is | *> | off) when the application goes into production. | *> |______________________________________________________| Set HWTH-OPT-VERBOSE to true. Set HWTH-VERBOSE-ON to true. Set option-val-addr to address of HWTH-VERBOSE. Compute option-val-len = function length (HWTH-VERBOSE). Display "** Set HWTH-OPT-VERBOSE for connection". Call "HWTHSET" using HWTH-RETURN-CODE Conn-Handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA. If HWTH-OK *> ______________________________________________________ *> | | *> | Set URI for connection handle. | *> |______________________________________________________| Set HWTH-OPT-URI to true Move "http://www.airport-data.com" to option-val-char Move 27 to option-val-len *> Alternate test: Use local server *> Move "http://10.0.0.117" to option-val-char *> Move 17 to option-val-len Set option-val-addr to address of option-val-char Display "** Set HWTH-OPT-URI for connection" Call "HWTHSET" using HWTH-RETURN-CODE Conn-Handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA End-If If HWTH-OK *> ______________________________________________________ *> | | *> | Set Port for connection handle. | *> | Port 80 is the default, but code is included | *>
COBOL
| to illustrate how to set a port if necessary | *> |______________________________________________________| Set HWTH-OPT-PORT to true Set option-val-addr to address of option-val-numeric Compute option-val-len = function length (option-val-numeric) move 80 to option-val-numeric Display "** Set HWTH-OPT-PORT for connection" Call "HWTHSET" using HWTH-RETURN-CODE Conn-Handle HWTH-SET-OPTION option-val-addr option-val-len HWTH-DIAG-AREA End-If If HWTH-OK *> ______________________________________________________ *> | | *> | Set HWTH_OPT_COOKIETYPE | *> | Enable the cookie engine for this connection. Any | *> | "eligible" stored cookies will be resent to the | *> | host on subsequent interactions automatically. | *> | interactions automatically. | *> |______________________________________________________| Set HWTH-OPT-COOKIETYPE to true Set HWTH-COOKIETYPE-SESSION to true Set option-val-addr to address of HWTH-COOKIETYPE Compute option-val-len = function length (HWTH-COOKIETYPE) Display "** Set HWTH-OPT-COOKIETYPE for connection" Call "HWTHSET" using HWTH-RETURN-CODE Conn-Handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA else Display "HWTHSET FAILED: " Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . **************************************************************** * * * Function: HTTP-Connect * * Issues the hwthconn service and performs error checking * * * **************************************************************** HTTP-Connect. Call "HWTHCONN" using HWTH-RETURN-CODE Conn-Handle HWTH-DIAG-AREA If (HWTH-OK) Display "** Connect succeeded (HWTHCONN)" else Display "Connect failed (HWTHCONN)." Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . **************************************************************** * * * Function: HTTP-Issue-Request * * Issues the hwthrqst service and performs error checking * * * **************************************************************** HTTP-Issue-Request. Call "HWTHRQST" using HWTH-RETURN-CODE Conn-Handle Rqst-Handle HWTH-DIAG-AREA If (HWTH-OK) Display "** Request succeeded (HWTHRQST)" else Display "Request failed (HWTHRQST)." Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * Function: HTTP-Setup-Request * * Sets the necessary request options * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** HTTP-Setup-Request. *> ______________________________________________________ *> | | *> | Set HTTP Request method. | *> | A GET request method is used to get data from | *> | the server. | *> |______________________________________________________| Set HWTH-OPT-REQUESTMETHOD to true. Set HWTH-HTTP-REQUEST-GET to true. Set option-val-addr to address of HWTH-REQUESTMETHOD. Compute option-val-len = function length (HWTH-REQUESTMETHOD). Display "** Set HWTH-REQUESTMETHOD for request" Call "HWTHSET" using HWTH-RETURN-CODE rqst-handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA If HWTH-OK *> ______________________________________________________ *> | | *> | Set the request URI | *> | Set the URI that identifies a resource by name | *> | that is the target of our request. | *> |______________________________________________________| Set HWTH-OPT-URI to true Move 1 to option-val-len STRING "/api/ap_info.json?iata=" DELIMITED BY SIZE parm-string(1:parm-len) DELIMITED BY SIZE INTO option-val-char WITH POINTER option-val-len *> Alternate test: Use local server *> STRING "/index.htm" *> DELIMITED BY SIZE *> parm-string(1:parm-len) DELIMITED BY SIZE *> INTO *> option-val-char WITH POINTER option-val-len Set option-val-addr to address of option-val-char SUBTRACT 1 FROM option-val-len Display "** Set HWTH-OPT-URI for request" Call "HWTHSET" using HWTH-RETURN-CODE rqst-handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA End-If If HWTH-OK *> Create a list of HTTP headers Perform Build-Slist *> Specify the HTTP request headers Set HWTH-OPT-HTTPHEADERS to true Set option-val-addr to address of Slist-Handle Compute option-val-len = function length(Slist-Handle) Display "** Set HWTH-OPT-HTTPHEADERS for request" Call "HWTHSET" using HWTH-RETURN-CODE rqst-handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA End-If If HWTH-OK *> Direct the toolkit to convert the response body *> from ASCII to EBCDIC Set HWTH-OPT-TRANSLATE-RESPBODY to true Set HWTH-XLATE-RESPBODY-A2E to true Set option-val-addr to address of HWTH-XLATE-RESPBODY Compute option-val-len = function length (HWTH-XLATE-RESPBODY) Display "** Set HWTH-OPT-TRANSLATE-RESPBODY for request" Call "HWTHSET" using HWTH-RETURN-CODE rqst-handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA End-If If HWTH-OK *> ______________________________________________________ *> | | *> | Set the response header callback routine | *> | Set the address of the routine that is to receive | *> | control once for every response header that we | *> | receive | *> |______________________________________________________| Set HWTH-OPT-RESPONSEHDR-EXIT to true Set header-cb-ptr to ENTRY "HWTHHDRX" Set option-val-addr to address of header-cb-ptr Compute option-val-len = function length (header-cb-ptr) Display "** Set HWTH-OPT-RESPONSEHDR-EXIT for request" Call "HWTHSET" using HWTH-RETURN-CODE rqst-handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA End-If If HWTH-OK *> Initialize the header user data pointers to allow *> the response header exit to communicate the HTTP status *> code and hdr-flags to the main program Set hdr-rspcode-ptr to address of http-resp-code Set hdr-count-ptr to address of http-hdr-count Set hdr-flags-ptr of hdr-udata to address of hdr-flags *> ______________________________________________________ *> | | *> | Set the response header callback routine user data | *> | Example to show how data can be passed to the | *> | response header callback routine to allow the | *> | routine to customize its processing. | *> |______________________________________________________| Set HWTH-OPT-RESPONSEHDR-USERDATA to true Set option-val-addr to address of hdr-udata Compute option-val-len = function length(hdr-udata) Display "** Set HWTH-OPT-RESPONSEHDR-USERDATA for request" Call "HWTHSET" using HWTH-RETURN-CODE rqst-handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA End-If If HWTH
COBOL
-OK *> ______________________________________________________ *> | | *> | Set the response body callback routine | *> | Set the address of the routine that is to receive | *> | control if there is a response body returned by | *> | the server | *> |______________________________________________________| Set HWTH-OPT-RESPONSEBODY-EXIT to true Set rspbdy-cb-ptr to ENTRY "HWTHBDYX" Set option-val-addr to address of rspbdy-cb-ptr Compute option-val-len = function length (rspbdy-cb-ptr) Display "** Set HWTH-OPT-RESPONSEBODY-EXIT for request" Call "HWTHSET" using HWTH-RETURN-CODE rqst-handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA End-If If HWTH-OK *> ______________________________________________________ *> | | *> | Set the response body callback routine user data | *> | Example to show how data can be passed to the | *> | response body callback routine to allow the routine| *> | to customize its processing. | *> |______________________________________________________| Set hdr-flags-ptr of body-udata to address of hdr-flags Set resp-body-data-ptr to address of resp-body-data Set HWTH-OPT-RESPONSEBODY-USERDATA to true Set option-val-addr to address of body-udata Compute option-val-len = function length(body-udata) Display "** Set HWTH-OPT-RESPONSEBODY-USERDATA for request" Call "HWTHSET" using HWTH-RETURN-CODE rqst-handle HWTH-Set-OPTION option-val-addr option-val-len HWTH-DIAG-AREA End-If . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * Function: Build-Slist * * Sets the necessary request options * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** Build-Slist. *> ______________________________________________________ *> | | *> | Add the Accept request header | *> | Create a brand new SLST and specify the first | *> | header to be an "ACCEPT" header that requests that | *> | the server return the data requested by the GET | *> | request to be in JSON format. | *> |______________________________________________________| Move 1 to option-val-len. String "Accept: application/json" delimited by size into option-val-char with pointer option-val-len. Subtract 1 from option-val-len. Set option-val-addr to address of option-val-char. Set HWTH-SLST-NEW to true. Call "HWTHSLST" using HWTH-RETURN-CODE rqst-handle HWTH-SLST-function Slist-Handle option-val-addr option-val-len HWTH-DIAG-AREA. If HWTH-OK *> ______________________________________________________ *> | | *> | Add the Accept-Language request header | *> | Append to the just-created SLST and specify an | *> | additional option "Accept-Language" to infer to | *> | the server the regional settings preferred by this | *> | application. | *> |______________________________________________________| Move 1 to option-val-len String "Accept-Language: en-US" delimited by size into option-val-char with pointer option-val-len Subtract 1 from option-val-len Set option-val-addr to address of option-val-char Set HWTH-SLST-APPEND to true Display "** Adding SLIST APPEND" Call "HWTHSLST" using HWTH-RETURN-CODE rqst-handle HWTH-SLST-function Slist-Handle option-val-addr option-val-len HWTH-DIAG-AREA else Display "Slist service failed (HWTHSLST)." Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . **************************************************************** * * * Display-Airport-Data * * * * Function: Write the airport data * * For simplicity, this sample outputs the data to standard * * out. In a real world application, this data could be * * displayed real-time in an application, written to storage * * media or displayed in some log or other media. * * * **************************************************************** Display-Airport-Data. Display "***********************************". Display "Airport data for " airport-iata. Display "***********************************". Display "Airport name: " airport-name. Display "Airport state: " airport-state. Display "Airport country: " airport-country. Display "Airport longitude: " airport-long. Display "Airport latitude: " airport-lat. Display "-----------------------------------". **************************************************************** * * * Function: HTTP-Disconnect * * Issues the hwthdisc service and performs error checking * * * **************************************************************** HTTP-Disconnect. Call "HWTHDISC" using HWTH-RETURN-CODE Conn-Handle HWTH-DIAG-AREA If (HWTH-OK) Display "** Disconnect succeeded (HWTHDISC)" else Display "Disconnect failed (HWTHDISC)." Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . **************************************************************** * * * Function: HTTP-Terminate-Connection * * Issues the hwthterm service and performs error checking * * * **************************************************************** HTTP-Terminate-Connection. Set HWTH-NOFORCE to true. Call "HWTHTERM" using HWTH-RETURN-CODE Conn-Handle HWTH-FORCETYPE HWTH-DIAG-AREA. If (HWTH-OK) Display "** Terminate succeeded (HWTHTERM)" else Display "Terminate failed (HWTHTERM)." Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . **************************************************************** * * * Function: HTTP-Terminate-Request * * Issues the hwthterm service and performs error checking * * * **************************************************************** HTTP-Terminate-Request. Set HWTH-NOFORCE to true. Call "HWTHTERM" using HWTH-RETURN-CODE Rqst-Handle HWTH-FORCETYPE HWTH-DIAG-AREA. If (HWTH-OK) Display "** Terminate succeeded (HWTHTERM)" else Display "Terminate failed (HWTHTERM)." Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * Function: Set-Http-Option * * Sets the specified HTTP option * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** IDENTIFICATION DIVISION. PROGRAM-ID Set-Http-Option COMMON. DATA DIVISION. LINKAGE SECTION. 01 handle Pic X(12). 01 option Pic 9(9) Binary. 01 option-val-addr USAGE POINTER. 01 option-val-len Pic 9(9) Binary. PROCEDURE DIVISION using handle, option, option-val-addr, option-val-len. Begin. Call "HWTHSET" using HWTH-RETURN-CODE handle option option-val-addr option-val-len HWTH-DIAG-AREA. If (HWTH-OK) Display "** Set succeeded (HWTHSET)" else Display "Set failed (HWTHSET)." Call "DSPHDIAG" using HWTH-RETURN-CODE HWTH-DIAG-AREA End-If . End Program Set-Http-Option. End Program HWTHXCB1. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
COBOL
** * Function: HWTHHDRX * * Sample Response Header Callback Routine (Exit) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** IDENTIFICATION DIVISION. PROGRAM-ID HWTHHDRX. DATA DIVISION. WORKING-STORAGE SECTION. 01 Content-Type Pic X(12) Value "CONTENT-TYPE". 01 Json-Content Pic X(16) Value "APPLICATION/JSON". 01 Max-Display-Size Pic 9(9) Binary Value 30. 01 rsp-status-code Pic 9(9) Binary Value 0. LOCAL-STORAGE SECTION. 01 name-max-len Pic 9(9) Binary Value 0. 01 value-max-len Pic 9(9) Binary Value 0. 01 name-ucase Pic X(999) Value Spaces. 01 value-ucase Pic X(999) Value Spaces. 01 Content-Type-Len Pic 9(9) Binary Value 0. 01 Json-Content-Len Pic 9(9) Binary Value 0. 01 HWTH-RESP-EXIT-FLAGS Global Pic 9(9) Binary. 88 HWTH-EXITFLAG-COOKIESTORE-FULL Value 1. 01 HWTH-RESP-EXIT-RC GLOBAL PIC 9(9) BINARY. 88 HWTH-RESP-EXIT-RC-OK VALUE 0. 88 HWTH-RESP-EXIT-RC-ABORT VALUE 1. LINKAGE SECTION. 01 http-resp-line Pic X(20). 01 exit-flags Pic 9(9) Binary. 01 hdr-name-ptr Usage Pointer. 01 hdr-name-len Pic 9(9) Binary. 01 hdr-value-ptr Usage Pointer. 01 hdr-value-len Pic 9(9) Binary. 01 hdr-udata-ptr Usage Pointer. 01 hdr-udata-len Pic 9(9) Binary. 01 hdr-name-dsect Pic X(999). 01 hdr-value-dsect Pic X(999). 01 reason-dsect Pic X(128). 01 hdr-udata. 05 hdr-udata-eye Pic X(8). 05 hdr-rspcode-ptr Pointer. 05 hdr-count-ptr Pointer. 05 hdr-flags-ptr Pointer. 01 http-resp-code Pic 9(9) Binary. 01 http-hdr-count Pic 9(9) Binary. 01 hdr-flags. 05 json-response-flag Pic 9. 88 json-response-true Value 1. 88 json-response-false Value 0. 01 HWTH-RESP-STATUS-MAP. 05 HWTH-STATUS-CODE Pic 9(9) Binary. 05 HWTH-STATUS-VERS-PTR Pointer. 05 HWTH-STATUS-VERS-LEN Pic 9(9) Binary. 05 HWTH-STATUS-REASON-PTR Pointer. 05 HWTH-STATUS-REASON-LEN Pic 9(9) Binary. PROCEDURE DIVISION using http-resp-line, exit-flags hdr-name-ptr, hdr-name-len, hdr-value-ptr, hdr-value-len, hdr-udata-ptr, hdr-udata-len. Begin. Display "*******************************************". Display "** Response Header Exit Receives Control **". *> Make sure hdr-udata was specified If hdr-udata-ptr = Null then Display "No header user data was specified!" *> Direct the toolkit to halt further header processing Set HWTH-RESP-EXIT-RC-ABORT to true Compute Return-Code = HWTH-RESP-EXIT-RC EXIT PROGRAM End-If *> Establish addressability to the userdata structure Set address of hdr-udata to hdr-udata-ptr. Set address of hdr-flags to hdr-flags-ptr. Set address of http-resp-code to hdr-rspcode-ptr. Set address of http-hdr-count to hdr-count-ptr. *> ______________________________________________________ *> | | *> | Establish addressability to the HTTP response line | *> | The response status line contains the HTTP version, | *> | status code, and reason phrase (e.g. HTTP/1.1 200 OK)| *> |______________________________________________________| Set address of HWTH-RESP-STATUS-MAP to address of http-resp-line. *> Write status code and reason phrase the first time the *> header exit receives control If http-resp-code = ZERO then Set address of reason-dsect to HWTH-STATUS-REASON-PTR Display "** HTTP Status Code: " HWTH-STATUS-CODE Display "** HTTP Reason Phrase: " reason-dsect(1:HWTH-STATUS-REASON-LEN) Move HWTH-STATUS-CODE to http-resp-code End-If *> Increment the header count Compute http-hdr-count = http-hdr-count + 1. If http-resp-code NOT EQUAL 200 then *> Direct the toolkit to halt further header processing Set HWTH-RESP-EXIT-RC-ABORT to true Compute Return-Code = HWTH-RESP-EXIT-RC EXIT PROGRAM End-If *> Check the exit flags for the cookie store full condition If exit-flags NOT EQUAL 0 then Move exit-flags to HWTH-RESP-EXIT-FLAGS If HWTH-EXITFLAG-COOKIESTORE-FULL then Display "Cookie Store Full!" else Display "Other exit flag found." End-If End-If *> Truncate the header name for display purposes Set address of hdr-name-dsect to hdr-name-ptr. Compute name-max-len = function Min(MAX-DISPLAY-SIZE, hdr-name-len). *> Truncate the header value for display purposes Set address of hdr-value-dsect to hdr-value-ptr. Compute value-max-len = function Min(MAX-DISPLAY-SIZE, hdr-value-len). *> Display the header name and value Display " Response Header " http-hdr-count. Display " Name: " hdr-name-dsect(1:name-max-len). Display " Value: " hdr-value-dsect(1:value-max-len). *> ________________________________________________________ *> | | *> | Did we receive the header for the content type and | *> | is the value application/json? | *> |________________________________________________________| *> Fold everything to uppercase for comparison String function Upper-Case(hdr-name-dsect(1:name-max-len)) delimited by size into name-ucase. String function Upper-Case(hdr-value-dsect(1:value-max-len)) delimited by size into value-ucase. *> Compare only the required number of bytes Compute Content-Type-Len = function length(Content-Type). Compute Json-Content-Len = function length(Json-Content). If name-ucase(1:Content-Type-Len) = Content-Type then If value-ucase(1:Json-Content-Len) = Json-Content then Set json-response-true to true End-If End-If Display "** Response Header Exit Returns **". Display "*******************************************". End Program HWTHHDRX. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * function: HWTHBDYX * * Callback routine used to process the response body * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** IDENTIFICATION DIVISION. PROGRAM-ID HWTHBDYX. DATA DIVISION. WORKING-STORAGE SECTION. 01 Name-Key Pic X(4) Value 'name'. 01 Iata-Key Pic X(4) Value 'iata'. 01 State-Key Pic X(8) Value 'location'. 01 Country-Key Pic X(7) Value 'country'. 01 Long-Key Pic X(9) Value 'longitude'. 01 Lat-Key Pic x(8) Value 'latitude'. 01 Delay-Key Pic X(5) Value 'delay'. 01 Type-Key Pic X(4) Value 'type'. 01 Reason-Key Pic X(6) Value'reason'. 01 Avg-Delay-Key Pic X(8) Value 'avgDelay'. 01 Weather-Key Pic X(7) Value 'weather'. 01 Temp-Key Pic X(4) Value 'temp'. 01 Wind-Key Pic X(4) Value 'wind'. COPY HWTJICOB. LOCAL-STORAGE SECTION. 01
COBOL
root-object Pic 9(9) Binary Value 0. 01 status-object Pic 9(9) Binary Value 0. 01 weather-object Pic 9(9) Binary Value 0. 01 search-string Pic X(10) Value Spaces. 01 search-string-len Pic 9(9) Binary Value 0. 01 search-string-ptr Pointer Value Null. 01 search-result-ptr Pointer Value Null. 01 search-result-len Pic 9(9) Binary Value 0. 01 data-copy-len Pic 9(9) Binary Value 0. 01 workarea-max Pic 9(9) Binary Value 0. LINKAGE SECTION. 01 http-response Pic X(20). 01 exit-flags Pic X(4). 01 resp-body-ptr Pointer. 01 resp-body-len Pic 9(9) Binary. 01 body-udata-ptr Pointer. 01 body-udata-len Pic 9(9) Binary. 01 body-udata. 05 resp-body-eye Pic X(8). 05 hdr-flags-ptr Pointer. 05 resp-body-data-ptr Pointer. 01 hdr-flags. 05 json-response-flag Pic 9. 88 json-response-true Value 1. 88 json-response-false Value 0. 01 resp-body-data. 05 resp-body-data-eye Pic X(8). 05 airport-info. 10 airport-name Pic X(50). 10 airport-iata Pic X(6). 10 airport-state Pic X(30). 10 airport-country Pic X(50). 10 airport-lat Pic X(30). 10 airport-long Pic x(30). 10 airport-status-type Pic X(30). 10 airport-status-reason Pic X(30). 10 airport-average-delay Pic X(30). 10 airport-weather-cond Pic X(30). 10 airport-temp Pic X(30). 10 airport-wind Pic X(30). 10 airport-delay-flag Pic 9. 88 airport-delay-true Value 1. 88 airport-delay-false Value 0. 01 string-dsect Pic X(256). PROCEDURE DIVISION using http-response, exit-flags, resp-body-ptr, resp-body-len, body-udata-ptr, body-udata-len. Begin. Display "*******************************************". Display "** Response Body Exit Receives Control **". *> Make sure body user data was specified If body-udata-ptr = Null then Display "** No body user data was specified" EXIT PROGRAM End-If *> Get addressability to body user data Set address of body-udata to body-udata-ptr. *> Get addressability to the response header flags Set address of hdr-flags to hdr-flags-ptr. *> Did the response come back in JSON format? If json-response-true then Display "** Response body is in JSON format" Display "** Initializing JSON parser" Perform init-jparser else Display "** Response body in control without ever " Display " receiving indicator of JSON data! " *> EXIT PROGRAM - removed by SMB Set address of resp-body-data to resp-body-data-ptr Display resp-body-data Perform init-jparser End-If *> Parse the response body as JSON If HWTJ-OK then Perform parse-json-body End-If If HWTJ-OK Perform retrieve-airport-data End-If *> Terminate the parser instance Perform free-jparser. *> Write "body exit exited" message Display "** Response Body Exit Returns **". Display "*******************************************". EXIT PROGRAM. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Method: init-jparser * * * * Initializes the parser handle variable. * * * * Services Used: * * * * HWTJINIT: Provides a handle to a parse instance which is then * * used iN subsequent service calls. The HWTJINIT * * service must be invoked before invoking any other * * parsing service. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * init-jparser. Call "HWTJINIT" using HWTJ-RETURN-CODE workarea-max *> parser work area size in bytes (input) HWTJ-PARSERHANDLE HWTJ-DIAG-AREA. If (HWTJ-OK) Display " Parser initialized." else Display " ERROR: Parser initialization failed" Call "DSPJDIAG" using HWTJ-RETURN-CODE HWTJ-DIAG-AREA End-If . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * Method: parse-json-body * * * * Parses the sample JSON data. * * * * Services Used: * * * * HWTJPARS: Builds an internal representation of the specified * * JSON string. This allows efficient search, traversal,* * and modification of the JSON data. * * * * USAGE: HWTJPARS does not make a local copy of the JSON source * * string. Therefore, the caller must ensure that the * * provided source string remains unmodified for the * * duration of the parser instance. If the source string * * is modified, subsequent service calls may result in * * unexpected behavior. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** parse-json-body. Call "HWTJPARS" using HWTJ-RETURN-CODE HWTJ-PARSERHANDLE resp-body-ptr resp-body-len HWTJ-DIAG-AREA. If (HWTJ-OK) Display " Response body parsed successfully" else Display " ERROR: Unable to parser JSON data" Call "DSPJDIAG" using HWTJ-RETURN-CODE HWTJ-DIAG-AREA End-If . *************************************************************** * Procedure: retrieve-airport-data * * * * function: Search for various data returned by the server * * and save them in a data structure for future use. * * * * Services Used: * * * * Almost all of the routines called by this routine and below * * were copied directly from the z/OS Client Web Enablement * * Toolkit JSON parser sample (HWTJXC1). * * * * Usage: * * * * Use HWTJSRCH to find multipe name value pairs * * * *************************************************************** retrieve-airport-data. * __________________________________________________________ * | | * | Retrieve general airport information (i.e. name, | * | abbreviation, and state) from the response body. The | * | find-string and find-object subprograms utilize the | * | JSON search services to extract the airport information | * | from the response body. For each key:value pair, we | * | copy the search key into search-string, compute the | * | length of the search string, and invoke either | * | "find-string" or "find-object" appropriately. If a match | * | is found, the data is copied into the airport-info | * | structure. This demonstrates how to share data between | * | a callback routine and a main program. | * |__________________________________________________________| *> Establish addressability to the airport data structure Set address of resp-body-data to resp-body-data-ptr. *> Perform a sanity check on the airport-info data. If resp-body-data-eye not equal "AIRPORT" then display " Eyecatcher check failed for airport-info" exit program End-if Display " Extracting airport status information...". * __________________________________________________________ * | | * | search-string functions as a dummy variable. It is | * | initialized with a new search string before each | * | invocation of find-string; because find-string requires | * | a pointer we set search-string-ptr only one time | * |__________________________________________________________| Set
COBOL
search-string-ptr to address of search-string. Move Name-Key to search-string. Compute search-string-len = function length(Name-Key). Call "find-string" using root-object search-string-ptr search-string-len search-result-ptr search-result-len. If HWTJ-OK then Set address of string-dsect to search-result-ptr Compute data-copy-len = function Min(search-result-len, function length(airport-name)) Move string-dsect(1:search-result-len) to airport-name End-If Move Iata-Key to search-string. Compute search-string-len = function length(Iata-key). Call "find-string" using root-object search-string-ptr search-string-len search-result-ptr search-result-len. If HWTJ-OK then Set address of string-dsect to search-result-ptr Compute data-copy-len = function min(search-result-len, function length(airport-iata)) Move string-dsect(1:search-result-len) to airport-iata End-If Move State-Key to search-string. Compute search-string-len = function length(State-Key) Call "find-string" using root-object search-string-ptr search-string-len search-result-ptr search-result-len. If HWTJ-OK then Set address of string-dsect to search-result-ptr Compute data-copy-len = function min(search-result-len, function length(airport-state)) Move string-dsect(1:search-result-len) to airport-state End-If Move Country-Key to search-string. Compute search-string-len = function length(Country-Key) Call "find-string" using root-object search-string-ptr search-string-len search-result-ptr search-result-len. If HWTJ-OK then Set address of string-dsect to search-result-ptr Compute data-copy-len = function min(search-result-len, function length(airport-country)) Move string-dsect(1:search-result-len) to airport-country End-If Move Long-Key to search-string. Compute search-string-len = function length(Long-Key) Call "find-string" using root-object search-string-ptr search-string-len search-result-ptr search-result-len. If HWTJ-OK then Set address of string-dsect to search-result-ptr Compute data-copy-len = function min(search-result-len, function length(airport-long)) Move string-dsect(1:search-result-len) to airport-long End-If Move Lat-Key to search-string. Compute search-string-len = function length(Lat-Key) Call "find-string" using root-object search-string-ptr search-string-len search-result-ptr search-result-len. If HWTJ-OK then Set address of string-dsect to search-result-ptr Compute data-copy-len = function min(search-result-len, function length(airport-lat)) Move string-dsect(1:search-result-len) to airport-lat End-If . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * Method: free-jparser * * * * Performs cleanup by freeing memory used by the parser and * * invalidating the parser handle. * * * * Services Used: * * * * HWTJTERM: Terminates a parser instance and frees the storage * * allocated by the parse services. * * * * USAGE: The third parameter to hwtjterm is used to specify the * * behavior of terminate if the parser is determined to be* * stuck in an "in-use" state. IBM recommends using the * * HWTJ-NOFORCE option in most cases. Because our sample * * is not multi-threaded, the risk of the parser getting * * stuck in an "in-use" state is low. Therefore, we * * provide a value of HWTJ-NOFORCE for the force option. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** free-jparser. Set HWTJ-NOFORCE to true. If (NOT HWTJ-PARSERHANDLE-INUSE) Call "HWTJTERM" using HWTJ-RETURN-CODE HWTJ-PARSERHANDLE HWTJ-FORCEOPTION HWTJ-DIAG-AREA End-If Evaluate true When HWTJ-OK Display " Parser work area freed." When HWTJ-PARSERHANDLE-INUSE Display " ERROR: Unable to perform cleanup." "Retrying cleanup with force option enabled." Set HWTJ-FORCE to true *> Attempt to force cleanup. Not recommended! Call "HWTJTERM" using HWTJ-RETURN-CODE HWTJ-PARSERHANDLE HWTJ-FORCEOPTION HWTJ-DIAG-AREA *> Check if cleanup was successful. If HWTJ-OK Display " Parser work area freed using force" "option." else Display " ERROR: Unable to free resources with force" "option enabled. Could not free parser work area." Call "DSPJDIAG" using HWTJ-RETURN-CODE HWTJ-DIAG-AREA End-If When other Display " ERROR: Unable to perform cleanup. Could not " "free parser work area." Call "DSPJDIAG" using HWTJ-RETURN-CODE HWTJ-DIAG-AREA End-Evaluate . * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * Method: find-string * * * * Searches the specified JSON object for a name:value pair where * * the name matches the specified search string and the value * * type is string. This is a convenience method that can be used * * when the structure of the JSON data is known beforehand. * * * * Input: - A handle of type object or array. * * - A string used as the search parameter. * * * * Output: If a match is found, the string value of the * * name:value pair is returned. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** IDENTIFICATION DIVISION. PROGRAM-ID find-string COMMON. DATA DIVISION. LINKAGE SECTION. 01 object-handle Pic 9(9). 01 search-string-addr Pointer. 01 search-string-len Pic 9(9). 01 value-addr Pointer. 01 value-len Pic 9(9) Binary. PROCEDURE DIVISION using object-handle, search-string-addr, search-string-len, value-addr, value-len. Begin. Set HWTJ-STRING-TYPE to true. Call "find-value" using object-handle search-string-addr search-string-len HWTJ-JTYPE value-addr value-len. End Program find-string. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * Method: find-object * * * * Searches the specified JSON object for a name:value pair where * * the name matches the specified search string and the value * * type is object. This is a convenience method that can be used * * when the structure of the JSON data is known beforehand. * * * * Input: - A handle of type object or array. * * - A string used as the search parameter. * * * * Output: If a match is found, a handle to the object value of * * the name:value pair is returned. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** IDENTIFICATION DIVISION. PROGRAM-ID find-object COMMON. DATA DIVISION. WORKING-STORAGE SECTION. 01 value-length Pic 9(9) Binary Value 4. 01 result-addr Pointer Value Null. LINKAGE SECTION. 01 object-handle Pic 9(9). 01 search-string-addr Pointer. 01 search-string-len Pic 9(9). 01 result-obj-handle Pic 9(9). PROCEDURE DIV
COBOL
ISION using object-handle, search-string-addr, search-string-len, result-obj-handle. Begin. *> This allows find-value to update result-object-handle Set result-addr to address of result-obj-handle. Set HWTJ-OBJECT-TYPE to true. Call "find-value" using object-handle search-string-addr search-string-len HWTJ-JTYPE result-addr value-length. End Program find-object. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * Method: find-value * * * * Searches the specified object for a name:value pair whose name * * matches the the specified search string. This is a utility * * method used by the "find" routines to easily search and * * retrieve a value from an object when the name and value type * * are known. * * * * Input: - A handle of type object or array. * * - A string used as a search parameter. * * - A JSON type as defined in the IBM-provided Cobol * * interface definition file. * * * * Output: A pointer to the value is returned. * * * * Services Used: * * HWTJGJST: Gets the JSON type associated with a specified * * object or entry handle. * * HWTJSRCH: Finds a particular name string within the JSON * * text. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** IDENTIFICATION DIVISION. PROGRAM-ID. find-value common. DATA DIVISION. LOCAL-STORAGE SECTION. 01 entry-value-handle Pic 9(9) Binary Value 0. 01 starting-search-handle Pic 9(9) Binary Value 0. 01 entry-value-addr Pointer Value Null. 01 actual-entry-type Pic 9(9) Binary Value 0. 01 num-value Pic 9(9) Binary Value 0. 01 num-value-ptr Pointer Value Null. 01 num-value-length Pic 9(9) Binary Value 0. LINKAGE SECTION. 01 object-to-search Pic 9(9) Binary. 01 search-string-addr Pointer. 01 search-string-len Pic 9(9) Binary. 01 expected-entry-type Pic 9(9) Binary. 01 value-addr Pointer. 01 value-len Pic 9(9) Binary. 01 result-handle Pic 9(9) Binary. 01 string-dsect Pic X(256). PROCEDURE DIVISION using object-to-search, search-string-addr, search-string-len, expected-entry-type, value-addr, value-len. Begin. *> Limit the search scope to within the specified object. Set HWTJ-SEARCHTYPE-OBJECT to true. *> Perform the search. Call "HWTJSRCH" using HWTJ-RETURN-CODE HWTJ-PARSERHANDLE HWTJ-SEARCHTYPE search-string-addr search-string-len object-to-search starting-search-handle entry-value-handle HWTJ-DIAG-AREA. *> If match was found, the result is in entry-value-handle. If HWTJ-OK *> Determine the entry type returned by HWTJSRCH. Call "HWTJGJST" using HWTJ-RETURN-CODE HWTJ-PARSERHANDLE entry-value-handle actual-entry-type HWTJ-DIAG-AREA *> Verify that the entry type matches the expected type. If (HWTJ-OK AND (actual-entry-type is equal to expected-entry-type)) *> Initialize HWTJ-JTYPE with entry type for evaluate. Move actual-entry-type to HWTJ-JTYPE EVALUATE true When HWTJ-OBJECT-TYPE *> copy result to output parm Set address of result-handle to value-addr Move entry-value-handle to result-handle When HWTJ-ARRAY-TYPE *> copy result to output parm Set address of result-handle to value-addr Move entry-value-handle to result-handle When HWTJ-NUMBER-TYPE or HWTJ-STRING-TYPE *> Retrieve the value. Call "HWTJGVAL" using HWTJ-RETURN-CODE HWTJ-PARSERHANDLE entry-value-handle entry-value-addr value-len HWTJ-DIAG-AREA If HWTJ-OK *> Establish addressability to value. Set value-addr to entry-value-addr *> Check if value can be converted to numeric If HWTJ-NUMBER-TYPE *> HWTJGNUV expects an address to output buffer Set num-value-ptr to address of num-value *> The length of the output buffer is required Compute num-value-length = function length(num-value) *> Convert from character data to numeric data Call "HWTJGNUV" using HWTJ-RETURN-CODE HWTJ-PARSERHANDLE entry-value-handle num-value-ptr num-value-length HWTJ-VALDESCRIPTOR HWTJ-DIAG-AREA If NOT HWTJ-OK Display "** ERROR: HWTJGNUV failed." Call "DSPJDIAG" using HWTJ-RETURN-CODE HWTJ-DIAG-AREA End-If End-If else Display "** ERROR: HWTJGVAL failed." Call "DSPJDIAG" using HWTJ-RETURN-CODE HWTJ-DIAG-AREA End-If When HWTJ-BOOLEAN-TYPE Call "HWTJGBOV" using HWTJ-RETURN-CODE HWTJ-PARSERHANDLE entry-value-handle HWTJ-BOOLEANValue HWTJ-DIAG-AREA When HWTJ-Null-TYPE Display "Null" End-Evaluate End-If Else Set address of string-dsect to search-string-addr Display "** ERROR: HWTJSRCH failed." Display "** search-string:" string-dsect(1:search-string-len) Call "DSPJDIAG" using HWTJ-RETURN-CODE HWTJ-DIAG-AREA End-If *> HWTJSRCH = HWTJ-OK . End Program Find-Value. End Program HWTHBDYX. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This program is used to display the current state of the * * return code, reason code, and reason description. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * IDENTIFICATION DIVISION. PROGRAM-ID. DSPJDIAG. DATA DIVISION. WORKING-STORAGE SECTION. COPY HWTJICOB. LOCAL-STORAGE SECTION. 01 return-code-text Pic X(30) Value Spaces. 01 reason-code-text Pic X(30) Value Spaces. LINKAGE SECTION. 01 ret-code Pic X(4). 01 diag-area. 05 reason-code Pic X(4). 05 reason-desc Pic X(128). PROCEDURE DIVISION using ret-code, diag-area. Begin. Move ret-code to HWTJ-RETURN-CODE *> Translate the return code integer into its text equivalent EVALUATE true When HWTJ-OK Move "HWTJ-OK" to return-code-text When HWTJ-WARNING Move "HWTJ-WARNING" to return-code-text When HWTJ-PARSERHANDLE-INV Move "HWTJ-PARSERHANDLE-INV" to return-code-text When HWTJ-PARSERHANDLE-INUSE Move "HWTJ-PARSERHANDLE-INUSE" to return-code-text When HWTJ-INACCESSIBLE-PARM Move "HWTJ-INACCESSIBLE-PARM" to return-code-text When HWTJ-HANDLE-INV Move "HWTJ-HANDLE-INV" to return-code-text When HWTJ-HANDLE-TYPE-ERROR Move "HWTJ-HANDLE-TYPE-ERROR" to return-code-text When HWTJ-BUFFER-TOO-SMALL Move "HWTJ-BUFFER-TOO-SMALL" to return-code-text When HWTJ
COBOL
-INDEX-OUT-OF-BOUNDS Move "HWTJ-INDEX-OUT-OF-BOUNDS" to return-code-text When HWTJ-WORKAREA-TOO-SMALL Move "HWTJ-WORKAREA-TOO-SMALL" to return-code-text When HWTJ-PARSE-ERROR Move "HWTJ-PARSE-ERROR" to return-code-text When HWTJ-ROOT-OBJECT-MISSING Move "HWTJ-ROOT-OBJECT-MISSING" to return-code-text When HWTJ-CANNOT-OBTAIN-WORKAREA Move "HWTJ-CANNOT-OBTAIN-WORKAREA" to return-code-text When HWTJ-JCREN-ENTRYNAMEADDR-INV Move "HWTJ-JCREN-ENTRYNAMEADDR-INV" to return-code-text When HWTJ-JCREN-ENTRYNAMELEN-INV Move "HWTJ-JCREN-ENTRYNAMELEN-INV" to return-code-text When HWTJ-JCREN-ENTRYValueADDR-INV Move "HWTJ-JCREN-ENTRYValueADDR-INV" to return-code-text When HWTJ-JCREN-ENTRYValueLEN-INV Move "HWTJ-JCREN-ENTRYValueLEN" to return-code-text When HWTJ-JCREN-ENTRYValueTYPE-INV Move "HWTJ-JCREN-ENTRYValueTYPE" to return-code-text When HWTJ-JCREN-ENTRYNAME-INV Move "HWTJ-JCREN-ENTRYNAME-INV" to return-code-text When HWTJ-JCREN-ENTRYValue-INV Move "HWTJ-JCREN-ENTRYValue-INV" to return-code-text When HWTJ-JGOEN-BUFFERADDR-INV Move "HWTJ-JGOEN-BUFFERADDR-INV" to return-code-text When HWTJ-JGOEN-BUFFERLEN-INV Move "HWTJ-JGOEN-BUFFERLEN-INV" to return-code-text When HWTJ-JPARS-JSONTEXTADDR-INV Move "HWTJ-JPARS-JSONTEXTADDR-INV" to return-code-text When HWTJ-JPARS-JSONTEXTLEN-INV Move "HWTJ-JPARS-JSONTEXTLEN-INV" to return-code-text When HWTJ-JPARS-WORKAREA-ERROR Move "HWTJ-JPARS-WORKAREA-ERROR" to return-code-text When HWTJ-JSERI-NEWJTXTBUFFADDR-INV Move "HWTJ-JSERI-NEWJTXTBUFFERADDR-INV" to return-code-text When HWTJ-JSERI-NEWJTXTBUFFLEN-INV Move "HWTJ-JSERI-NEWJTXTBUFFLEN-INV" to return-code-text When HWTJ-JSRCH-SEARCHTYPE-INV Move "HWTJ-JSRCH-SEARCHTYPE-INV" to return-code-text When HWTJ-JSRCH-SRCHSTRADDR-INV Move "HWTJ-JSRCH-SRCHSTRINGADDR-INV" to return-code-text When HWTJ-JSRCH-SRCHSTRLEN-INV Move "HWTJ-JSRCH-SRCHSTRINGLEN-INV" to return-code-text When HWTJ-JSRCH-SRCHSTR-NOT-FOUND Move "HWTJ-JSRCH-SRCHSTR-NOT-FOUND" to return-code-text When HWTJ-JSRCH-STARTINGHANDLE-INV Move "HWTJ-JSRCH-STARTINGHANDLE-INV" to return-code-text When HWTJ-JTERM-CANNOT-FREE-WORKA Move "HWTJ-JTERM-CANNOT-FREE-WORKA" to return-code-text When HWTJ-JTERM-FORCEOPTION-INV Move "HWTJ-JTERM-FORCEOPTION-INV" to return-code-text When HWTJ-INTERRUPT-STATUS-INV Move "HWTJ-INTERRUPT-STATUS-INV" to return-code-text When HWTJ-LOCKS-HELD Move "HWTJ-LOCKS-HELD" to return-code-text When HWTJ-UNSUPPORTED-RELEASE Move "HWTJ-UNSUPPORTED-RELEASE" to return-code-text When HWTJ-UNEXPECTED-ERROR Move "HWTJ-UNEXPECTED-ERROR" to return-code-text End-Evaluate If return-code-text is equal to SPACES Move 'Unknown return code' to return-code-text End-If *> Not all errors result in a reason code. Therefore, only *> fill out the reason-code-text if the reason code is *> non-zero If reason-code is not equal ZERO Move reason-code to REASONCODE EVALUATE true When PARSE-ERR-UNEXPECTED-TOKEN Move "PARSE-ERR-UNEXPECTED-TOKEN" to reason-code-text When PARSE-ERR-INCompLETE-OBJECT Move "PARSE-ERR-INCompLETE-OBJECT" to reason-code-text When PARSE-ERR-INCompLETE-ARRAY Move "PARSE-ERR-INCompLETE-ARRAY" to reason-code-text When PARSE-ERR-MISSING-COMMA Move "PARSE-ERR-MISSING-COMMA" to reason-code-text When PARSE-ERR-MISSING-PAIR-NAME Move "PARSE-ERR-MISSING-PAIR-NAME" to reason-code-text When PARSE-ERR-INVALID-OBJECT-KEY Move "PARSE-ERR-INVALID-OBJECT-KEY" to reason-code-text When PARSE-ERR-MISSING-COLON Move "PARSE-ERR-MISSING-COLON" to reason-code-text When PARSE-ERR-INV-UNICODE-SEQUENCE Move "PARSE-ERR-INV-UNICODE-SEQUENCE" to reason-code-text When PARSE-ERR-UNTERMINATED-STRING Move "PARSE-ERR-UNTERMINATED-STRING" to reason-code-text When PARSE-ERR-INVALID-NUMBER Move "PARSE-ERR-INVALID-NUMBER" to reason-code-text When PARSE-ERR-INVALID-TOKEN Move "PARSE-ERR-INVALID-TOKEN" to reason-code-text When CREATE-ENTRY-BAD-RESULT-CUR Move "CREATE-ENTRY-BAD-RESULT-CUR" to reason-code-text When CREATE-ENTRY-BAD-OBJECT-HANDLE Move "CREATE-ENTRY-BAD-OBJECT-HANDLE" to reason-code-text When CREATE-ENTRY-BAD-RESULT-AREA Move "CREATE-ENTRY-BAD-RESULT-AREA" to reason-code-text When CREATE-ENTRY-BAD-RESULT-AREA2 Move "CREATE-ENTRY-BAD-RESULT-AREA2" to reason-code-text When CREATE-ENTRY-BAD-TARGET-OBJECT Move "CREATE-ENTRY-BAD-TARGET-OBJECT" to reason-code-text When CREATE-ENTRY-BAD-Value-TYPE Move "CREATE-ENTRY-BAD-Value-TYPE" to reason-code-text When CREATE-ENTRY-BAD-STRING Move "CREATE-ENTRY-BAD-STRING" to reason-code-text When CREATE-ENTRY-BAD-NAME-STRING Move "CREATE-ENTRY-BAD-NAME-STRING" to reason-code-text When CREATE-ENTRY-BAD-Value-STRING Move "CREATE-ENTRY-BAD-Value-STRING" to reason-code-text When CREATE-ENTRY-CNT-FLAG-NOT-Set Move "CREATE-ENTRY-CNT-FLAG-NOT-Set" to reason-code-text When CREATE-ENTRY-CNT-VAR-NOT-Set Move "CREATE-ENTRY-CNT-VAR-NOT-Set" to reason-code-text When CREATE-ENTRY-PARSE-Value-INV Move "CREATE-ENTRY-PARSE-Value-INV" to reason-code-text When CREATE-ENTRY-INVNAM-UNICODESEQ Move "CREATE-ENTRY-INVNAM-UNICODESEQ" to reason-code-text When CREATE-ENTRY-INVVAL-UNICODESEQ Move "CREATE-ENTRY-INVVAL-UNICODESEQ" to reason-code-text When CREATE-ENTRY-INV-UNICODESEQ Move "CREATE-ENTRY-INV-UNICODESEQ" to reason-code-text End-Evaluate End-If Display "Return Code: " return-code-text. Display "Reason Code: " reason-code-text. Display "Reason Desc: " reason-desc. End Program DSPJDIAG. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This program is used to display the current state of the * * return code, reason code, and reason description. * * * * * *
COBOL
* * * * * * * * * * * * * * * * * * * * * * * * * * * * IDENTIFICATION DIVISION. PROGRAM-ID. DSPHDIAG. DATA DIVISION. WORKING-STORAGE SECTION. COPY HWTHICOB. LOCAL-STORAGE SECTION. 01 retcode-text Pic X(30) Value Spaces. 01 rsncode-text Pic X(30) Value Spaces. LINKAGE SECTION. 01 retcode Pic 9(9) Binary. 01 diag-area. 05 srvcnum Pic 9(9) Binary. 05 rsncode Pic 9(9) Binary. 05 rsndesc Pic X(128). PROCEDURE DIVISION using retcode, diag-area. Begin. Compute HWTH-RETURN-CODE = retcode. *> Translate the return code integer into its text equivalent Evaluate true When HWTH-OK Move "HWTH-OK" to retcode-text When HWTH-WARNING Move "HWTH-WARNING" to retcode-text When HWTH-HANDLE-INV Move "HWTH-HANDLE-INV" to retcode-text When HWTH-HANDLE-INUSE Move "HWTH-HANDLE-INUSE" to retcode-text When HWTH-HANDLETYPE-INV Move "HWTH-HANDLETYPE-INV" to retcode-text When HWTH-INACCESSIBLE-PARM Move "HWTH-INACCESSIBLE-PARM" to retcode-text When HWTH-CANNOT-OBTAIN-WORKAREA Move "HWTH-CANNOT-OBTAIN-WORKAREA" to retcode-text When HWTH-COMMUNICATION-ERROR Move "HWTH-COMMUNICATION-ERROR" to retcode-text When HWTH-CANNOT-INCREASE-WORKAREA Move "HWTH-CANNOT-INCREASE-WORKAREA" to retcode-text When HWTH-CANNOT-FREE-WORKAREA Move "HWTH-CANNOT-FREE-WORKAREA" to retcode-text When HWTH-CONNECTION-NOT-ACTIVE Move "HWTH-CONNECTION-NOT-ACTIVE" to retcode-text When HWTH-HSet-OPTIONVALADDR-INV Move "HWTH-HSet-OPTIONVALADDR-INV" to retcode-text When HWTH-HSet-OPTIONVALLEN-INV Move "HWTH-HSet-OPTIONVALLEN-INV" to retcode-text When HWTH-HSet-OPTION-INV Move "HWTH-HSet-OPTION-INV" to retcode-text When HWTH-HSet-OPTIONValue-INV Move "HWTH-HSet-OPTIONValue-INV" to retcode-text When HWTH-HSet-CONN-ALREADY-ACTIVE Move "HWTH-HSet-CONN-ALREADY-ACTIVE" to retcode-text When HWTH-HSLST-SLIST-INV Move "HWTH-HSLST-SLIST-INV" to retcode-text When HWTH-HSLST-function-INV Move "HWTH-HSLST-function-INV" to retcode-text When HWTH-HSLST-STRINGLEN-INV Move "HWTH-HSLST-STRINGLEN-INV" to retcode-text When HWTH-HSLST-STRINGADDR-INV Move "HWTH-HSLST-STRINGADDR-INV" to retcode-text When HWTH-HTERM-FORCEOPTION-INV Move "HWTH-HTERM-FORCEOPTION-INV" to retcode-text When HWTH-HCONN-CONNECT-INV Move "HWTH-HCONN-CONNECT-INV" to retcode-text When HWTH-HRQST-REQUEST-INV Move "HWTH-HRQST-REQUEST-INV" to retcode-text When HWTH-INTERRUPT-STATUS-INV Move "HWTH-INTERRUPT-STATUS-INV" to retcode-text When HWTH-LOCKS-HELD Move "HWTH-LOCKS-HELD" to retcode-text When HWTH-MODE-INV Move "HWTH-MODE-INV" to retcode-text When HWTH-AUTHLEVEL-INV Move "HWTH-AUTHLEVEL-INV" to retcode-text When HWTH-ENVIRONMENTAL-ERROR Move "HWTH-ENVIRONMENTAL-ERROR" to retcode-text When HWTH-UNSUPPORTED-RELEASE Move "HWTH-UNSUPPORTED-RELEASE" to retcode-text When HWTH-UNEXPECTED-ERROR Move "HWTH-UNEXPECTED-ERROR" to retcode-text End-evaluate If retcode-text is equal to Spaces Move 'Unknown return code' to retcode-text End-If *> Not all errors result in a reason code. Therefore, only *> fill out the reason-code-text if the reason code is *> non-zero. If rsncode is not equal ZERO Move rsncode to HWTH-REASONCODE Evaluate true When HWTH-RSN-REDIRECTED Move "HWTH-RSN-REDIRECTED" to rsncode-text When HWTH-RSN-NEEDED-REDIRECT Move "HWTH-RSN-NEEDED-REDIRECT" to rsncode-text When HWTH-RSN-REDIRECT-XDOMAIN Move "HWTH-RSN-REDIRECT-XDOMAIN" to rsncode-text When HWTH-RSN-REDIRECT-TO-HTTP Move "HWTH-RSN-REDIRECT-TO-HTTP" to rsncode-text When HWTH-RSN-REDIRECT-TO-HTTPS Move "HWTH-RSN-REDIRECT-TO-HTTPS" to rsncode-text When HWTH-RSN-NO-REDIRECT-LOCATION Move "HWTH-RSN-NO-REDIRECT-LOCATION" to rsncode-text When HWTH-RSN-HDR-EXIT-ABORT Move "HWTH-RSN-HDR-EXIT-ABORT" to rsncode-text When HWTH-RSN-TUNNEL-UNSUCCESSFUL Move "HWTH-RSN-TUNNEL-UNSUCCESSFUL" to rsncode-text When HWTH-RSN-MALFORMED-CHNK-ENCODE Move "HWTH-RSN-MALFORMED-CHNK-ENCODE" to rsncode-text When HWTH-RSN-COOKIE-STORE-FULL Move "HWTH-RSN-COOKIE-STORE-FULL" to rsncode-text When HWTH-RSN-COOKIE-INVALID Move "HWTH-RSN-COOKIE-INVALID" to rsncode-text When HWTH-RSN-COOKIE-STORE-INV-PARM Move "HWTH-RSN-COOKIE-STORE-INV-PARM" to rsncode-text When HWTH-RSN-COOKIE-ST-INCompLETE Move "HWTH-RSN-COOKIE-ST-INCompLETE" to rsncode-text When HWTH-RSN-COOKIE-ST-MALLOC-ERR Move "HWTH-RSN-COOKIE-ST-MALLOC-ERR" to rsncode-text When HWTH-RSN-COOKIE-ST-FREE-ERROR Move "HWTH-RSN-COOKIE-ST-FREE-ERROR" to rsncode-text When HWTH-RSN-COOKIE-ST-UNEXP-ERROR Move "HWTH-RSN-COOKIE-ST-UNEXP-ERROR" to rsncode-text End-Evaluate End-If Display "Return code: " retcode-text. Display "Service: " srvcnum. Display "Reason Code: " rsncode-text. Display "Reason Desc: " rsndesc. End Program DSPHDIAG. <|end_of_text|> ******************************************************************* * Project code name "ORCA" * 日医標準レセプトソフト(JMA standard receipt software) * Copyright(C) 2002 JMA (Japan Medical Association) * * This program is part of "JMA standard receipt software". * * This program is distributed in the hope that it will be useful * for further advancement in medical care, according to JMA Open * Source License, but WITHOUT ANY WARRANTY. * Everyone is granted permission to use, copy, modify and * redistribute this program, but only under the conditions described * in the JMA Open Source License. You should have received a copy of * this license along with this program. If not, stop using this * program and contact JMA, 2-28-16 Honkomagome, Bunkyo-ku, Tokyo, * 113-8621, Japan. ******************************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. SEIKYU2005. ***************************************************************** * システム名 : ORCA * サブシステム名 : 地方公費 * コンポーネント名 : 長
COBOL
野・複写式レセプト(FD請求) * (199,299,399) * 管理者 : * 作成日付 作業者 記述 * 07/11/28 内田 新規作成 ***************************************************************** * プログラム修正履歴 * Maj/Min/Rev 修正者 日付 内容 * 01.00.01 内田 2008/02/26 CSVフォーマットの変更 * 事業コードの取得の変更 * 01.00.02 内田 2008/05/28 4月改正対応 * 01.00.03 内田 2008/06/13 後期高齢は「保険証・記号」には * 保険者番号を印字する * 01.00.04 内田 2008/07/15 「保険証・記号」は * 後期高齢者も社保国保と同様とする * 01.00.05 吉川 2008/09/10 公費の点数・診療実日数が * 出力されない不具合を修正 * 01.00.06 内田 2009/02/24 食事療養費等は0円なら0と記録する * 01.00.07 吉川 2010/09/27 市町村番号が「000」の場合、 * 件数が正しくならないのを修正 * 01.00.08 吉川 2011/03/07 主保険+全国公費の組合せのデータが * 集計されないのを修正 * 生保は集計対象外とするように修正 * open-cobol1.0対応 * 01.00.09 吉川 2011/05/19 生年月日は8桁で記録する * 01.00.10 萩野 2012/08/10 負担者番号の三桁未満エラー対応 * 01.00.11 萩野 2014/02/13 実日数、点数ともに福祉使用分のみの * 記載に修正 * 01.00.12 吉川 2014/10/23 ver4.8.0対応(一時ディレクトリ変更) * 01.00.13 吉川 2015/05/12 保険変更時、それぞれの点数と日数を * 印字するように修正 * 01.00.14 吉川 2015/09/14 患者負担がない場合は印字しない * 01.00.15 吉川 2015/10/01 食事は保険分を印字する * 01.00.16 吉川 2016/01/08 データがない場合はファイルを作成しない * 処理結果画面の件数の不具合修正 * 01.00.17 門間 2016/09/05 対象公費はPGオプションから取得する * 01.00.18 萩野 2017/12/11 医療機関コード変更時、 * 医療機関コード別の作成処理対応 * 01.00.19 萩野 2018/12/12 修正履歴コメント削除 ***************************************************************** * ENVIRONMENT DIVISION. CONFIGURATION SECTION. INPUT-OUTPUT SECTION. FILE-CONTROL. * * 請求書用ファイル SELECT MF101-FILE ASSIGN MF101PARA ORGANIZATION IS INDEXED ACCESS MODE IS DYNAMIC RECORD KEY IS MF101-KEY FILE STATUS IS STS-MF101. 006900* エラーファイル SELECT RECEERR-FILE ASSIGN RECEERR FILE STATUS IS STS-RECEERR. * DATA DIVISION. FILE SECTION. * * 集計ファイル FD MF101-FILE. 01 MF101-REC. COPY "SEI2003.INC". * 006900* エラーファイル FD RECEERR-FILE. 01 RECEERR-REC PIC X(200). * WORKING-STORAGE SECTION. * シェル用領域 COPY "CPSHELLTBL.INC". * COPY "CPCOMMONDAT2.INC" REPLACING //RECE01// BY //MF101//. * * エラーファイル 名称領域 COPY "CPRECEERR.INC". * * スパ領域 01 STS-AREA. 03 STS-MF101 PIC X(02). 03 STS-RECEERR PIC X(02). 03 STS-RECE PIC X(02). * * フラグ領域 01 FLG-AREA. 03 FLG-PTINF PIC 9(01). 03 FLG-END PIC 9(01). 03 FLG-MF101 PIC 9(01). 03 FLG-PRINT PIC 9(01). 03 FLG-SYSKANRI PIC 9(01). 03 FLG-ERR PIC 9(01). 03 FLG-SYUNOU PIC 9(01). 03 FLG-RECE10 PIC 9(01). 03 FLG-PTKOHINF PIC 9(01). 03 FLG-HKNCOMBI PIC 9(01). 03 FLG-BTPARA PIC 9(01). 03 FLG-SYORI PIC 9(01). 03 FLG-MOJI PIC 9(01). 03 FLG-PRGOPTION PIC 9(01). 03 FLG-OK PIC 9(01). 03 FLG-TAISYO PIC 9(01). * * 添字領域 01 IDX-AREA. 03 IDX PIC 9(05). 03 IDXX PIC 9(04). 03 IDX1 PIC 9(04). 03 IDX2 PIC 9(04). 03 IDX3 PIC 9(04). 03 IDY PIC 9(04). 03 IDZ PIC 9(04). 03 IDW PIC 9(04). 03 IDX-TOWN PIC 9(03). * * パラメタ領域 01 WRK-PARA. COPY "CPORCSPRTLNK.INC". 03 WRK-PARA-JOBID PIC 9(07). 03 WRK-PARA-SHELLID PIC X(08). 03 WRK-PARA-HOSPNUM PIC 9(02). 03 WRK-PARA-PAGE PIC 9(10). 03 WRK-PARA-SYORIFLG PIC X(01). 03 WRK-PARA-STSRYYM PIC 9(06). 03 WRK-PARA-EDSRYYM PIC 9(06). * * 一時領域 01 WRK-AREA. 03 WRK-RECEERR PIC X(200). 03 WRK-Z1 PIC Z. 03 WRK-Z2 PIC ZZ. 03 WRK-Z3 PIC ZZZ. 03 WRK-Z4 PIC ZZZ9. 03 WRK-Z5 PIC Z,ZZZ. 03 WRK-Z6 PIC ZZ,ZZZ. 03 WRK-Z7 PIC ZZZ,ZZZ. 03 WRK-Z8 PIC ZZZZZZZZ. 03 WRK-Z9 PIC Z,ZZZ,ZZZ. 03 WRK-SRYYM
COBOL
WH PIC X(16). 03 WRK-SEIYMDWH PIC X(22). 03 WRK-HENYMDG PIC X(22). 03 WRK-SYMD. 05 WRK-SYY PIC 9(04). 05 WRK-SMM PIC 9(02). 05 WRK-SDD PIC 9(02). 03 WRK-LASTYMD PIC 9(08). 03 WRK-NYMD. 05 WRK-NYY PIC 9(04). 05 WRK-NMM PIC 9(02). 05 WRK-NDD PIC 9(02). 03 WRK-TYMD. 05 WRK-TYY PIC 9(04). 05 WRK-TMM PIC 9(02). 05 WRK-TDD PIC 9(02). 03 WRK-HKNJANUM PIC X(05). 03 WRK-PRTID PIC X(20). 03 WRK-KOHNUM PIC X(03). 03 WRK-KOBETUCITYNUM PIC X(03). * * 文字変換 03 WRK-MAE-INPUT PIC X(200). 03 WRK-OUT-INPUT PIC X(200). * * プログラムオプション 03 WRK-OPTION-TBL. 05 WRK-OPTION PIC X(100) OCCURS 100. 03 WRK-PRGID PIC X(25). 03 WRK-KBNCD PIC X(16). * 03 WRK-CHK-KOHNUM-TBL. 05 WRK-CHK-KOHNUM PIC X(03) OCCURS 4. * 対象公費 03 WRK-TAISYO-KOHNUM PIC X(03) OCCURS 100. * 03 WRK-KOHID PIC 9(10). 03 WRK-FTNMONEY-G PIC 9(08). 03 WRK-ETC-TBL. 05 WRK-ETC-KOHNUM PIC X(03) OCCURS 2. 05 WRK-ETC-TENSU PIC 9(07) OCCURS 2. 05 WRK-ETC-ITBFTN PIC 9(07) OCCURS 2. 05 WRK-ETC-FTNJANUM PIC X(20). 05 WRK-ETC-JKYSNUM PIC X(20). 05 WRK-ETC-SKJ-NISSU PIC 9(02) OCCURS 2. 05 WRK-ETC-SKJ-RYOYOHI PIC 9(07) OCCURS 2. 05 WRK-ETC-SKJ-FTN PIC 9(07) OCCURS 2. * 03 WRK-PATH PIC X(50). * データ編集 03 WRK-HENSHU. 05 WRK-GOKEI-TBL OCCURS 10. 07 WRK-GOKEI-YM PIC 9(06). 07 WRK-GOKEI-DATA OCCURS 151. 09 WRK-GOKEIKENSU PIC 9(03). 05 WRK-SOUGOKEIKENSU PIC 9(07). * 05 WRK-RECENO PIC 9(05). 05 WRK-RECEHKNSHU PIC 9(01). 05 WRK-TOKKI PIC X(02). 05 WRK-TOWN PIC 9(03). 05 WRK-CHK-SRYYM PIC 9(06). 05 WRK-HKNJACVS PIC X(08). 05 WRK-MOJIST PIC 9(03). 05 WRK-MOJIED PIC 9(03). 05 WRK-RATE PIC 9(02). 05 WRK-MOJIHEN PIC 9(10). * 05 WRK-JNISSU PIC X(03). 05 WRK-EJNISSU1 PIC X(03). 05 WRK-EJNISSU2 PIC X(03). 05 WRK-TOTALTEN PIC X(08). 05 WRK-ETOTALTEN1 PIC X(08). 05 WRK-ETOTALTEN2 PIC X(08). 05 WRK-FTNMONEY PIC X(08). 05 WRK-EITBFTN1 PIC X(08). 05 WRK-EITBFTN2 PIC X(08). 05 WRK-SHOKUJINISSU PIC X(03). 05 WRK-SHOKUJIRYOYOHI PIC X(08). 05 WRK-SHOKUJIFTN PIC X(08). * 03 WRK-REC PIC X(500). 03 WRK-REC-LENGTH PIC 9(04). 03 WRK-HENSYU-AREA. 05 WRK-DATA PIC X(100). 05 WRK-NUM PIC ZZZZZZZZZZ.999. 05 WRK-NAGASA PIC 9(04). 05 WRK-ST PIC 9(02). 05 WRK-SYOSUU PIC 9(01). 05 WRK-END PIC 9(01). * 03 WRK-SCSVINFO-SEQ-NO PIC 9(06). 03 WRK-SCSVINFO-PTID PIC 9(10). 03 WRK-SCSVINFO-NYUGAIKBN PIC X(01). * * カウント領域 01 CNT-AREA. 03 CNT-RECE02 PIC 9(06). 03 CNT-MF101 PIC 9(06). 03 CNT-PAGE PIC 9(03). 03 CNT-OUT PIC 9(06). * 01 TABLE-AREA. 03 TBL-PARA-OCC OCCURS 100. 05 TBL-PARA-HKNJANUM PIC X(08). 05 TBL-PARA-PTID PIC 9(10). * 01 WRK-CONS-PARA-MAX PIC 9(03) VALUE 100. * * DB参照用 COPY "COMMON-SPA". * 01 WRK-CONS-AREA. * コンマ 03 WRK-KUGIRI PIC X(01) VALUE ",". * 改行コード 03 WRK-KAIGYO PIC X(01) VALUE X"0D". * ***************************************************************** * ファイルレイアウト 領域 ***************************************************************** * * システム管理マスタ COPY "CPSK1001.INC". * レセプト印刷情報 COPY "CPRCF008.INC". * * 医療機関情報−所在地、連絡先 COPY "CPSK1002.INC". * * 診療科目情報情報 COPY "CPSK1005.INC". * * ジョブ管理マスタ 01 JOBKANRI-REC. COPY "CPJOBKANRI.INC". * * 収納情報 01 SYUNOU-REC. COPY "CPSYUNOU.INC". * * 患者公費情報マスタ 01 PTKOHINF-REC. COPY "CPPTKOHINF.INC". * * 請求管理情報 COPY "CPRCF010.INC". * * 患者情報 01 PTINF-REC. COPY "CPPTINF.INC". * * 公費請求書 COPY "CPKOHSKY.INC" REPLACING //KOHSKY// BY //RECE02//. * * 保険組合せ
COBOL
01 HKNCOMBI-REC. COPY "CPHKNCOMBI.INC". * * パラメタ 01 BTPARA-REC. COPY "CPBTPARA.INC". * * プログラムオプション 01 PRGOPTION-REC. COPY "CPPRGOPTION.INC". * ***************************************************************** * サブプロ用 領域 ***************************************************************** * * ジョブ管理DB制御サブ COPY "CPORCSJOBKANRI.INC". * * 半角チェックサブ COPY "CPORCSKANACHK.INC". * * チェックディジット(モジュラス11用)算出サブ COPY "CPORCCHKDGT11.INC". * * 印刷DB制御サブ COPY "CPORCSPRT.INC". * * 共通パラメタ COPY "MCPAREA". * * 日付変換サブ COPY "CPORCSDAY.INC". COPY "CPORCSLNK.INC". * COPY "MCPDATA.INC". * * クライアント保存DB制御サブ COPY "CPORCSFILESV.INC". * * CSV管理DB制御サブ COPY "CPORCSCSVINFO.INC". * * 一時ファイル名編集 COPY "CPORCSGETTEMP.INC". * **************************************************************** LINKAGE SECTION. 01 COMMAND-PARAM. 02 FILLER PIC X(256). ***************************************************************** * PROCEDURE DIVISION USING COMMAND-PARAM. * ***************************************************************** * 主  処理 ***************************************************************** 000-PROC-SEC SECTION. * PERFORM 100-INIT-SEC * PERFORM 200-MAIN-SEC UNTIL FLG-END = 1 * PERFORM 300-END-SEC * STOP RUN . ***************************************************************** * 初期 処理 ***************************************************************** 100-INIT-SEC SECTION. * INITIALIZE FLG-AREA INITIALIZE STS-AREA INITIALIZE WRK-AREA INITIALIZE CNT-AREA INITIALIZE IDX-AREA INITIALIZE SPA-AREA INITIALIZE RECEERR * DISPLAY "START" PERFORM 100-DBOPEN-SEC * UNSTRING COMMAND-PARAM DELIMITED BY "," INTO LNK-PRTKANRI-RENNUM LNK-PRTKANRI-TBL-KEY LNK-PRTKANRI-TBL-GROUP LNK-PRTKANRI-SHORI-RENNUM LNK-PRTKANRI-SRYYM LNK-PRTKANRI-SKYYMD LNK-PRTKANRI-SHELLID LNK-PRTKANRI-PRIORITY LNK-PRTKANRI-TERMID LNK-PRTKANRI-OPID LNK-PRTKANRI-PRTNM WRK-PARA-JOBID WRK-PARA-SHELLID WRK-PARA-HOSPNUM WRK-PARA-SYORIFLG WRK-PARA-STSRYYM WRK-PARA-EDSRYYM RECEERR END-UNSTRING MOVE WRK-PARA-HOSPNUM TO SPA-HOSPNUM * * ステップ開始処理 MOVE "STS" TO SJOBKANRI-MODE INITIALIZE JOBKANRI-REC MOVE SPA-HOSPNUM TO JOB-HOSPNUM MOVE WRK-PARA-JOBID TO JOB-JOBID MOVE WRK-PARA-SHELLID TO JOB-SHELLID MOVE "SEIKYU2005" TO JOB-PGID MOVE "福祉CSV処理" TO JOB-SHELLMSG CALL "ORCSJOB" USING ORCSJOBKANRIAREA JOBKANRI-REC SPA-AREA * * 対象年月最終日取得 INITIALIZE WRK-SYMD MOVE LNK-PRTKANRI-SRYYM TO WRK-SYMD(1:6) PERFORM 31012-LASTDAY-GET-SEC MOVE WRK-SYMD TO WRK-LASTYMD * MOVE LNK-PRTKANRI-SRYYM TO WRK-SYMD (1:6) MOVE "01" TO WRK-SYMD (7:2) PERFORM 31012-SEIWA-HEN-SEC MOVE WRK-HENYMDG(1:16) TO WRK-SRYYMWH * INITIALIZE STS-AREA-DAY INITIALIZE LNK-DAY2-AREA MOVE "21" TO LNK-DAY2-IRAI MOVE LNK-PRTKANRI-SKYYMD TO LNK-DAY2-YMD CALL "ORCSDAY" USING STS-AREA-DAY LNK-DAY2-AREA IF STS-DAY-RC1 = ZERO MOVE LNK-DAY2-EDTYMD3 TO WRK-SEIYMDWH END-IF * INITIALIZE SGETTEMP-AREA * MOVE WRK-PARA-HOSPNUM TO MF101PARA-HOSPNUM MOVE "MF101ZZ" TO MF101PARA-FILE-ID MOVE LNK-PRTKANRI-TERMID TO MF101PARA-TERMID * MOVE MF101PARA-BASENAME TO SGETTEMP-BASENAMES (1) MOVE RECEERR TO SGETTEMP-BASENAMES (2) CALL "ORCSGETTEMP" USING SGETTEMP-AREA MOVE SGETTEMP-FULLNAMES (1) TO MF101PARA-FULLNAME MOVE SGETTEMP-FULLNAMES (2) TO RECEERR * * 医療機関ID編集 INITIALIZE SYS-1001-REC MOVE "1001" TO SYS-1001-KANRICD MOVE "*" TO SYS-1001-KBNCD IF WRK-PARA-STSRYYM = "999999" MOVE LNK-PRTKANRI-SRYYM TO SYS-1001-STYUKYMD(1:6) SYS-1001-EDYUKYMD(1:6) ELSE MOVE WRK-PARA-EDSRYYM TO SYS-1001-STYUKYMD(1:6) SYS-1001-EDYUKYMD(1:6) END-IF MOVE "01" TO SYS-1001-STYUKYMD(7:2) SYS-1001-EDYUKYMD(7:2) MOVE SPA-HOSPNUM TO SYS-1001-HOSPNUM MOVE SYS-1001-REC TO MCPDATA-REC PERFORM 800-SYSKANRI-READ-SEC IF FLG-SYSKANRI = ZERO MOVE MCPDATA-REC TO SYS-1001-REC ELSE DISPLAY "*** SEIKYU2005 SYS 1001 ERR ***" MOVE 1 TO FLG-END END-IF * * 医療機関情報−所在地、連絡先 INITIALIZE SYS-1002-REC MOVE "1002" TO SYS-1002-KANRICD MOVE "*" TO SYS-1002-KBNCD IF WRK-PARA-STSRYYM = "999999" MOVE LNK-PRTKANRI-SRYYM TO SYS-1002-STYUKYMD(1:6) SYS-1002-EDYUKYMD(1:6) ELSE MOVE WRK-PARA-EDSRYYM TO SYS-1002-STYUKYMD(1:6) SYS-1002-EDYUKYMD(1:6) END-IF MOVE "01" TO
COBOL
SYS-1002-STYUKYMD(7:2) SYS-1002-EDYUKYMD(7:2) MOVE SPA-HOSPNUM TO SYS-1002-HOSPNUM MOVE SYS-1002-REC TO MCPDATA-REC PERFORM 800-SYSKANRI-READ-SEC IF FLG-SYSKANRI = ZERO MOVE MCPDATA-REC TO SYS-1002-REC ELSE DISPLAY "*** SEIKYU2005 SYS 1002 ERR ***" MOVE 1 TO FLG-END END-IF * * プログラムオプション取込み PERFORM 100-OPTION-SELECT-SEC * * パラメタ編集処理 PERFORM 1001-PARA-HENSYU-SEC * PERFORM 900-KOHSKY-START-SEC . 100-INIT-EXT. EXIT. * ***************************************************************** * プログラムオプション取込み処理 ***************************************************************** 100-OPTION-SELECT-SEC SECTION. * MOVE "SEIKYU2005" TO WRK-PRGID * * プログラムオプション取得 * 対象公費番号 MOVE "TAISYOKOHI" TO WRK-KBNCD PERFORM 1001-OPTION-SET-SEC PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > 100 OR WRK-OPTION(IDX) = SPACE MOVE WRK-OPTION(IDX)(1:3) TO WRK-TAISYO-KOHNUM(IDX) DISPLAY "対象公費番号=" WRK-TAISYO-KOHNUM(IDX) END-PERFORM * . 100-OPTION-SELECT-EXT. EXIT. ***************************************************************** * プログラムオプションパラメタセット処理 ***************************************************************** 1001-OPTION-SET-SEC SECTION. * INITIALIZE WRK-OPTION-TBL FLG-OK * プログラムオプション情報読込 PERFORM 900-PRGOPTION-READ-SEC * * オプション数の初期設定 MOVE 1 TO IDX1 IF FLG-PRGOPTION = ZERO PERFORM VARYING IDX FROM 1 BY 1 UNTIL (IDX > 44000 ) OR (IDX1 > 100) OR (FLG-OK NOT = ZERO) * * オプションの1桁目が空白であれば処理終了 IF PRGOPTION-OPTION(IDX:1) = SPACE AND IDY = ZERO MOVE 1 TO FLG-OK END-IF * IF FLG-OK = ZERO * 改行地点か IF PRGOPTION-OPTION(IDX:1) = X"0A" OR IDY >= 100 ADD 1 TO IDX1 MOVE ZERO TO IDY ELSE ADD 1 TO IDY * PGオプション内容を1文字ずつセット MOVE PRGOPTION-OPTION(IDX:1) TO WRK-OPTION(IDX1)(IDY:1) END-IF END-IF END-PERFORM END-IF * . 1001-OPTION-SET-EXT. EXIT. * ***************************************************************** * パラメタ編集処理 ***************************************************************** 1001-PARA-HENSYU-SEC SECTION. * MOVE ZERO TO IDXX FLG-SYORI INITIALIZE TABLE-AREA * IF WRK-PARA-SYORIFLG = "1" INITIALIZE BTPARA-REC MOVE SPA-HOSPNUM TO BTPARA-HOSPNUM MOVE WRK-PARA-SHELLID TO BTPARA-SHELLID MOVE WRK-PARA-JOBID TO BTPARA-JOBID MOVE BTPARA-REC TO MCPDATA-REC MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_btpara" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE "tbl_btpara" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME PERFORM 900-BTPARA-READ-N-SEC ELSE INITIALIZE BTPARA-REC MOVE 1 TO FLG-BTPARA END-IF * PERFORM UNTIL FLG-BTPARA = 1 ADD 1 TO IDXX IF BTPARA-INFO-KBN = "1" MOVE 1 TO FLG-SYORI MOVE BTPARA-INFO-PARA TO TBL-PARA-HKNJANUM(IDXX) ELSE MOVE 2 TO FLG-SYORI MOVE BTPARA-INFO-PTID TO TBL-PARA-PTID(IDXX) END-IF DISPLAY "パラメタ区分=" BTPARA-INFO-KBN "パラメタ=" BTPARA-INFO-PARA "保険者番号=" TBL-PARA-HKNJANUM(IDXX) "患者番号=" TBL-PARA-PTID(IDXX) * MOVE "tbl_btpara" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME PERFORM 900-BTPARA-READ-N-SEC END-PERFORM * MOVE "tbl_btpara" TO MCP-TABLE MOVE "key5" TO MCP-PATHNAME MOVE "DBCLOSECURSOR" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * IF IDXX = ZERO MOVE ZERO TO WRK-PARA-SYORIFLG END-IF END-IF . 1001-PARA-HENSYU-EXT. EXIT. * ***************************************************************** * 主  処理 ***************************************************************** 200-MAIN-SEC SECTION. * OPEN OUTPUT MF101-FILE CLOSE MF101-FILE OPEN I-O MF101-FILE * MOVE ZERO TO FLG-END * MOVE ZERO TO WRK-TOWN MOVE ZERO TO IDX-TOWN * PERFORM 2001-SYUKEI-SEC UNTIL FLG-END = 1 * CLOSE MF101-FILE * IF CNT-MF101 > 0 * CSVファイル出力 PERFORM 2002-PRINT-SEC END-IF MOVE 1 TO FLG-END * . 200-MAIN-EXT. EXIT. * ***************************************************************** * 集計処理 ***************************************************************** 2001-SYUKEI-SEC SECTION. * * 月途中の公費切替え対応 PERFORM VARYING IDZ FROM 1 BY 1 UNTIL IDZ > 4 INITIALIZE WRK-CHK-KOHNUM-TBL MOVE RECE02-KOHNUM(IDZ) TO WRK-CHK-KOHNUM(1) * 対象公費番号チェック処理 PERFORM 800-TAISYOKOHI-CHK-SEC IF FLG-TAISYO = 1 PERFORM 20011-SYUKEI-SEC END-IF END-PERFORM * IF FLG-END = ZERO PERFORM 900-KOHSKY-READ-SEC END-IF *
COBOL
. 2001-SYUKEI-EXT. EXIT. ** ***************************************************************** * 集計処理2 ***************************************************************** 20011-SYUKEI-SEC SECTION. * * TMP-FILE キーセット * INITIALIZE MF101-REC * MOVE SPA-HOSPNUM TO MF101-HOSPNUM MOVE RECE02-PTNUM TO MF101-PTNUM MOVE RECE02-RECEKA TO MF101-SRYKA MOVE RECE02-HKNJANUM-KEY TO MF101-HKNJANUM-KEY MOVE RECE02-TEKSTYMD TO MF101-TEKSTYMD MOVE RECE02-NYUGAIKBN TO MF101-NYUGAIKBN MOVE RECE02-SRYYM TO MF101-SRYYM MOVE RECE02-TEISYUTUSAKI TO MF101-TEISYUTUSAKI MOVE RECE02-RECESYUBETU TO MF101-RECESYUBETU MOVE RECE02-HOJOKBN-KEY TO MF101-HOJOKBN-KEY * MOVE RECE02-PTID TO MF101-PTID MOVE RECE02-NAME TO MF101-NAME MOVE RECE02-KANANAME TO MF101-KANANAME MOVE RECE02-BIRTHDAY TO MF101-BIRTHDAY MOVE RECE02-SEX TO MF101-SEX MOVE RECE02-AGE TO MF101-AGE MOVE RECE02-HKN TO MF101-HKN MOVE RECE02-RJNHKN TO MF101-RJNHKN MOVE RECE02-ZAITAKU TO MF101-ZAI * MOVE RECE02-KOHFTNJANUM (IDZ) TO MF101-FTNJANUM MOVE RECE02-KOHINF (IDZ) TO MF101-KOHINF COMPUTE IDY = IDZ + 1 * 保険のデータ取得 MOVE RECE02-JNISSU(IDY) TO MF101-JNISSU MOVE RECE02-FTNMONEY(IDY) TO MF101-FTNMONEY2 MOVE RECE02-TOTALTEN(IDY) TO MF101-TOTALTEN MOVE RECE02-SHOKUJIINF(1) TO MF101-SHOKUJIINF * * 正しい市町村番号か IF RECE02-KOHFTNJANUM(IDZ)(1:3) > 150 OR RECE02-KOHFTNJANUM(IDZ) = SPACE MOVE ZERO TO CNT-RECE02 MOVE "不明な負担者番号です。患者番号:" TO WRK-RECEERR MOVE RECE02-PTNUM TO WRK-RECEERR(33:) MOVE 1 TO FLG-END PERFORM 900-KOHSKY-CLOSE-SEC PERFORM 500-ERR-HENSYU-SEC GO TO 20011-SYUKEI-EXT END-IF * IF RECE02-KOHFTNJANUM(IDZ)(3:1) = SPACE MOVE ZERO TO CNT-RECE02 MOVE "負担者番号が3桁未満です。患者番号:" TO WRK-RECEERR MOVE RECE02-PTNUM TO WRK-RECEERR(37:) MOVE 1 TO FLG-END PERFORM 900-KOHSKY-CLOSE-SEC PERFORM 500-ERR-HENSYU-SEC GO TO 20011-SYUKEI-EXT END-IF * * 個別発行用市町村番号 MOVE RECE02-KOHFTNJANUM(IDZ)(1:3) TO WRK-KOBETUCITYNUM * * 請求管理情報より、他公費情報取得 IF IDZ = 1 AND RECE02-KOHNUM(IDZ + 1) = SPACE PERFORM 900-SEIKYU-READ-SEC PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > 2 OR RECE10-KOHNUM(IDX) = SPACE IF RECE10-KOHNUM(IDX) NOT = "012" MOVE RECE10-KOHNUM(IDX) TO MF101-EKOHNUM(IDX) MOVE RECE10-JNISSU(IDX + 1) TO MF101-ENISSU(IDX) MOVE RECE10-TOTALTEN(IDX + 1) TO MF101-ETENSU(IDX) MOVE RECE10-FTNMONEY(IDX + 1) TO MF101-EITBFTN(IDX) *食事日数 MOVE RECE10-SHOKUJINISSU(IDX + 1) TO MF101-E-SHOKUJINISSU(IDX) *食事療養日 MOVE RECE10-SHOKUJIRYOYOHI(IDX + 1) TO MF101-E-SHOKUJIRYOYOHI(IDX) *食事標準負担額 MOVE RECE10-SHOKUJIFTN(IDX + 1) TO MF101-E-SHOKUJIFTN(IDX) MOVE RECE10-KOHNUM(IDX) TO WRK-KOHNUM PERFORM 930-PTKOHINF-SET-SEC MOVE WRK-ETC-FTNJANUM TO MF101-EKOHFTNJANUM(IDX) MOVE WRK-ETC-JKYSNUM TO MF101-EKOHJKYSNUM(IDX) END-IF END-PERFORM * 特記事項 PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > 3 IF RECE10-TOKKI(IDX) NOT = SPACE DISPLAY "RECE10-TOKKI(IDX) =" RECE10-TOKKI(IDX) MOVE RECE10-TOKKI(IDX) TO MF101-TOKKI(IDX) END-IF END-PERFORM END-IF * * 助成判定及び、月途中で公費を切替えた時の全国公費分のデータ集計 MOVE MF101-KOHNUM TO WRK-KOHNUM MOVE MF101-KOHID TO WRK-KOHID MOVE ZERO TO WRK-FTNMONEY-G INITIALIZE WRK-ETC-TBL IF RECE02-NYUGAIKBN = "1" MOVE "key33" TO WRK-PATH ELSE MOVE "key25" TO WRK-PATH END-IF PERFORM 920-SYUNOU-SET-SEC IF IDZ = 1 AND RECE02-KOHNUM(IDZ + 1) = SPACE DISPLAY "請求管理から公費情報取得済み" RECE02-PTNUM ELSE DISPLAY "患者番号=" RECE02-PTNUM "その他公費=" WRK-ETC-KOHNUM(1) IF WRK-ETC-KOHNUM(1) NOT = SPACE DISPLAY "その他公費番号=" WRK-ETC-KOHNUM(1) "," WRK-ETC-KOHNUM(2) IF WRK-ETC-KOHNUM(2) = SPACE OR WRK-ETC-KOHNUM(2) > WRK-ETC-KOHNUM(1) MOVE 1 TO IDX MOVE 2 TO IDY ELSE MOVE 2 TO IDX MOVE 1 TO IDY END-IF MOVE WRK-ETC-KOHNUM(1) TO WRK-KOHNUM PERFORM 930-PTKOHINF-SET-SEC MOVE WRK-ETC-TENSU(1) TO MF101-ETENSU(IDX) MOVE WRK-ETC-ITBFTN(1) TO MF101
COBOL
-EITBFTN(IDX) MOVE WRK-ETC-FTNJANUM TO MF101-EKOHFTNJANUM(IDX) MOVE WRK-ETC-JKYSNUM TO MF101-EKOHJKYSNUM(IDX) *食事 MOVE WRK-ETC-SKJ-NISSU(1) TO MF101-E-SHOKUJINISSU(IDX) MOVE WRK-ETC-SKJ-RYOYOHI(1) TO MF101-E-SHOKUJIRYOYOHI(IDX) MOVE WRK-ETC-SKJ-FTN(1) TO MF101-E-SHOKUJIFTN(IDX) IF WRK-ETC-KOHNUM(2) NOT = SPACE MOVE WRK-ETC-KOHNUM(2) TO WRK-KOHNUM PERFORM 930-PTKOHINF-SET-SEC MOVE WRK-ETC-TENSU(2) TO MF101-ETENSU(IDY) MOVE WRK-ETC-ITBFTN(2) TO MF101-EITBFTN(IDY) MOVE WRK-ETC-FTNJANUM TO MF101-EKOHFTNJANUM(IDY) MOVE WRK-ETC-JKYSNUM TO MF101-EKOHJKYSNUM(IDY) *食事 MOVE WRK-ETC-SKJ-NISSU(2) TO MF101-E-SHOKUJINISSU(IDY) MOVE WRK-ETC-SKJ-RYOYOHI(2) TO MF101-E-SHOKUJIRYOYOHI(IDY) MOVE WRK-ETC-SKJ-FTN(2) TO MF101-E-SHOKUJIFTN(IDY) END-IF END-IF END-IF * IF RECE02-FTNMONEY(1) > ZERO AND RECE02-FTNMONEY(1) < WRK-FTNMONEY-G MOVE RECE02-FTNMONEY(1) TO WRK-FTNMONEY-G END-IF MOVE WRK-FTNMONEY-G TO MF101-FTNMONEY * * 保険者番号チェック処理 MOVE ZERO TO FLG-ERR PERFORM 200111-HKNJANUM-CHK-SEC * IF FLG-ERR = 1 OR MF101-FTNMONEY2 = ZERO DISPLAY "助成対象外=" RECE02-PTNUM CONTINUE ELSE WRITE MF101-REC ADD 1 TO CNT-MF101 * CSV総括用件数カウント MOVE RECE02-KOHFTNJANUM(IDZ)(1:3) TO WRK-TOWN COMPUTE IDX-TOWN = WRK-TOWN + 1 * 診療年月でデータを分ける PERFORM VARYING IDX1 FROM 1 BY 1 UNTIL IDX1 > 10 OR WRK-GOKEI-YM (IDX1) = ZERO IF MF101-SRYYM = WRK-GOKEI-YM (IDX1) ADD 1 TO WRK-GOKEIKENSU(IDX1 IDX-TOWN) MOVE 10 TO IDX1 END-IF END-PERFORM * その診療年月で初データの場合 IF IDX1 < 10 MOVE MF101-SRYYM TO WRK-GOKEI-YM (IDX1) ADD 1 TO WRK-GOKEIKENSU(IDX1 IDX-TOWN) END-IF ADD 1 TO WRK-SOUGOKEIKENSU END-IF * . 20011-SYUKEI-EXT. EXIT. * ***************************************************************** * 個別発行時の保険者番号(市町村番号)チェック処理 ***************************************************************** 200111-HKNJANUM-CHK-SEC SECTION. * INITIALIZE WRK-HKNJANUM MOVE "20" TO WRK-HKNJANUM(1:2) MOVE WRK-KOBETUCITYNUM(1:3) TO WRK-HKNJANUM(3:3) * IF WRK-PARA-SYORIFLG = "1" AND FLG-SYORI = 1 AND FLG-ERR = ZERO * MOVE 1 TO FLG-ERR PERFORM VARYING IDXX FROM 1 BY 1 UNTIL IDXX > WRK-CONS-PARA-MAX OR TBL-PARA-HKNJANUM(IDXX) = SPACE IF WRK-HKNJANUM(1:5) = TBL-PARA-HKNJANUM(IDXX)(1:5) MOVE ZERO TO FLG-ERR MOVE WRK-CONS-PARA-MAX TO IDXX END-IF END-PERFORM END-IF * . 200111-HKNJANUM-CHK-EXT. EXIT. * ***************************************************************** * 帳票ファイル出力処理 ***************************************************************** 2002-PRINT-SEC SECTION. * DISPLAY "2002-PRINT START" * OPEN INPUT MF101-FILE * MOVE ZERO TO WRK-RECENO MOVE ZERO TO FLG-PRINT MOVE ZERO TO WRK-TOWN MOVE ZERO TO IDX-TOWN * * 一時ファイル読込 PERFORM 900-TMP-READ-SEC * * CSVヘッダー処理 PERFORM 330-CSVH-HEN-SEC * PERFORM VARYING IDX3 FROM 1 BY 1 UNTIL FLG-PRINT = 1 * CSV<総括>処理 PERFORM 331-CSVSOKATU-HEN-SEC * PERFORM UNTIL MF101-KOHFTNJANUM(1:3) NOT = WRK-TOWN OR MF101-SRYYM NOT = WRK-CHK-SRYYM OR FLG-PRINT = 1 * CSV<レセ>処理 PERFORM 332-CSVRECE-HEN-SEC END-PERFORM * END-PERFORM * CSV<合計>処理 PERFORM 333-CSVGOKEI-HEN-SEC * CSV<トレーラ>処理 PERFORM 334-CSVTRAILER-HEN-SEC * CLOSE MF101-FILE * . 2002-PRINT-EXT. EXIT. * ***************************************************************** * CSV編集<ヘッダー>処理 ***************************************************************** 330-CSVH-HEN-SEC SECTION. * INITIALIZE WRK-REC WRK-REC-LENGTH * ヘッダー * * レコード区分 MOVE "1" TO WRK-DATA MOVE 1 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 作成年月日 MOVE LNK-PRTKANRI-SKYYMD TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 医療機関コード MOVE "201" TO WRK-NUM(1:) MOVE SYS-1001-HOSPCD TO WRK-NUM(4:) MOVE 10 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * マルチボリューム識別番号 MOVE "00" TO WRK-DATA MOVE 2 TO WRK-NAGASA MOVE 1
COBOL
TO WRK-END PERFORM 5004-MOJI-HENSYU-SEC * * 改行コード編集 STRING WRK-REC(1:WRK-REC-LENGTH) DELIMITED BY SIZE WRK-KAIGYO DELIMITED BY SIZE INTO WRK-REC END-STRING * PERFORM 500-CSVINFO-SEC * . 330-CSVH-HEN-EXT. EXIT. * ***************************************************************** * CSV編集<内容>処理 ***************************************************************** 331-CSVSOKATU-HEN-SEC SECTION. * INITIALIZE WRK-REC WRK-REC-LENGTH WRK-MOJIHEN * 総括 * MOVE MF101-KOHFTNJANUM(1:3) TO WRK-TOWN COMPUTE IDX-TOWN = WRK-TOWN + 1 MOVE MF101-SRYYM TO WRK-CHK-SRYYM * PERFORM VARYING IDX1 FROM 1 BY 1 UNTIL IDX1 > 10 IF MF101-SRYYM = WRK-GOKEI-YM (IDX1) MOVE WRK-GOKEIKENSU(IDX1 IDX-TOWN) TO WRK-MOJIHEN MOVE 10 TO IDX1 END-IF END-PERFORM * * レコード区分 MOVE "2" TO WRK-DATA MOVE 1 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 診療年月 MOVE MF101-SRYYM TO WRK-NUM MOVE 6 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 医療機関コード MOVE "201" TO WRK-NUM(1:) MOVE SYS-1001-HOSPCD TO WRK-NUM(4:) MOVE 10 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 旧総合病院診療科 IF SYS-1001-HOSPSBT1 = 1 MOVE MF101-SRYKA TO WRK-NUM ELSE MOVE 00 TO WRK-NUM END-IF MOVE 2 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 福祉市町村コード MOVE MF101-KOHFTNJANUM(1:3) TO WRK-DATA MOVE 3 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 件数 MOVE WRK-MOJIHEN TO WRK-NUM MOVE 5 TO WRK-NAGASA MOVE 1 TO WRK-END PERFORM 5005-NUM-HENSYU-SEC * * 改行コード編集 STRING WRK-REC(1:WRK-REC-LENGTH) DELIMITED BY SIZE WRK-KAIGYO DELIMITED BY SIZE INTO WRK-REC END-STRING * PERFORM 500-CSVINFO-SEC * . 331-CSVSOKATU-HEN-EXT. EXIT. * ***************************************************************** * CSV編集<内容>処理 ***************************************************************** 332-CSVRECE-HEN-SEC SECTION. * INITIALIZE WRK-REC WRK-REC-LENGTH INITIALIZE FLG-MOJI INITIALIZE WRK-MOJIST INITIALIZE WRK-MOJIED * * レセプト * * レコード区分 MOVE 3 TO WRK-NUM MOVE 1 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 1.データNo ADD 1 TO WRK-RECENO MOVE WRK-RECENO TO WRK-NUM MOVE 5 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 2.福祉市町村コード MOVE MF101-KOHFTNJANUM(1:3) TO WRK-DATA MOVE 3 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 3.事業コード MOVE MF101-KOHJKYSNUM(1:2) TO WRK-DATA MOVE 2 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 4.福祉受給者番号 MOVE MF101-KOHJKYSNUM(3:) TO WRK-DATA MOVE 10 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 5.保険者番号 * 保険者の先頭スペース詰め PERFORM VARYING IDX2 FROM 1 BY 1 UNTIL FLG-MOJI = 1 OR WRK-MOJIED = 8 IF MF101-HKNJANUM(IDX2:1) = SPACE MOVE 1 TO FLG-MOJI ELSE ADD 1 TO WRK-MOJIED END-IF END-PERFORM * COMPUTE WRK-MOJIST = 9 - WRK-MOJIED MOVE SPACE TO WRK-HKNJACVS MOVE MF101-HKNJANUM TO WRK-HKNJACVS(WRK-MOJIST:WRK-MOJIED) IF MF101-HKNNUM = "067" MOVE SPACE TO WRK-HKNJACVS(1:2) END-IF MOVE WRK-HKNJACVS TO WRK-DATA MOVE 8 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 6.診療年月 MOVE MF101-SRYYM TO WRK-NUM MOVE 6 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 7.保険種別 EVALUATE TRUE WHEN MF101-RJNHKNNUM = "027" WHEN MF101-HKNNUM = "039" OR "040" MOVE 3 TO WRK-RECEHKNSHU WHEN MF101-HKNNUM = "063" OR "072" OR "073" OR "067" OR "074" OR "075" MOVE 4 TO WRK-RECEHKNSHU WHEN OTHER MOVE 1 TO WRK-RECEHKNSHU END-EVALUATE MOVE WRK-RECEHKNSHU TO WRK-NUM MOVE 1 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 8.本人家族入外区分 MOVE MF101-RECESYUBETU(4:1) TO WRK-DATA MOVE 1 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 9.老人保健市町村番号 MOVE MF101-RJNFTNJANUM TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 10.公費1・負担者番号 MOVE MF101-EKOHFTNJANUM(1) TO WRK-N
COBOL
UM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 11.公費2・負担者番号 MOVE MF101-EKOHFTNJANUM(2) TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 12.給付割合 EVALUATE MF101-KYURATE WHEN 30 MOVE 70 TO WRK-RATE WHEN 20 MOVE 80 TO WRK-RATE WHEN 10 MOVE 90 TO WRK-RATE END-EVALUATE MOVE WRK-RATE TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 13.記号 MOVE MF101-KIGO TO WRK-DATA MOVE 40 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 14.番号 MOVE MF101-NUM TO WRK-DATA MOVE 40 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 15.受給者氏名 MOVE MF101-NAME TO WRK-DATA MOVE 60 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 16.性別 MOVE MF101-SEX TO WRK-NUM MOVE 1 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 17.生年月日 MOVE MF101-BIRTHDAY TO WRK-DATA MOVE 8 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 18.特記事項1 MOVE MF101-TOKKI(1) TO WRK-DATA MOVE 2 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 19.特記事項2 MOVE MF101-TOKKI(2) TO WRK-DATA MOVE 2 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 20.特記事項3 MOVE MF101-TOKKI(3) TO WRK-DATA MOVE 2 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC * * 21.保険・診療実日数 MOVE MF101-JNISSU TO WRK-NUM MOVE 3 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 22.公費1・診療実日数 MOVE MF101-ENISSU(1) TO WRK-NUM MOVE 3 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 23.公費2・診療実日数 MOVE MF101-ENISSU(2) TO WRK-NUM MOVE 3 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 24.保険・点数 MOVE MF101-TOTALTEN TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 25.公費1・点数 MOVE MF101-ETENSU(1) TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 26.公費2・点数 MOVE MF101-ETENSU(2) TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 27.保険・一部負担金 MOVE MF101-FTNMONEY TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 28.公費1・一部負担金 MOVE MF101-EITBFTN(1) TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 29.公費2・一部負担金 MOVE MF101-EITBFTN(2) TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 30.保険・食事日数 MOVE MF101-SHOKUJINISSU TO WRK-NUM MOVE 3 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 31.保険・食事基準額 MOVE MF101-SHOKUJIRYOYOHI TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 32.保険・食事標準負担額 MOVE MF101-SHOKUJIFTN TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 33.公費1・食事日数 IF MF101-EKOHNUM (1) NOT = SPACE AND MF101-E-SHOKUJINISSU(1) = 0 MOVE "0" TO WRK-DATA MOVE 1 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC ELSE MOVE MF101-E-SHOKUJINISSU(1) TO WRK-NUM MOVE 3 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC END-IF * * 34.公費1・食事基準額 IF MF101-EKOHNUM (1) NOT = SPACE AND MF101-E-SHOKUJIRYOYOHI(1) = 0 MOVE "0" TO WRK-DATA MOVE 1 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC ELSE MOVE MF101-E-SHOKUJIRYOYOHI(1) TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC END-IF * * 35.公費1・食事標準負担額 IF MF101-EKOHNUM (1) NOT = SPACE AND MF101-E-SHOKUJIFTN(1) = 0 MOVE "0" TO WRK-DATA MOVE 1 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC ELSE MOVE MF101-E-SHOKUJIFTN(1) TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC END-IF * * 36.公費2・食事日数 IF MF101-EKOHNUM (2) NOT = SPACE AND MF101-E
COBOL
-SHOKUJINISSU(2) = 0 MOVE "0" TO WRK-DATA MOVE 1 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC ELSE MOVE MF101-E-SHOKUJINISSU(2) TO WRK-NUM MOVE 3 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC END-IF * * 37.公費2・食事基準額 IF MF101-EKOHNUM (2) NOT = SPACE AND MF101-E-SHOKUJIRYOYOHI(2) = 0 MOVE "0" TO WRK-DATA MOVE 1 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC ELSE MOVE MF101-E-SHOKUJIRYOYOHI(2) TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC END-IF * * 38.公費2・食事標準負担額 IF MF101-EKOHNUM (2) NOT = SPACE AND MF101-E-SHOKUJIFTN(2) = 0 MOVE "0" TO WRK-DATA MOVE 1 TO WRK-NAGASA PERFORM 5004-MOJI-HENSYU-SEC ELSE MOVE MF101-E-SHOKUJIFTN(2) TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC END-IF * * 39.公費1・対象一部負担金 MOVE ZERO TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 40.公費2・対象一部負担金 MOVE ZERO TO WRK-NUM MOVE 8 TO WRK-NAGASA MOVE 1 TO WRK-END PERFORM 5005-NUM-HENSYU-SEC * * 改行コード編集 STRING WRK-REC(1:WRK-REC-LENGTH) DELIMITED BY SIZE WRK-KAIGYO DELIMITED BY SIZE INTO WRK-REC END-STRING * PERFORM 500-CSVINFO-SEC * * 一時ファイル読込 PERFORM 900-TMP-READ-SEC . 332-CSVRECE-HEN-EXT. EXIT. * ***************************************************************** * CSV編集<合計>処理 ***************************************************************** 333-CSVGOKEI-HEN-SEC SECTION. * INITIALIZE WRK-REC WRK-REC-LENGTH * * 合計 * * レコード区分 MOVE 8 TO WRK-NUM MOVE 1 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 作成年月日 MOVE LNK-PRTKANRI-SKYYMD TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 医療機関コード MOVE "201" TO WRK-NUM(1:) MOVE SYS-1001-HOSPCD TO WRK-NUM(4:) MOVE 10 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 明細レコード数 MOVE WRK-SOUGOKEIKENSU TO WRK-NUM MOVE 7 TO WRK-NAGASA MOVE 1 TO WRK-END PERFORM 5005-NUM-HENSYU-SEC * * 改行コード編集 STRING WRK-REC(1:WRK-REC-LENGTH) DELIMITED BY SIZE WRK-KAIGYO DELIMITED BY SIZE INTO WRK-REC END-STRING * PERFORM 500-CSVINFO-SEC * . 333-CSVGOKEI-HEN-EXT. EXIT. * ***************************************************************** * CSV編集<トレーラ>処理 ***************************************************************** 334-CSVTRAILER-HEN-SEC SECTION. * INITIALIZE WRK-REC WRK-REC-LENGTH * *  トレーラ * * レコード区分 MOVE 9 TO WRK-NUM MOVE 1 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 作成年月日 MOVE LNK-PRTKANRI-SKYYMD TO WRK-NUM MOVE 8 TO WRK-NAGASA PERFORM 5005-NUM-HENSYU-SEC * * 医療機関コード MOVE "201" TO WRK-NUM(1:) MOVE SYS-1001-HOSPCD TO WRK-NUM(4:) MOVE 10 TO WRK-NAGASA MOVE 1 TO WRK-END PERFORM 5005-NUM-HENSYU-SEC * * 改行コード編集 STRING WRK-REC(1:WRK-REC-LENGTH) DELIMITED BY SIZE WRK-KAIGYO DELIMITED BY SIZE INTO WRK-REC END-STRING * PERFORM 500-CSVINFO-SEC * . 334-CSVTRAILER-HEN-EXT. EXIT. * ***************************************************************** * CSV_INFO出力処理 ***************************************************************** 500-CSVINFO-SEC SECTION. * ADD 1 TO WRK-SCSVINFO-SEQ-NO * INITIALIZE ORCSCSVINFOAREA MOVE "INS" TO SCSVINFO-MODE MOVE WRK-PARA-SHELLID TO SCSVINFO-TBL-KEY MOVE LNK-PRTKANRI-SHELLID TO SCSVINFO-SHELLID MOVE LNK-PRTKANRI-SHORI-RENNUM TO SCSVINFO-SHORI-RENNUM MOVE LNK-PRTKANRI-RENNUM TO SCSVINFO-RENNUM MOVE LNK-PRTKANRI-SRYYM TO SCSVINFO-SRYYM MOVE LNK-PRTKANRI-SKYYMD TO SCSVINFO-SKYYMD MOVE WRK-SCSVINFO-SEQ-NO TO SCSVINFO-SEQ-NO MOVE WRK-SCSVINFO-NYUGAIKBN TO SCSVINFO-NYUGAIKBN MOVE WRK-SCSVINFO-PTID TO SCSVINFO-PTID MOVE WRK-REC TO SCSVINFO-CSVDATA CALL "ORCSCSVINFO" USING ORCSCSVINFOAREA SPA-AREA IF SCSVINFO-RETURN = ZERO ADD 1 TO CNT-OUT ELSE MOVE "CSV用DBに更新できませんでした" TO WRK-RECEERR PERFORM 500-ERR-HENSYU-SEC END-IF * MOVE 1 TO FLG-ERR . 500-CSVINFO-EXT. EXIT. ***************************************************************** * エラー出力処理 ***************************************************************** 500-ERR-HENSYU-SEC SECTION. * OPEN INPUT RECEERR-FILE IF STS-RECEERR = ZERO CONTINUE ELSE OPEN OUTPUT RECEERR-FILE
COBOL
* MOVE WRK-RECEERR TO RECEERR-REC WRITE RECEERR-REC * ジョブ終了処理 MOVE "JBE" TO SJOBKANRI-MODE INITIALIZE JOBKANRI-REC MOVE SPA-HOSPNUM TO JOB-HOSPNUM MOVE WRK-PARA-JOBID TO JOB-JOBID MOVE WRK-PARA-SHELLID TO JOB-SHELLID MOVE WRK-RECEERR TO JOB-YOBI MOVE "9999" TO JOB-ERRCD CALL "ORCSJOB" USING ORCSJOBKANRIAREA JOBKANRI-REC SPA-AREA END-IF * MOVE 1 TO FLG-END CLOSE RECEERR-FILE * . 500-ERR-HENSYU-EXT. EXIT. * ***************************************************************** * 西暦日本語変換処理 ***************************************************************** 31012-SEIWA-HEN-SEC SECTION. * INITIALIZE STS-AREA-DAY INITIALIZE LNK-DAY2-AREA MOVE "21" TO LNK-DAY2-IRAI MOVE WRK-SYMD TO LNK-DAY2-YMD CALL "ORCSDAY" USING STS-AREA-DAY LNK-DAY2-AREA MOVE LNK-DAY2-EDTYMD3 TO WRK-HENYMDG INSPECT WRK-HENYMDG REPLACING ALL " " BY " " . 31012-SEIWA-HEN-EXT. EXIT. * ***************************************************************** * 終了  処理 ***************************************************************** 300-END-SEC SECTION. * CLOSE MF101-FILE MOVE WRK-SOUGOKEIKENSU TO WRK-PARA-PAGE * DISPLAY "*** SEIKYU2005 IN " CNT-RECE02 DISPLAY "*** SEIKYU2005 OUT " CNT-MF101 DISPLAY "*** SEIKYU2005 END ***" * IF CNT-MF101 = 0 DISPLAY "DATA NOT FOUND. PRINT JOB CANCEL!!" END-IF * * ファイル保存情報更新 PERFORM 3001-FILE-INFO-INSERT-SEC * * ステップ終了処理 MOVE "STE" TO SJOBKANRI-MODE INITIALIZE JOBKANRI-REC MOVE SPA-HOSPNUM TO JOB-HOSPNUM MOVE WRK-PARA-PAGE TO JOB-UPDCNT MOVE WRK-PARA-JOBID TO JOB-JOBID MOVE WRK-PARA-SHELLID TO JOB-SHELLID CALL "ORCSJOB" USING ORCSJOBKANRIAREA JOBKANRI-REC SPA-AREA * PERFORM 900-DBDISCONNECT-SEC . 300-END-EXT. EXIT. * ***************************************************************** * 対象公費番号チェック処理 ***************************************************************** 800-TAISYOKOHI-CHK-SEC SECTION. * INITIALIZE FLG-TAISYO * PERFORM VARYING IDXX FROM 1 BY 1 UNTIL IDXX > 100 OR WRK-TAISYO-KOHNUM(IDXX) = SPACE IF WRK-CHK-KOHNUM(1) = WRK-TAISYO-KOHNUM(IDXX) OR WRK-CHK-KOHNUM(2) = WRK-TAISYO-KOHNUM(IDXX) OR WRK-CHK-KOHNUM(3) = WRK-TAISYO-KOHNUM(IDXX) OR WRK-CHK-KOHNUM(4) = WRK-TAISYO-KOHNUM(IDXX) MOVE 1 TO FLG-TAISYO MOVE 100 TO IDXX END-IF END-PERFORM * . 800-TAISYOKOHI-CHK-EXT. EXIT. * ***************************************************************** * ファイル保存情報更新処理 ***************************************************************** 3001-FILE-INFO-INSERT-SEC SECTION. * INITIALIZE ORCSFILESVAREA MOVE "I" TO SFILESV-MODE MOVE WRK-PARA-SHELLID TO SFILESV-TBL-KEY MOVE LNK-PRTKANRI-SHELLID TO SFILESV-SHELLID (1) MOVE LNK-PRTKANRI-SHORI-RENNUM TO SFILESV-SHORI-RENNUM (1) MOVE LNK-PRTKANRI-RENNUM TO SFILESV-RENNUM (1) MOVE LNK-PRTKANRI-SRYYM TO SFILESV-SRYYM (1) MOVE LNK-PRTKANRI-SKYYMD TO SFILESV-SKYYMD (1) MOVE "FUKUSHI.DAT" TO SFILESV-TO-DATA (1) MOVE WRK-SOUGOKEIKENSU TO SFILESV-CNT-ALL (1) MOVE "福祉CSV" TO SFILESV-TITLE (1) IF WRK-SOUGOKEIKENSU > ZERO MOVE "1" TO SFILESV-DATA-TYPE(1) END-IF MOVE WRK-RECEERR TO SFILESV-ERR-MSG (1) IF WRK-RECEERR NOT = SPACE MOVE "1" TO SFILESV-ERR-CODE (1) END-IF MOVE "1" TO SFILESV-CODE-TYPE (1) * CALL "ORCSFILESV" USING ORCSFILESVAREA SPA-AREA . 3001-FILE-INFO-INSERT-EXT. EXIT. * ***************************************************************** * 一時ファイル読込 ***************************************************************** 900-TMP-READ-SEC SECTION. * READ MF101-FILE NEXT AT END MOVE 1 TO FLG-PRINT END-READ . 900-TMP-READ-EXT. EXIT. ***************************************************************** * 公費請求書マスタ読込 ***************************************************************** 900-KOHSKY-START-SEC SECTION. * INITIALIZE RECE02-REC MOVE SPA-HOSPNUM TO RECE02-HOSPNUM MOVE LNK-PRTKANRI-SRYYM TO RECE02-SKYYM MOVE RECE02-REC TO MCPDATA-REC * MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_kohsky" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO PERFORM 900-KOHSKY-READ-SEC ELSE MOVE 1 TO FLG-END PERFORM 900-KOHSKY-CLOSE-SEC END-IF . 900-KOHSKY-START-EXT. EXIT. * ***************************************************************** * 公費請求書マスタREAD ***************************************************************** 900-KOHSKY-READ-SEC SECTION. * MOVE "DBFETCH" TO MCP-FUNC MOVE "tbl_kohsky" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE ZERO TO FLG-END MOVE MCPDATA-REC TO RECE02-REC INITIALIZE WRK-CHK-KOHNUM-TBL MOVE RECE02-KOHNUM(1) TO WRK-CHK-KOHNUM(1) MOVE RECE02-KOHNUM(2)
COBOL
TO WRK-CHK-KOHNUM(2) MOVE RECE02-KOHNUM(3) TO WRK-CHK-KOHNUM(3) MOVE RECE02-KOHNUM(4) TO WRK-CHK-KOHNUM(4) * 対象公費番号チェック処理 PERFORM 800-TAISYOKOHI-CHK-SEC IF FLG-TAISYO = 1 * IF WRK-PARA-STSRYYM = "999999" CONTINUE ELSE IF ( RECE02-SRYYM < WRK-PARA-STSRYYM ) OR ( RECE02-SRYYM > WRK-PARA-EDSRYYM ) GO TO 900-KOHSKY-READ-SEC END-IF END-IF * * テスト患者のときは読み飛ばす MOVE SPACE TO PTINF-REC INITIALIZE PTINF-REC MOVE SPA-HOSPNUM TO PTINF-HOSPNUM MOVE RECE02-PTID TO PTINF-PTID MOVE PTINF-REC TO MCPDATA-REC PERFORM 800-PTINF-READ-SEC IF FLG-PTINF = ZERO AND PTINF-TSTPTNUMKBN = "1" GO TO 900-KOHSKY-READ-SEC END-IF * * 個別発行で患者番号指定の場合、対象判定を行う MOVE ZERO TO FLG-ERR IF WRK-PARA-SYORIFLG = "1" AND FLG-SYORI = 2 MOVE 1 TO FLG-ERR PERFORM VARYING IDXX FROM 1 BY 1 UNTIL IDXX > WRK-CONS-PARA-MAX OR TBL-PARA-PTID(IDXX) = ZERO IF RECE02-PTID = TBL-PARA-PTID(IDXX) MOVE ZERO TO FLG-ERR MOVE WRK-CONS-PARA-MAX TO IDXX END-IF END-PERFORM END-IF * IF FLG-ERR = 1 GO TO 900-KOHSKY-READ-SEC END-IF * ADD 1 TO CNT-RECE02 ELSE GO TO 900-KOHSKY-READ-SEC END-IF ELSE MOVE 1 TO FLG-END PERFORM 900-KOHSKY-CLOSE-SEC END-IF . 900-KOHSKY-READ-EXT. EXIT. * ***************************************************************** * 公費請求マスタCLOSE ***************************************************************** 900-KOHSKY-CLOSE-SEC SECTION. * MOVE "DBCLOSECURSOR" TO MCP-FUNC MOVE "tbl_kohsky" TO MCP-TABLE MOVE "key2" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 900-KOHSKY-CLOSE-EXT. EXIT. * ***************************************************************** * 患者マスタ読込 ***************************************************************** 800-PTINF-READ-SEC SECTION. * MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_ptinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE "DBFETCH" TO MCP-FUNC MOVE "tbl_ptinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE ZERO TO FLG-PTINF MOVE MCPDATA-REC TO PTINF-REC ELSE MOVE 1 TO FLG-PTINF INITIALIZE PTINF-REC END-IF ELSE MOVE 1 TO FLG-PTINF INITIALIZE PTINF-REC END-IF * MOVE "DBCLOSECURSOR" TO MCP-FUNC MOVE "tbl_ptinf" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 800-PTINF-READ-EXT. EXIT. * ***************************************************************** * 保険組合せマスター読み込み ***************************************************************** 910-HKNCOMBI-READ-SEC SECTION. * INITIALIZE HKNCOMBI-REC MOVE SPA-HOSPNUM TO COMB-HOSPNUM MOVE SYU-PTID TO COMB-PTID MOVE SYU-HKNCOMBINUM TO COMB-HKNCOMBINUM MOVE HKNCOMBI-REC TO MCPDATA-REC MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_hkncombi" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE "DBFETCH" TO MCP-FUNC MOVE "tbl_hkncombi" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE MCPDATA-REC TO HKNCOMBI-REC MOVE ZERO TO FLG-HKNCOMBI ELSE INITIALIZE HKNCOMBI-REC MOVE 1 TO FLG-HKNCOMBI END-IF ELSE INITIALIZE HKNCOMBI-REC MOVE 1 TO FLG-HKNCOMBI END-IF * MOVE "DBCLOSECURSOR" TO MCP-FUNC MOVE "tbl_hkncombi" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 910-HKNCOMBI-READ-EXT. EXIT. ***************************************************************** * 請求点数集計処理 ***************************************************************** 800-SEIKYU-SEC SECTION. * PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > 4 OR SYU-KOH-HKNNUM(IDX) = SPACE * IF SYU-KOH-HKNNUM(IDX) NOT = "027" AND SYU-KOH-HKNNUM(IDX)(1:1) = "0" IF WRK-ETC-KOHNUM(1) = SPACE OR SYU-KOH-HKNNUM(IDX) MOVE 1 TO IDY ELSE MOVE 2 TO IDY END-IF DISPLAY "IDY=" IDY MOVE SYU-KOH-HKNNUM(IDX) TO WRK-ETC-KOHNUM(IDY) ADD SYU-TOTAL-HKNTEN TO WRK-ETC-TENSU(IDY) IF (RECE02-FTNMONEY(1) > ZERO) OR (SYU-KOH-HKNNUM(IDX) NOT = "010" AND "011" AND "021" AND "020") ADD SYU-KOH-COMPFTN(IDX) TO WRK-ETC-ITBFTN(IDY) END-IF * 主保険の食事療養費情報から食事療養費、標準負担額を取得 * ※全国公
COBOL
費分がある場合に限り取得しているため、主保険で代用 ADD SYU-SYUSKJ-NISSU TO WRK-ETC-SKJ-NISSU(IDY) ADD SYU-SYUSKJ-RYOYOHI TO WRK-ETC-SKJ-RYOYOHI(IDY) ADD SYU-SYUSKJ-FTN TO WRK-ETC-SKJ-FTN(IDY) END-IF * IF SYU-KOH-HKNNUM(IDX) = "972" MOVE 1 TO MF101-TYOKI END-IF * 長期上位 IF SYU-KOH-HKNNUM(IDX) = "974" MOVE 2 TO MF101-TYOKI END-IF * END-PERFORM * IF RECE02-FTNMONEY(1) > ZERO IF RECE02-RJNHKNNUM NOT = SPACE ADD SYU-KOH-COMPFTN(1) TO WRK-FTNMONEY-G ELSE ADD SYU-SYUCOMPFTN TO WRK-FTNMONEY-G END-IF END-IF * . 800-SEIKYU-SEC-EXT. EXIT. * ***************************************************************** * 収納情報セット ***************************************************************** 920-SYUNOU-SET-SEC SECTION. * INITIALIZE SYUNOU-REC MOVE SPA-HOSPNUM TO SYU-HOSPNUM MOVE RECE02-NYUGAIKBN TO SYU-NYUGAIKBN MOVE RECE02-PTID TO SYU-PTID MOVE RECE02-SRYYM(1:6) TO SYU-SRYYMD(1:6) MOVE "__" TO SYU-SRYYMD(7:2) MOVE WRK-KOHNUM TO SYU-KOH-HKNNUM(1) SYU-KOH-HKNNUM(2) SYU-KOH-HKNNUM(3) SYU-KOH-HKNNUM(4) MOVE SYUNOU-REC TO MCPDATA-REC MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_syunou" TO MCP-TABLE MOVE WRK-PATH TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE "tbl_syunou" TO MCP-TABLE MOVE WRK-PATH TO MCP-PATHNAME PERFORM 925-SYUNOU-READ-SEC * PERFORM UNTIL FLG-SYUNOU = 1 IF SYU-DENPJTIKBN NOT = "3" IF SYU-HKNCOMBINUM = RECE02-HKNCOMBI(1) OR RECE02-HKNCOMBI(2) OR RECE02-HKNCOMBI(3) OR RECE02-HKNCOMBI(4) OR RECE02-HKNCOMBI(5) OR RECE02-HKNCOMBI(6) OR RECE02-HKNCOMBI(7) OR RECE02-HKNCOMBI(8) OR RECE02-HKNCOMBI(9) OR RECE02-HKNCOMBI(10) PERFORM 910-HKNCOMBI-READ-SEC IF COMB-KOHID(1) = WRK-KOHID OR COMB-KOHID(2) = WRK-KOHID OR COMB-KOHID(3) = WRK-KOHID OR COMB-KOHID(4) = WRK-KOHID PERFORM 800-SEIKYU-SEC END-IF END-IF END-IF * MOVE "tbl_syunou" TO MCP-TABLE MOVE WRK-PATH TO MCP-PATHNAME PERFORM 925-SYUNOU-READ-SEC END-PERFORM ELSE DISPLAY "SYUNOU SELECT ERR" END-IF * INITIALIZE MCPAREA MOVE "DBCLOSECURSOR" TO MCP-FUNC MOVE "tbl_syunou" TO MCP-TABLE MOVE WRK-PATH TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 920-SYUNOU-SET-EXT. EXIT. * ***************************************************************** * 収納読込 ***************************************************************** 925-SYUNOU-READ-SEC SECTION. * MOVE "DBFETCH" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE MCPDATA-REC TO SYUNOU-REC MOVE ZERO TO FLG-SYUNOU ELSE INITIALIZE SYUNOU-REC MOVE 1 TO FLG-SYUNOU END-IF * . 925-SYUNOU-READ-EXT. EXIT. * ***************************************************************** * 請求管理情報読み込み ***************************************************************** 900-SEIKYU-READ-SEC SECTION. * INITIALIZE RECE10-REC MOVE RECE02-KEY TO RECE10-KEY MOVE RECE10-REC TO MCPDATA-REC MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_seikyu" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE "DBFETCH" TO MCP-FUNC MOVE "tbl_seikyu" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE ZERO TO FLG-RECE10 MOVE MCPDATA-REC TO RECE10-REC ELSE MOVE 1 TO FLG-RECE10 INITIALIZE RECE10-REC END-IF ELSE MOVE 1 TO FLG-RECE10 INITIALIZE RECE10-REC END-IF * MOVE "DBCLOSECURSOR" TO MCP-FUNC MOVE "tbl_seikyu" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 900-SEIKYU-READ-EXT. EXIT. * ***************************************************************** * 公費の負担者番号取得 ***************************************************************** 930-PTKOHINF-SET-SEC SECTION. * INITIALIZE PTKOHINF-REC MOVE SPA-HOSPNUM TO PTKOH-HOSPNUM MOVE RECE02-PTID TO PTKOH-PTID MOVE WRK-KOHNUM TO PTKOH-KOHNUM * MOVE PTKOHINF-REC TO MCPDATA-REC MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_ptkohinf" TO MCP-TABLE MOVE "key4" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE "tbl_ptkohinf" TO MCP-TABLE MOVE "key4" TO MCP-PATHNAME PERFORM 935-PTKOHINF-READ-SEC PERFORM UNTIL FLG-PTKOHINF = 1 IF PTKOH-SAKJOKBN NOT = "1" IF PTKOH-TEKSTYMD(1:6) <= RECE02-SR
COBOL
YYM(1:6) AND PTKOH-TEKEDYMD(1:6) >= RECE02-SRYYM(1:6) MOVE PTKOH-FTNJANUM TO WRK-ETC-FTNJANUM MOVE PTKOH-JKYSNUM TO WRK-ETC-JKYSNUM END-IF END-IF MOVE "tbl_ptkohinf" TO MCP-TABLE MOVE "key4" TO MCP-PATHNAME PERFORM 935-PTKOHINF-READ-SEC END-PERFORM END-IF * INITIALIZE MCPAREA MOVE "DBCLOSECURSOR" TO MCP-FUNC MOVE "tbl_ptkohinf" TO MCP-TABLE MOVE "key4" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 930-PTKOHINF-SET-EXT. EXIT. * ***************************************************************** * 公費の負担者番号取得 ***************************************************************** 935-PTKOHINF-READ-SEC SECTION. * MOVE "DBFETCH" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE MCPDATA-REC TO PTKOHINF-REC MOVE ZERO TO FLG-PTKOHINF ELSE INITIALIZE PTKOHINF-REC MOVE 1 TO FLG-PTKOHINF END-IF * . 935-PTKOHINF-READ-EXT. EXIT. * ***************************************************************** * 出力レコード処理(文字) ***************************************************************** 5004-MOJI-HENSYU-SEC SECTION. * IF WRK-DATA = SPACE CONTINUE ELSE PERFORM VARYING IDW FROM WRK-NAGASA BY -1 UNTIL IDW < 1 IF WRK-DATA (IDW:1) NOT = SPACE STRING WRK-REC(1:WRK-REC-LENGTH) DELIMITED BY SIZE WRK-DATA(1:IDW) DELIMITED BY SIZE INTO WRK-REC END-STRING ADD IDW TO WRK-REC-LENGTH MOVE 1 TO IDW END-IF END-PERFORM END-IF * IF WRK-END = ZERO STRING WRK-REC(1:WRK-REC-LENGTH) DELIMITED BY SIZE WRK-KUGIRI DELIMITED BY SIZE INTO WRK-REC END-STRING ADD 1 TO WRK-REC-LENGTH END-IF * INITIALIZE WRK-HENSYU-AREA . 5004-MOJI-HENSYU-EXT. EXIT. * ***************************************************************** * 出力レコード処理(数字)ZZZZZZZZZ9.999の編集 ***************************************************************** 5005-NUM-HENSYU-SEC SECTION. * IF WRK-NAGASA = ZERO CONTINUE ELSE * 開始位置 COMPUTE WRK-ST = 11 - WRK-NAGASA IF WRK-SYOSUU > ZERO COMPUTE WRK-ST = WRK-ST + WRK-SYOSUU + 1 END-IF * PERFORM VARYING IDW FROM WRK-ST BY 1 UNTIL IDW > 10 IF WRK-NUM (IDW:1) NOT = SPACE COMPUTE IDZ = 11 + WRK-SYOSUU - IDW IF WRK-SYOSUU > ZERO ADD 1 TO IDZ END-IF STRING WRK-REC(1:WRK-REC-LENGTH) DELIMITED BY SIZE WRK-NUM(IDW:IDZ) DELIMITED BY SIZE INTO WRK-REC END-STRING COMPUTE WRK-REC-LENGTH = WRK-REC-LENGTH + IDZ MOVE 10 TO IDW END-IF END-PERFORM END-IF * IF WRK-END = ZERO STRING WRK-REC(1:WRK-REC-LENGTH) DELIMITED BY SIZE WRK-KUGIRI DELIMITED BY SIZE INTO WRK-REC END-STRING ADD 1 TO WRK-REC-LENGTH END-IF * INITIALIZE WRK-HENSYU-AREA . 5005-NUM-HENSYU-EXT. EXIT. * ***************************************************************** * 月末日算出処理 ***************************************************************** 31012-LASTDAY-GET-SEC SECTION. * INITIALIZE STS-AREA-DAY INITIALIZE LNK-DAY7-AREA MOVE "71" TO LNK-DAY7-IRAI MOVE WRK-SYMD TO LNK-DAY7-YM CALL "ORCSDAY" USING STS-AREA-DAY LNK-DAY7-AREA MOVE LNK-DAY7-KOYOMI TO WRK-SYMD . 31012-LASTDAY-GET-EXT. EXIT. * ***************************************************************** * 管理マスタ読み込み ***************************************************************** 800-SYSKANRI-READ-SEC SECTION. * MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key10" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE "DBFETCH" TO MCP-FUNC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key10" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE ZERO TO FLG-SYSKANRI ELSE MOVE 1 TO FLG-SYSKANRI END-IF ELSE MOVE 1 TO FLG-SYSKANRI END-IF * MOVE "DBCLOSECURSOR" TO MCP-FUNC MOVE "tbl_syskanri" TO MCP-TABLE MOVE "key10" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 800-SYSKANRI-READ-EXT. EXIT. * ***************************************************************** * 全角変換処理 ***************************************************************** 2009-HENKAN-SEC SECTION. * INITIALIZE WRK-OUT-INPUT * INITIALIZE ORCSKANACHKAREA MOVE "2" TO KANACHK-SYORI MOVE WRK-MAE-INPUT TO KANACHK-MAE-INPUT CALL "ORCSKANACHK" USING ORCSKANACHKAREA IF KANACHK-RC = ZERO MOVE KANACHK-OUT-INPUT TO WRK-OUT-INPUT ELSE MOVE WRK-MAE-INPUT TO WRK-OUT-INPUT END-IF * . 2009-HENKAN-EXT. EXIT. ***************************************************************** * パラメタ読込 ***************************************************************** 900-BTPARA-READ-N-SEC SECTION. * MOVE "DBFETCH" TO MCP-FUNC CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC
COBOL
SPA-AREA IF MCP-RC = ZERO MOVE MCPDATA-REC TO BTPARA-REC MOVE ZERO TO FLG-BTPARA ELSE MOVE 1 TO FLG-BTPARA INITIALIZE BTPARA-REC END-IF * . 900-BTPARA-READ-N-EXT. EXIT. * ***************************************************************** * プログラムオプション情報読込 ***************************************************************** 900-PRGOPTION-READ-SEC SECTION. * INITIALIZE PRGOPTION-REC MOVE SPA-HOSPNUM TO PRGOPTION-HOSPNUM MOVE WRK-PRGID TO PRGOPTION-PRGID MOVE WRK-KBNCD TO PRGOPTION-KBNCD MOVE PRGOPTION-REC TO MCPDATA-REC MOVE "DBSELECT" TO MCP-FUNC MOVE "tbl_prgoption" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE "DBFETCH" TO MCP-FUNC MOVE "tbl_prgoption" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA IF MCP-RC = ZERO MOVE MCPDATA-REC TO PRGOPTION-REC MOVE ZERO TO FLG-PRGOPTION ELSE INITIALIZE PRGOPTION-REC MOVE 1 TO FLG-PRGOPTION END-IF ELSE MOVE 1 TO FLG-PRGOPTION END-IF MOVE "DBCLOSECURSOR" TO MCP-FUNC MOVE "tbl_prgoption" TO MCP-TABLE MOVE "key" TO MCP-PATHNAME CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * . 900-PRGOPTION-READ-EXT. EXIT. * ***************************************************************** * DB オープン処理 ***************************************************************** 100-DBOPEN-SEC SECTION. * MOVE LOW-VALUE TO MCP-TABLE MCP-PATHNAME MOVE "DBOPEN" TO MCP-FUNC. CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * MOVE LOW-VALUE TO MCP-TABLE MCP-PATHNAME MOVE "DBSTART" TO MCP-FUNC. CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA . 100-DBOPEN-EXT. EXIT. * ***************************************************************** * DB クローズ処理 ***************************************************************** 900-DBDISCONNECT-SEC SECTION. * MOVE LOW-VALUE TO MCP-TABLE MCP-PATHNAME MOVE "DBCOMMIT" TO MCP-FUNC. CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA * MOVE LOW-VALUE TO MCP-TABLE MCP-PATHNAME MOVE "DBDISCONNECT" TO MCP-FUNC. CALL "ORCDBMAIN" USING MCPAREA MCPDATA-REC SPA-AREA . 900-DBDISCONNECT-EXT. EXIT. * <|end_of_text|> IDENTIFICATION DIVISION. PROGRAM-ID. mainpgm. ENVIRONMENT DIVISION. DATA DIVISION. PROCEDURE DIVISION. L100. CALL "FILEM". CALL "FILER". STOP 1. STOP RUN.<|end_of_text|> * Copyright (C) Micro Focus 2012. * All rights reserved. * * This sample code is supplied for demonstration purposes only on * an "as is" basis and "is for use at your own risk". IDENTIFICATION DIVISION. PROGRAM-ID. CPJCREAT. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT OUTFILE ASSIGN TO OUTFILE FILE STATUS IS FILE-STATUS. DATA DIVISION. FILE SECTION. FD OUTFILE. 01 OUT-REC. 03 OUT-REC-NO PIC 9(5). 03 OUT-REC-TEXT PIC X(75). WORKING-STORAGE SECTION. 01 FILE-STATUS PIC X(2). 01 RECORD-COUNT PIC 9(9) COMP. PROCEDURE DIVISION. OPEN OUTPUT OUTFILE IF FILE-STATUS NOT = '00' MOVE 12 TO RETURN-CODE GOBACK END-IF PERFORM VARYING RECORD-COUNT FROM 1 BY 1 UNTIL RECORD-COUNT > 10 MOVE RECORD-COUNT TO OUT-REC-NO MOVE SPACES TO OUT-REC-TEXT WRITE OUT-REC IF FILE-STATUS NOT = '00' MOVE 8 TO RETURN-CODE CLOSE OUTFILE GOBACK END-IF END-PERFORM CLOSE OUTFILE MOVE 0 TO RETURN-CODE GOBACK . <|end_of_text|>000010 @OPTIONS MAIN,TEST 000020 Identification Division. 000030 Program-Id. Chapt20a. 000031* Control Breaks 000043 Environment Division. 000050 Configuration Section. 000055 Source-Computer. IBM-PC. 000056 Object-Computer. IBM-PC. 000061 Input-Output Section. 000062 File-Control. 000063 Select Dealer-File Assign To "Dealer.Dat" 000064 Organization Indexed 000065 Access Random 000066 Record Key Dealer-Number 000067 Alternate Record Key Dealer-Name Of Dealer-Record 000068 File Status Dealer-Status. 000070 Select Report-File Assign To Printer. 000071 Select Optional Trans-File Assign To "Trans1.TXT" 000072 Organization Is Line Sequential. 000073 Select Sort-File Assign To Sort-Work. 000076 Data Division. 000077 File Section. 000085 Fd Dealer-File. 000086 01 Dealer-Record. 000087 03 Dealer-Number Pic X(8). 000088 03 Dealer-Name. 000089 05 Last-Name Pic X(25). 000090 05 First-Name Pic X(15). 000091 05 Middle-Name Pic X(10). 000092 03 Address-Line-1 Pic X(50). 000093 03 Address-Line-2 Pic X(50). 000094 03 City Pic X(40). 000095 03 State-Or-Country Pic X(20). 000096 03 Postal-Code Pic X(15). 000097 03 Home-Phone Pic X(20). 000098 03 Work-Phone Pic X(20). 000099 03 Other-Phone Pic X(20). 000100 03 Start-Date Pic 9(8). 000101 03 Last-Rent-Paid-Date Pic 9(8). 000102 03 Next-Rent-Due-Date Pic 9(8). 000103 03 Rent-Amount Pic 9(4)v99. 000104 03 Consignment-Percent Pic 9(3). 000105 03 Last-Sold-Amount Pic S9(7)v99. 000106 03 Last-Sold-Date Pic 9(8). 000107 03 Sold-To-Date Pic S9(7)v99. 000108 03 Commission-To-Date Pic S9(7)v99. 000109 03 Filler Pic X(15). 000110 Fd Report-File. 000111 01 Report-Record Pic X(80). 000112 Fd Trans-File. 000113 01 Trans-Record. 000114 03 Transaction-Date Pic 9(8). 000115 03 Transaction-Date-X Redefines Transaction-Date. 000116 05 Trans-Month Pic 99. 000117 05 Trans-Day Pic 99. 000118 05 Trans-Year Pic 9(4). 000119 03 Transaction-Type Pic X(4). 000120 03 Transaction-Dealer Pic X(8). 000121 03 Transaction-Price Pic S9(7)v99.
COBOL