$set sourceformat"free" object-computer. sequence CESTINA. special-names. CESTINA "AaBbCcDdEeFfGgHhIiJjKkLl" "MmNnOoPpQqRrSsTtUuVvXxYyZz". file-control. select SB-I assign "pocitace.txt" line sequential. select SB-T assign disk. select SB-O assign JM-O line sequential. file section. fd SB-I. 1 VT-I pic x(150). sd SB-T. 1 VT-T. 2 POLE pic x(150). 2 VT-D pic x(150). fd SB-O. 1 VT-O pic x(150). working-storage section. 1 R pic 9. 88 CTENI value 0. 88 KONEC value 1. 1 T pic 9. 88 CTENI-T value 0. 88 KONEC-T value 1. 1 Z pic 9. 88 PAR value 0. 88 DAT value 1. 1 POCET pic 9999 value 0. 1 RADKY pic 9999 value 0. 1 CELKEM pic 9999 value 0. 1 ZADANI pic x(150). 1 JM-O pic x(20) value space. 1 VETA. 2 POC pic x(7). 2 pic xx. 2 ROK pic xx. 2 pic xxxx. 2 APL pic xx. 2 pic xx. 2 ORG pic x(60). 2 pic xx. 2 LOK pic x(40). 1 ULO. 2 APL pic xx. 2 ORG pic x(60). 2 LOK pic x(40). 1 RADEK pic x(150). 1 VETA-P pic x(150). 1 KLIC-A pic x(60). 1 KLIC-U pic x(60) value " ". 1 SABLONY. 2 POC-X pic x(7) value "Pocitac". 2 ROK-X pic xx value "r_". 2 APL-X pic xx value "a_". 2 ORG-X pic x(60) value all "Organizace". 2 LOK-X pic x(40) value all "Lokalita..". procedure division. sort SB-T ascending POLE input procedure VSTUP output procedure VYSTUP display "pocet platnych vet " POCET " ok" stop run. VSTUP. set PAR to true open input SB-I set CTENI to true perform until KONEC read SB-I into VETA end set KONEC to true not end evaluate true when PAR and VT-I(1:1) = "." perform PARAMETRY open output SB-O initialize VT-O string "Seznam pota: " JM-O into VT-O write VT-O write VT-O from spaces set DAT to true when PAR and VT-I(1:1) = " " continue when PAR and VT-I(1:1) = "/" move VT-I to ZADANI when PAR and VT-I(1:1) = "=" move VT-I to RADEK when DAT and ZADANI(2:5) = "kopie" if VT-I(1:1) not = " " add 1 to POCET end-if write VT-O from VT-I when DAT and VT-I(1:1) not = " " add 1 to POCET perform UPRAVA release VT-T end-evaluate end-read end-perform close SB-I. PARAMETRY. string "pocitace-" ZADANI(2:) delimited " " ".txt" into JM-O. UPRAVA. move VT-I to VETA move " " to VETA(20:) unstring VT-I(20:) delimited ", " into ORG of VETA LOK of VETA if APL of VETA not = " " move APL of VETA to APL of ULO end-if if ORG of VETA not = " " move ORG of VETA to ORG of ULO move LOK of VETA to LOK of ULO end-if inspect ORG of ULO replacing all " " by "." after initial " " inspect LOK of ULO replacing all " " by "." after initial " " move corr ULO to VETA move VETA to VT-D move ZADANI(10:) to VETA-P perform SKLADBA move VETA-P to POLE. SKLADBA. inspect VETA-P replacing all POC-X by POC of VETA all ROK-X by ROK of VETA all APL-X by APL of VETA all ORG-X by ORG of VETA all LOK-X by LOK of VETA. VYSTUP. set CTENI-T to true perform until KONEC-T return SB-T end set KONEC-T to true not end move RADEK(10:) to VETA-P move VT-D to VETA perform SKLADBA perform MEZERY add 1 to RADKY write VT-O from VETA-P end-return end-perform move "konec prace" to KLIC-U perform MEZERY write VT-O from CELKEM close SB-O. MEZERY. evaluate RADEK(2:1) when "p" move POC of VETA to KLIC-A when "r" move ROK of VETA to KLIC-A when "a" move APL of VETA to KLIC-A when "o" move ORG of VETA to KLIC-A when "l" move LOK of VETA to KLIC-A when other move KLIC-U to KLIC-A end-evaluate if (KLIC-A not = KLIC-U) or (KLIC-U = "konec prace") move spaces to VT-O move RADKY to VT-O(100:) if CELKEM not = 0 write VT-O end-if if KLIC-U not = "konec prace" add 1 to CELKEM end-if move 0 to RADKY move KLIC-A to KLIC-U.