IDENTIFICATION DIVISION.
PROGRAM - ID. WriteHTML .
ENVIRONMENT DIVISION.
INPUT - OUTPUT SECTION.
FILE - CONTROL.
SELECT OutputFile ASSIGN TO "output.html"
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD OutputFile.
01 HTML- LINE PIC X( 80 ) .
WORKING - STORAGE SECTION.
01 IDX PIC 9 ( 2 ) VALUE 1 .
01 HTML- CONTENT OCCURS 10 TIMES.
05 LINE- ITEM PIC X( 80 ) .
PROCEDURE DIVISION.
MAIN - PROCEDURE.
PERFORM INIT- HTML- CONTENT
OPEN OUTPUT OutputFile
PERFORM WRITE- LINES
CLOSE OutputFile
DISPLAY "HTML file 'output.html' has been written successfully."
STOP RUN.
INIT - HTML- CONTENT.
MOVE "<!DOCTYPE html>" TO LINE- ITEM( 1 ) .
MOVE "<html lang=" "ja" ">" TO LINE- ITEM( 2 ) .
MOVE " <head>" TO LINE- ITEM( 3 ) .
MOVE " <meta charset=" "UTF-8" ">" TO LINE- ITEM( 4 ) .
MOVE " <title>タイトル</title>" TO LINE- ITEM( 5 ) .
MOVE " </head>" TO LINE- ITEM( 6 ) .
MOVE " <body>" TO LINE- ITEM( 7 ) .
MOVE " Hello HTML!" TO LINE- ITEM( 8 ) .
MOVE " </body>" TO LINE- ITEM( 9 ) .
MOVE "</html>" TO LINE- ITEM( 10 ) .
WRITE - LINES.
PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > 10
MOVE LINE- ITEM( IDX) TO HTML- LINE
WRITE HTML- LINE
END- PERFORM.
ICAgICAgIElERU5USUZJQ0FUSU9OIERJVklTSU9OLgogICAgICAgUFJPR1JBTS1JRC4gV3JpdGVIVE1MLgoKICAgICAgIEVOVklST05NRU5UIERJVklTSU9OLgogICAgICAgSU5QVVQtT1VUUFVUIFNFQ1RJT04uCiAgICAgICBGSUxFLUNPTlRST0wuCiAgICAgICAgICAgU0VMRUNUIE91dHB1dEZpbGUgQVNTSUdOIFRPICJvdXRwdXQuaHRtbCIKICAgICAgICAgICAgICAgT1JHQU5JWkFUSU9OIElTIExJTkUgU0VRVUVOVElBTC4KCiAgICAgICBEQVRBIERJVklTSU9OLgogICAgICAgRklMRSBTRUNUSU9OLgogICAgICAgRkQgT3V0cHV0RmlsZS4KICAgICAgIDAxIEhUTUwtTElORSBQSUMgWCg4MCkuCgogICAgICAgV09SS0lORy1TVE9SQUdFIFNFQ1RJT04uCiAgICAgICAwMSBJRFggUElDIDkoMikgVkFMVUUgMS4KICAgICAgIDAxIEhUTUwtQ09OVEVOVCBPQ0NVUlMgMTAgVElNRVMuCiAgICAgICAgICAgMDUgTElORS1JVEVNIFBJQyBYKDgwKS4KCiAgICAgICBQUk9DRURVUkUgRElWSVNJT04uCiAgICAgICBNQUlOLVBST0NFRFVSRS4KICAgICAgICAgICBQRVJGT1JNIElOSVQtSFRNTC1DT05URU5UCiAgICAgICAgICAgT1BFTiBPVVRQVVQgT3V0cHV0RmlsZQogICAgICAgICAgIFBFUkZPUk0gV1JJVEUtTElORVMKICAgICAgICAgICBDTE9TRSBPdXRwdXRGaWxlCiAgICAgICAgICAgRElTUExBWSAiSFRNTCBmaWxlICdvdXRwdXQuaHRtbCcgaGFzIGJlZW4gd3JpdHRlbiBzdWNjZXNzZnVsbHkuIgogICAgICAgICAgIFNUT1AgUlVOLgoKICAgICAgIElOSVQtSFRNTC1DT05URU5ULgogICAgICAgICAgIE1PVkUgIjwhRE9DVFlQRSBodG1sPiIgICAgICAgICAgICAgICBUTyBMSU5FLUlURU0oMSkuCiAgICAgICAgICAgTU9WRSAiPGh0bWwgbGFuZz0iImphIiI+IiAgICAgICAgICAgIFRPIExJTkUtSVRFTSgyKS4KICAgICAgICAgICBNT1ZFICIgICAgPGhlYWQ+IiAgICAgICAgICAgICAgICAgICAgVE8gTElORS1JVEVNKDMpLgogICAgICAgICAgIE1PVkUgIiAgICAgICAgPG1ldGEgY2hhcnNldD0iIlVURi04IiI+IiBUTyBMSU5FLUlURU0oNCkuCiAgICAgICAgICAgTU9WRSAiICAgICAgICA8dGl0bGU+44K/44Kk44OI44OrPC90aXRsZT4iIFRPIExJTkUtSVRFTSg1KS4KICAgICAgICAgICBNT1ZFICIgICAgPC9oZWFkPiIgICAgICAgICAgICAgICAgICAgVE8gTElORS1JVEVNKDYpLgogICAgICAgICAgIE1PVkUgIiAgICA8Ym9keT4iICAgICAgICAgICAgICAgICAgICBUTyBMSU5FLUlURU0oNykuCiAgICAgICAgICAgTU9WRSAiICAgICAgICBIZWxsbyBIVE1MISIgICAgICAgICAgIFRPIExJTkUtSVRFTSg4KS4KICAgICAgICAgICBNT1ZFICIgICAgPC9ib2R5PiIgICAgICAgICAgICAgICAgICAgVE8gTElORS1JVEVNKDkpLgogICAgICAgICAgIE1PVkUgIjwvaHRtbD4iICAgICAgICAgICAgICAgICAgICAgICBUTyBMSU5FLUlURU0oMTApLgoKICAgICAgIFdSSVRFLUxJTkVTLgogICAgICAgICAgIFBFUkZPUk0gVkFSWUlORyBJRFggRlJPTSAxIEJZIDEgVU5USUwgSURYID4gMTAKICAgICAgICAgICAgICAgTU9WRSBMSU5FLUlURU0oSURYKSBUTyBIVE1MLUxJTkUKICAgICAgICAgICAgICAgV1JJVEUgSFRNTC1MSU5FCiAgICAgICAgICAgRU5ELVBFUkZPUk0uCg==
compilation info
prog.cob: 27: error: continuation character expected
prog.cob: in paragraph 'MAIN-PROCEDURE':
prog.cob: 26: error: syntax error, unexpected <
prog.cob: 26: error: invalid symbol '!' - skipping word
prog.cob: 26: warning: alphanumeric literal has zero length; a SPACE will be assumed
prog.cob: 26: warning: alphanumeric literal has zero length; a SPACE will be assumed
prog.cob: 26: warning: alphanumeric literal has zero length; a SPACE will be assumed
prog.cob: 26: warning: alphanumeric literal has zero length; a SPACE will be assumed
prog.cob: 26: error: invalid symbol '!' - skipping word
prog.cob: 22: error: 'INIT-HTML-CONTENT' is not defined
stdout