|
| 1 | + IDENTIFICATION DIVISION. |
| 2 | + PROGRAM-ID. ReplaceCheckAllowedCharacters. |
| 3 | + DATA DIVISION. |
| 4 | + working-storage section. |
| 5 | + |
| 6 | + 01 Group1. |
| 7 | + replace ==:_:== by ==OK1-UNDERSCORE==. |
| 8 | + 05 :_:-Var pic X. |
| 9 | + replace ==:>:== by ==OK2-GREATER==. |
| 10 | + 05 :>:-Var pic X. |
| 11 | + replace ==:=:== by ==OK3-EQUAL==. |
| 12 | + 05 :=:-Var pic X. |
| 13 | + replace ==:<:== by ==OK4-LESS==. |
| 14 | + 05 :<:-Var pic X. |
| 15 | + replace ==:;:== by ==OK5-SEMICOLON==. |
| 16 | + 05 :;:-Var pic X. |
| 17 | + replace ==:/:== by ==OK6-SLASH==. |
| 18 | + 05 :/:-Var pic X. |
| 19 | + replace ==:.:== by ==OK7-DOT==. |
| 20 | + 05 :.:-Var pic X. |
| 21 | + replace ==:-:== by ==OK8-HYPHEN==. |
| 22 | + 05 :-:-Var pic X. |
| 23 | + replace ==:,:== by ==OK9-COLON==. |
| 24 | + 05 :,:-Var pic X. |
| 25 | + replace ==:+:== by ==OK10-PLUS==. |
| 26 | + 05 :+:-Var pic X. |
| 27 | + replace ==:*:== by ==OK11-STAR==. |
| 28 | + 05 :*:-Var pic X. |
| 29 | + replace ==:$:== by ==OK12-DOLLAR==. |
| 30 | + 05 :$:-Var pic X. |
| 31 | + replace ==: :== by ==OK13-SPACE==. |
| 32 | + 05 : :-Var pic X. |
| 33 | + |
| 34 | + *Ok |
| 35 | + replace ==:'':== by ==OK14-2-QUOTE==. |
| 36 | + 05 :'':-Var pic X. |
| 37 | + *Ok |
| 38 | + replace ==:"":== by ==OK15-2-DOUBLEQUOTE==. |
| 39 | + 05 :"":-Var pic X. |
| 40 | + |
| 41 | + *Ok for CobolEditorE-I |
| 42 | + *But NOT OK in IBM because string is not terminated correctly ? |
| 43 | + *An invalid"REPLACE"statement was found. Scanning was resumed at |
| 44 | + * the period terminating the"REPLACE"statement. |
| 45 | + replace ==:':== by ==OK16-QUOTE==. |
| 46 | + 05 :':-Var pic X. |
| 47 | + *Ok for CobolEditorE-I |
| 48 | + *But NOT OK because string is not terminated correctly ? |
| 49 | + *An invalid"REPLACE"statement was found. Scanning was resumed at |
| 50 | + * the period terminating the"REPLACE"statement. |
| 51 | + replace ==:":== by ==OK17-DOUBLE-QUOTE==. |
| 52 | + 05 :":-Var pic X. |
| 53 | + |
| 54 | + *KO for CobolEditorE-I |
| 55 | + replace ==:):== by ==KO-OPEN-PARENTHESIS==. |
| 56 | +Line 56[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 57 | +Line 56[28,28] <27, Error, Syntax> - Syntax error : extraneous input '.' expecting {ProgramIdentification, ProgramEnd, ClassIdentification, ClassEnd, FactoryEnd, ObjectIdentification, ObjectEnd, MethodEnd, ProcedureDivisionHeader, WorkingStorageSectionHeader, LocalStorageSectionHeader, LinkageSectionHeader, FileDescriptionEntry, DataDescriptionEntry, DataRedefinesEntry, DataRenamesEntry, DataConditionEntry, ExecStatement, FunctionDeclarationEnd, GlobalStorageSectionHeader} |
| 58 | + 05 :):-Var pic X. |
| 59 | + replace ==:(:== by ==KO-CLOSE-PARENTHESIS==. |
| 60 | +Line 58[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 61 | + 05 :(:-Var pic X. |
| 62 | + |
| 63 | + |
| 64 | + *Non-COBOL character"@"was found in column 19. |
| 65 | + * The character was accepted. |
| 66 | +Line 63[18,18] <55, Error, Tokens> - Non-COBOL character "@" was found in column 19. |
| 67 | + replace ==:@:== by ==KO-AROBASE==. |
| 68 | + *Non-COBOL character(s) were found starting with"@"in column 16. |
| 69 | + * The characters were discarded. |
| 70 | +Line 66[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 71 | + 05 :@:-Var pic X. |
| 72 | + |
| 73 | + |
| 74 | + *Ko Non-COBOL character"€"was found in column 19. |
| 75 | + *The character was accepted. |
| 76 | +Line 71[18,18] <55, Error, Tokens> - Non-COBOL character "€" was found in column 19. |
| 77 | + replace ==:€:== by ==KO-EURO==. |
| 78 | +Line 72[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 79 | + 05 :€:-Var pic X. |
| 80 | + |
| 81 | + *Ko Non-COBOL character"£"was found in column 19. |
| 82 | + *The character was accepted. |
| 83 | +Line 76[18,18] <55, Error, Tokens> - Non-COBOL character "£" was found in column 19. |
| 84 | + replace ==:£:== by ==KO-GBR==. |
| 85 | +Line 77[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 86 | + 05 :£:-Var pic X. |
| 87 | + |
| 88 | + *Ko Non-COBOL character"#"was found in column 19. |
| 89 | + *The character was accepted. |
| 90 | +Line 81[18,18] <55, Error, Tokens> - Non-COBOL character "#" was found in column 19. |
| 91 | + replace ==:#:== by ==KO-SHARP==. |
| 92 | +Line 82[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 93 | + 05 :#:-Var pic X. |
| 94 | + |
| 95 | + *Ko Non-COBOL character"é"was found in column 19. |
| 96 | + *The character was accepted. |
| 97 | +Line 86[18,18] <55, Error, Tokens> - Non-COBOL character "é" was found in column 19. |
| 98 | + replace ==:é:== by ==KO-E-ACUTE==. |
| 99 | +Line 87[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 100 | + 05 :é:-Var pic X. |
| 101 | + |
| 102 | + *Ko Non-COBOL character"&"was found in column 19. |
| 103 | + *The character was accepted. |
| 104 | +Line 91[18,18] <55, Error, Tokens> - Non-COBOL character "&" was found in column 19. |
| 105 | + replace ==:&:== by ==KO-AND==. |
| 106 | +Line 92[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 107 | + 05 :&:-Var pic X. |
| 108 | + |
| 109 | + *Ko Non-COBOL character"["was found in column 19. |
| 110 | + *The character was accepted. |
| 111 | +Line 96[18,18] <55, Error, Tokens> - Non-COBOL character "[" was found in column 19. |
| 112 | + replace ==:[:== by ==KO-OPEN-BRACKET==. |
| 113 | +Line 97[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 114 | + 05 :[:-Var pic X. |
| 115 | + *Ko Non-COBOL character"]"was found in column 19. |
| 116 | + *The character was accepted. |
| 117 | +Line 100[18,18] <55, Error, Tokens> - Non-COBOL character "]" was found in column 19. |
| 118 | + replace ==:]:== by ==KO-CLOSE-BRACKET==. |
| 119 | +Line 101[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 120 | + 05 :]:-Var pic X. |
| 121 | + *Ko Non-COBOL character"^"was found in column 19. |
| 122 | + *The character was accepted. |
| 123 | +Line 104[18,18] <55, Error, Tokens> - Non-COBOL character "^" was found in column 19. |
| 124 | + replace ==:^:== by ==KO-CIRCUMFLEX ==. |
| 125 | +Line 105[19,19] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 126 | + 05 :^ :-Var pic X. |
| 127 | + *Ko Non-COBOL character"{"was found in column 19. |
| 128 | + *The character was accepted. |
| 129 | +Line 108[18,18] <55, Error, Tokens> - Non-COBOL character "{" was found in column 19. |
| 130 | + replace ==:{:== by ==KO-OPEN-BRACE==. |
| 131 | +Line 109[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 132 | + 05 :{:-Var pic X. |
| 133 | + *Ko Non-COBOL character"}"was found in column 19. |
| 134 | + *The character was accepted. |
| 135 | +Line 112[18,18] <55, Error, Tokens> - Non-COBOL character "}" was found in column 19. |
| 136 | + replace ==:}:== by ==KO-CLOSE-BRACE==. |
| 137 | +Line 113[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -' |
| 138 | + 05 :}:-Var pic X. |
| 139 | + |
| 140 | + END PROGRAM ReplaceCheckAllowedCharacters. |
0 commit comments