Upgrade to Pro — share decks privately, control downloads, hide ads and more …

メドレー開発部TechLunch ORCAとCOBOLと WATASHI

メドレー開発部TechLunch ORCAとCOBOLと WATASHI

メドレー開発部TechLunchで発表した内容を掲載しました。

メドレーで開発部では、隔週で社内勉強会が開かれています。
今回は、「ORCAとCOBOLと WATASHI」というタイトルで発表し、医療系の分野でサービス開発・運営するエンジニアとして、医療分野のレガシーな技術に触れる機会となりました。

発表者:竹内正明

Medley Inc.

April 18, 2017
Tweet

More Decks by Medley Inc.

Other Decks in Technology

Transcript

  1. ORCAʢ೔Ϩηʣͷٕज़৘ใ • ORCA Projectɿ ٕज़৘ใ • αʔόαΠυʢMONTSUQIʣ • ORCAͷ֩ͱͳΔۀ຿γεςϜߏஙϛυϧ΢ΣΞ •

    ΫϥΠΞϯταΠυʢglclientɺmonsiajʣ • ٕज़ελοΫ • Linux/C/COBOL/Postgresql/Java • ϛυϧ΢ΣΞͷϦχϡʔΞϧ༧ఆˠginbee • https://github.com/montsuqi/panda/tree/ginbee48
  2. COBOL • COBOL - Wikipedia • Common Business Oriented Language

    • ࣄ຿ॲཧ༻ʹ1959೥ʹ։ൃ͞Εͨ • ʮࣗવݴޠͰ͋Δӳޠʹ͍ۙهड़ΛΊͨ͟͠ʯ • ։ൃऀ͸άϨʔεɾϗούʔ - Wikipedia • ΞϝϦΧւ܉ͷ܉ਓ͔ͭܭࢉػՊֶऀʢ࠷ऴ֊ڃ͸।কʣ
  3. ίϯύΠϧʗ࣮ߦํ๏ # ίϯύΠϧ $ docker run --rm -v /Users/masaakitakeuchi/git_work/ise/cobol-sample:/cobol cobol

    cobc -x --free src/hoge.cob -o bin/exec # ίϯύΠϧΦϓγϣϯʹ͍ͭͯ # -xɿ࣮ߦϑΝΠϧΛ࡞੒͢Δ # --freeɿࣗ༝ܗࣜˠʮݻఆܗࣜ΍ՄมܗࣜͷҰ࿈൪߸ྖҬɺඪࣝྖҬ͕ແ͘ɺࣗ༝ʹهड़Ͱ͖·͢ɻʯͱͷ͜ͱ # https://plaza.rakuten.co.jp/u703331/diary/201103310000/ # http://software.aufheben.info/linux/freepascal.html # https://codezine.jp/article/detail/2303 # ͪͳΈʹʮ-CʯͰCݴޠͷιʔεΛు͖ग़ͯ͘͠ΕΔ # ࣮ߦ $ docker run -it --rm -v /Users/masaakitakeuchi/git_work/ise/cobol-sample:/cobol cobol bin/exec
  4. શମ૾ • ݟग़͠෦ʢIDENTIFICATION DIVISIONʣ • ϓϩάϥϜ໊΍࡞੒ऀ౳Λهड़ • ؀ڥ෦ʢENVIRONMENT DIVISIONʣ •

    ಡΈॻ͖͢ΔϑΝΠϧ৘ใ౳Λهड़ • σʔλ෦ʢDATA DIVISIONʣ • ϑΝΠϧϑΥʔϚοτɺม਺ʢσʔλ߲໨ʣ౳Λهड़ • खଓ͖෦ʢPROCEDURE DIVISIONʣ • ࣮ࡍͷॲཧΛهड़
  5. ม਺ • ม਺ˠCOBOLͰ͸ʮσʔλ߲໨ʯΒ͍͠ *> 01͸Ϩϕϧ൪߸ *> CNT01͕ม਺໊ *> PIC͸PICTURE۟Ͱσʔλ߲໨Λఆٛ͢ΔͨΊͷจ๏ *>

    9(1)͸਺ࣈҰܻ *> VALUEͰॳظ஋ઃఆ DATA DIVISION. WORKING-STORAGE SECTION. 01 CNT01 PIC 9(1) VALUE 0.
  6. ഑ྻ • ഑ྻˠCOBOLͰ͸ʮςʔϒϧʯΒ͍͠ *> Ϩϕϧ൪߸͸ *> 1͕࠷্Ґͷ֊૚ͱͳΓɺ਺ࣈ͕૿͑Δ΄ͲԼҐͷ֊૚ͱͳΓ·͢ *> ͱͷ͜ͱ *>

    http://tallercolibri.com/archives/104 *> OCCURS͕۟഑ྻఆٛ༻ͷจ๏ DATA DIVISION. WORKING-STORAGE SECTION. 01 TABLE01. 03 ELEM OCCURS 3. 05 VAL PIC 9(1).
  7. ͍Ζ͍Ζͳจ • DISPLAYจ • දࣔ • COMPUTEจ • ࢉज़ԋࢉ •

    COMPUTE CNT = 1 + 1Έ͍ͨͳײ͡ • MOVEจ • సه • ୅ೖ༻్ͬΆ͍͕ɺʮඪ४ܻدͤنଇͱݺ͹ΕΔϧʔϧ͕͋Γɺඇ਺ࣈ߲໨͸ࠨدͤʹసه͠ɺ༨Γͷ෦෼͸ ۭനจࣈͰิΘΕ·͢ʯͱͷ͜ͱ • http://www.atmarkit.co.jp/ait/articles/0906/11/news104_3.html • MOVE 0 TO CNT
  8. ෼ذ *> IF͸ׂΓͱී௨ IF A = B DISPLAY "ಉ͡" END-IF

    *> EVALUATE͸switchจ΍caseจΈ͍ͨͳײ͡ EVALUATE CNT WHEN 1 DISPLAY "ONE" WHEN 2 DISPLAY "TWO" END-EVALUATE.
  9. FizzBuzzͷྫ • https://github.com/ise/cobol-sample/blob/master/src/fizzbuzz.cob IDENTIFICATION DIVISION. PROGRAM-ID. FIZZ_BUZZ. DATA DIVISION. WORKING-STORAGE

    SECTION. 01 CNT PIC 9(3) VALUE 0. 01 MOD3 PIC 9(1) VALUE 0. 01 MOD5 PIC 9(1) VALUE 0. PROCEDURE DIVISION. PERFORM VARYING CNT FROM 1 BY 1 UNTIL CNT > 100 COMPUTE MOD3 = FUNCTION MOD(CNT 3) COMPUTE MOD5 = FUNCTION MOD(CNT 5) IF MOD3 = 0 AND MOD5 = 0 DISPLAY "FizzBuzz" ELSE IF MOD3 = 0 DISPLAY "Fizz" ELSE IF MOD5 = 0 DISPLAY "Buzz" ELSE DISPLAY CNT END-IF END-PERFORM. • আࢉΛආ͚ΔྫˠFizzBuzz໰୊ - COBOLٕज़ऀͷ༕ᓔ
  10. ͓·͚ʢ̎ʣ • Ͳ͏ͯ͠΋ORCAͷίʔυΛಡΈ͍ͨਓ΁ # ϦϙδτϦऔಘ $ brew install cvs $

    curl http://ftp.orca.med.or.jp/pub/data/receipt/tec/orcacvs > ~/bin/orcacvs $ chmod +x ~/bin/orcacvs $ cvs -d :ext:[email protected]:/cvs co jma-receipt
  11. ࢀߟαΠτʢORCAʣ • ORCA Projectɿ ٕज़৘ใ • ORCA | ͓ͪ͝ΌΜͷࡶจ •

    ORCA࣍ظFW։ൃͷݱঢ় • ҩྍ෼໺ʹ͓͚ΔΦʔϓϯιʔειϑτ΢ΣΞͷ։ൃͱར༻ • http://www.opensquare.co.jp/seminar/document/19/3-OpenCOBOL • https://ftp.orca.med.or.jp/pub/data/news/orca-conference-2015-document-7-ginbee1.pdf • ORCAΧϯϑΝϨϯε2015ɹGinbee։ൃঢ়گʹ͍ͭͯ - ͓஌Βͤ • ೔ҩITઓུηογϣϯʙORCAɾ೔ҩೝূہͷࠓޙͷൃలʹ޲͚ͯʮ೔Ϩηͱ࿈ܞιϑτʢిࢠΧϧςͳͲʣͷ࠷৽৘ใʯ - ͓஌Βͤ • xenialORCA - ORCA ؆୯ Πϯετʔϧ • ORCAΧϯϑΝϨϯε2016 - ORCAϓϩδΣΫτ | Doorkeeper • ORCAΧϯϑΝϨϯε2015ɹ৽ͨͳ̖̥̞ʢ̧̝̖̤̞ʣʹ͍ͭͯ - ͓஌Βͤ • https://ftp.orca.med.or.jp/pub/data/news/orca-conference-2015-document-6-haori.pdf • ϔϧεέΞ͚ͩͰऴΘΒͤͳ͍ҩྍITʢ6ʣɿษڧձͰ໌Β͔ʹͳͬͨҩྍ޲͚OSSͷଟ༷ͳ׆༻๏ᴷᴷిࢠΧϧςɺྟচࢼݧσʔλղੳɺ೔ຊޠҩֶ༻ޠϓϥ οτϑΥʔϜɺը૾DB (1/4) - ˏIT • http://www.ssk.or.jp/seikyushiharai/gyomuflow/gyomuflow_01.html
  12. ࢀߟαΠτʢCOBOLʣ • αϧͰ΋Θ͔ΔCOBOLೖ໳ ʲͻΑ͜άϛʳ • COBOLϓϩάϥϛϯάೖ໳ • COBOL - Getting

    Started - ˏIT • COBOLϓϩάϥϛϯά࿈ࡌҰཡɿCodeZineʢίʔυδϯʣ • COBOLެࣜαΠτ