$ERR.REX: Difference between revisions

no edit summary
m (added whitespace.)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1:
The &nbsp; '''<code>$ERR.REX''' &nbsp;</code> (REXX) program is used to issue various formatted error messages from other REXX programs.
 
<br><br>The &nbsp; '''$ERR.REX''' &nbsp; program makes use of the &nbsp; '''$T.REX''' &nbsp; program to issue the error messages in red (if available).
The <code>$ERR.REX</code> program makes use of the <code>$T.REX</code> program to issue the error messages in red (if available).
<br><br>The help for the &nbsp; '''$ERR''' &nbsp; REXX program is included here &nbsp; ──► &nbsp; [[$ERR.HEL]].
 
<lang rexx>/*REXX program to display error or informational messages (in color, if supported). */
The help for the <code>$ERR</code> REXX program is included here ──► [[$ERR.HEL]].
<syntaxhighlight lang="rexx">
/*REXX program to display error or informational messages (in color, if supported). */
 
trace off /*turn off all REXX cmd error messages.*/
Line 114 ⟶ 117:
 
 
 
if k== 0 then call sy "some commands can't or shouldn't be executed while in" g3
if k== 10 then call sy "the"some g3commands can'wast previouslyor specifiedshouldn't orbe specifiedexecuted morewhile thanin" once' g3
 
if k== 2 then call sy "the" a4 "argument can't be" choose("negative",g5)":" a3
if k== 31 then call sy '"the" (disk) filemode'g3 a3 "can'twas havepreviously anyspecified read-onlyor extensions"specified g4more than once'
 
if k== 4 then call sy 'the' a4 "filemode/address can't be" choose('RELEASEd',g5)":" a3
if k== 2 then call sy "the" a4 "argument can't be" choose("negative", g5)":" a3
 
if k== 3 then call sy 'the (disk) filemode' a3 "can't have any read-only extensions" g4
 
if k== 4 then call sy 'the' a4 "filemode/address can't be" choose('RELEASEd',g5)":" a3
 
if k== 5 then do
call sy "illegal comparator operator" @ a3 'specified,'
call sy "it must be one of: = \= < <= > >= \< \>"
end
 
if k== 6 then call sy "no special characters are allowed in the" g4':' a3
if k== 6 then call sy "no special characters are allowed in the" g4':' a3
 
if k== 7 then call sy "fixed-point underflow or overflow (result is too small or too large)"
 
if k== 8 then call sy "illegal filemode" @ a3 @ g4
if k== 98 then call sy "aillegal terminalfilemode" screen (CRT)@ is requireda3 with the" @ a3 @ 'feature'g4
 
if k==10 then if a3=='' then call sy "missing fileid for" g4
if k== 9 then call sy "a terminal screen (CRT) is required with the" @ a3 @ 'feature'
else call sy "illegal fileid" @ space(a3 a4 a5) @ g6
 
if k==10 then if a3=='' then call sy "missing fileid for" g4
else call sy "illegal fileid" @ space(a3 a4 a5) @ g6
 
if k==11 then call sy "comparand operand must be an = or \= when using *xxx* type comparisons"
 
if k==12 then call sy "not enough" choose('virtual storage',g4)", at least" a3 'are needed'
if k==12 then call sy "not enough" choose('virtual storage', g4)", at least" a3 'are needed'
 
if k==13 then do
call sy "REXX syntax error"
Line 136 ⟶ 153:
call syline
end
 
if k==14 then call sy 'the' a5 "argument" a3 "can't be" choose('greater',a.7) "than" a6 a4
if k==14 then call sy 'the' a5 "argument" a3 "can't be" choose('greater',a.7) "than" a6 a4
 
if k==15 then do
if a3=='' then call sy "division by zero"
Line 145 ⟶ 164:
end
end
 
if k==16 then do
call sy "illegal MDISK" g4 'address:' a3","
call sy 'it must be exactly three hexadecimal characters (but not 000), or it may be'
call sy "preceededpreceded by an asterisk (*) followed by three decimal characters"
end
 
if k==17 then do
call sy "undefined REXX variable referenced" a.6
call syline
end
 
if k==18 then do
call sy "illegal MDISK address or filemode,"
call sy "the 191 A MDISK address is reserved for the CMS user's private MDISK"
end
 
if k==19 then call sy 'numeric digits ('comma(a6)") isn't sufficient to" a4 a5 'to' a3
if k==2019 then call sy 'numeric digits ('comma(a6)"the") a3isn't sufficient to" @ a4 'and' g5a5 @ "aren'tto' alike" a3
 
if k==21 then call sy choose("increment",a3) 'must be preceeded by a plus (+) or a minus (-)'
if k==20 then call sy "the" a3 @ a4 'and' g5 @ "aren't alike"
 
if k==21 then call sy choose("increment",a3) 'must be preceded by a plus (+) or a minus (-)'
 
if k==22 then do
_= 'combination of characters:'
if L.4==1 then _="character:"
call sy a3 'contains an invalid' _ g4
end
 
if k==23 then call sy "the" a3 choose("option",a5) "requires the" a4 choose('option or feature',g6)
 
if k==24 then call sy "illegal" choose('volume',a4) "serial:" a3 ' (it must be six or less characters)'
 
if k==25 then do
call sy "you must be in the" a3 'mode/program to use the'
call sy "specified command (or it's" g4 "option)"
end
 
if k==26 then do
call sy "illegal MDISK" g4 'address:' a3","
call sy 'it must be exactly three hexadecimal characters (but not 000)'
end
 
if k==27 then call sy choose('number',g4) "can't be negative or zero (must be positive):" a3
if k==27 then call sy choose('number',g4) "can't be negative or zero (must be positive):" a3
 
if k==28 then call sy "duplicate" a3 'defined or specified:' g4
 
if k==29 then call sy "illegal filemode:" a3', it must be one character'
 
if k==30 then do
call say30
if a5==a6 | a6=='' | a6=="," then call sy "it must be" space(aa5 g8 _b)
else do
_to= 'to'
if a6==aa5+1 then _to= "or"
call sy 'it must be from' aa5 _to a6 _b
end
end
 
if k==31 then call sy "no lines (or incorrect lines) were put in the program stack" g3
 
if k==32 then call sy 'the command' a3 "exited, but it isn't supposed to exit or stop"
 
if k==33 then call sy 'the' a3 "MDISK isn't a CMS MDISK, it's in the wrong format"
if k==3433 then call sy @'the' a3 a4 @ "canMDISK isn't bea executedCMS fromMDISK, it's in the" a5wrong 'MDISK'format"
 
if k==34 then call sy @ a3 a4 @ "can't be executed from the" a5 'MDISK'
 
if k==35 then do
call sy "no" choose('argument', a4) 'was specified after or'
call fto a3 g5
end
 
if k==36 then call sy 'file' @ g3 @ "can't exist on the" a5 'MDISK'
if k==36 then call sy 'file' @ g3 @ "can't exist on the" a5 'MDISK'
 
if k==37 then do
y= a3
_= pos(a3,'''"`{[(«')
if _\==0 then y=translate(word('single_quote double_quote grave_accent left_brace left_bracket left_parenthesis left_double_carrot',_),,"_") a3
call sy 'unmatched' y g4
end
 
if k==38 then call sy 'file' @ space(a3 a4 a5) @ choose("can't be located or is empty",g6)
 
if k==39 then call sy "the" a3 choose('argument',a8) 'must be' a4 a5 "the" a6 choose('argument',a7)
 
if k==40 then do
call sy 'argument' @ a3 @ "isn't a valid hexadecimal string/number"
Line 210 ⟶ 254:
call fto g4
end
 
if k==41 then do
call sy "VM userid" @ g3 @ "doesn't exist or"
call sy 'is illegal (it may have an illegal character in it)'
end
 
if k==42 then call sy "the MDISK" a4 'for the user' a3 "doesn't exist"
 
if k==43 then call sy "illegal password for the" a3 a5 'MDISK was specified'
 
if k==44 then do
call sy "a CMS command is being used out of context, or"
call sy 'a command was renamed, or the FSTs have been altered'
_= 'DOS'
if !cms then _="CMS";call sy '(you may have to IPL' _")"
call sy '(you may have to IPL' _")"
end
 
if k==45 then call sy 'VM userid' @ g3 @ "isn't logged on"
 
if k==46 then call sy "the file's" @ g4 "LRECL can't exceed" a3
 
if k==47 then call sy a3 @ a4 @ "not found" g5
 
if k==48 then do
_=
L= 1
if L.4==1 | right(aU.4,1)=='X' then _= " an"
if _=='' then L= 0
call sy @ a3 g5 @ 'contains'_ "invalid character"s(L)':' a4
end
 
if k==49 then call sy "CP LINK error for MDISK" a4 'userid' a3
if k==49 then call sy "CP LINK error for MDISK" a4 'userid' a3
 
if k==50 then do
call sy 'illegal/invalid' a3 "specified" @ a4 @
call fto g5
end
 
if k==51 then call sy choose("documentation",a5) 'for' a3 a4 "couldn't be located"
if k==51 then call sy choose("documentation", a5) 'for' a3 a4 "couldn't be located"
 
if k==52 then do
call sy "arguments aren't permitted"
call fto a4
end
 
if k==53 then do
call sy 'argument' @ a3 @ "isn't numeric" g5
call fto a4
end
 
if k==54 then do
call sy "not enough" choose('arguments',a3) "were specified" g5
call fto a4
end
 
if k==55 then do
call sy "illegal argument" @ a3 @ g5
call fto a4
end
 
if k==56 then call sy "illegal number of" choose('arguments',a4) "were specified" g5 a3
if k==56 then call sy "illegal number of" choose('arguments',a4) "were specified" g5 a3
 
if k==57 then do
y= choose("arguments", a3)
z= 'was'
if translate(right(y,1))=="S" then z= 'were'
call sy "no" y z "specified"
end
 
if k==58 then call sy "only" g3 'argument's(a3) 'are accepted'
 
if k==59 then do
call sy "too many" choose('arguments',a3) "were specified" g5
call fto a4
end
 
if k==60 then call sy "argument#" a4 @ a3 @ 'must be an * or numeric'
 
if k==61 then call sy "conflicting arguments:" g3
 
if k==62 then call sy choose('fileid1',a3) "and" choose('fileid2',a4) "can't be identical" g5
if k==62 then call sy choose('fileid1',a3) "and" choose('fileid2',a4) "can't be identical" g5
 
if k==63 then do
call sy "no" 'argument was specified after or'
call fto g3
end
 
if k==64 then call sy "up to" g3 'argument's(a3) 'are accepted'
if k==6564 then call sy "badup argumentto" @ g3 'argument's(a3) @ "illegal use of"'are g4accepted'
 
if k==66 then call sy "only" a3 'to' a4 "arguments are accepted"
if k==6765 then call sy "unablebad to parseargument" @ a3 'from the@ results"illegal use of:'" g4
 
if k==66 then call sy "only" a3 'to' a4 "arguments are accepted"
 
if k==67 then call sy "unable to parse" a3 'from the results of:' g4
 
if k==68 then do
call sy "return code" a3 'doing:'
call sy g4
i= a3
end
 
if k==69 then call sy 'user' @ a3 @ "can't be logged on while the command" @ a2 @ 'is running'
if k==69 then call sy 'user' @ a3 @ "can't be logged on while the command" @ a2 @ 'is running'
 
if k==70 then do
if a3==2 then call sy "the" @ a2 @ 'command must be executed under the' a4 "userid"
Line 288 ⟶ 363:
call sy "illegal use of the" @ a2 @ "command, subrc="a3
end
 
if k==71 then call sy "can't attach a" g3
 
if k==72 then do
call sy 'argument' @ a3 @ "isn't alphabetic" g5
call fto a4
end
 
if k==73 then do
call sy "an attempt was made to execute an unauthorized or restricted command"
if g3\=='' then call sy g3
end
 
if k==74 then call sy "the user" @ a3 @ 'must be in' a4 "mode"
 
if k==75 then call sy "no" choose('write',a4) "access to the" @ choose('A',space(left(a3),1)) @ "MDISK"
 
if k==76 then call sy a3 g5 "isn't known or supported:" a4
if k==7776 then call sy space('error' a3 g5 "inisn't writingknown toor disk filesupported:" @ g4 @)a4
 
if k==78 then call sy choose("file",g6) @ a3 a4 a5 @ 'not found'
if k==77 then call sy space('error' a3 "in writing to disk file" @ g4 @)
 
if k==78 then call sy choose("file", g6) @ a3 a4 a5 @ 'not found'
 
if k==79 then call sy "the time window for execution is" a3 'through' a4
 
if k==80 then call sy @ a3 @ "isn't a known userid"
if k==80 then call sy @ a3 @ "isn't a known userid"
 
if k==81 then do
call sy 'argument' @ a5 space(@ g7) "is out of range"
_= max(w.3, w.4)
if L.3\==0 then call sy 'the lower limit is:' right(c.3, _)
if L.4\==0 then call sy 'the upper limit is:' right(c.4, _)
call fto a6
end
 
if k==82 then call sy g4 @ a3 @ "can't be located"
 
if k==83 then call sy "the" @ g3 @ 'option is required'
 
if k==84 then call sy "file" @ g4 @ 'had a syntax error for' a3
 
if k==85 then call sy "illegal combination of arguments:" g4
 
if k==86 then do
call sy "the" choose(a3,a2) 'command is being invoked out of context'
if g4\=='' then call sy g4
end
 
if k==87 then do
call sy 'argument' @ a3 @ "isn't a valid" choose('bit digit',a4)
Line 324 ⟶ 416:
call fto g5
end
 
if k==88 then call sy g4 @ a3 @ "doesn't exist"
 
if k==89 then call sy 'the' a3 "command can't be found"
 
if k==90 then do
call sy 'evaluation of' a3 "contains a zero divisor and"
call sy 'the result is infinite' g4
end
 
if k==91 then do
call sy 'argument' @ a3 @ "isn't a valid" choose('bit string',a4)
Line 335 ⟶ 431:
call fto g5
end
 
if k==92 then do
call sy choose('argument',a4) @ a3 @ "isn't a whole number (integer)" g7
call fto a5
end
 
if k==93 then call sy "file" @ g3 @ 'already exists'
 
if k==94 then call sy "the T-DISK requested can't be obtained"
 
if k==95 then call sy "not enough free storage can be obtained"
 
if k==96 then call sy "illegal file" @ g3 @ 'or it was incorrectly modified'
 
if k==97 then do
call sy "a command failed,"
Line 348 ⟶ 450:
call sy "it's all or partially restricted to authorized users"
end
 
if k==98 then do
call sy "an attempt was made to execute the" @ a2 @ 'command while'
call sy "the user" @ userid() @ "was in disconnected mode"
end
 
if k==99 then call sy "illegal error number for the" !fn 'REXX EXEC' ":" g3
 
 
if a2\=='' then call sy "for the" @ a2 @ 'command or function.'
 
if a2\=='' then call sy "for the" @ a2 @ 'command or function.'
call sy
if errmsgnt\=='' & errmsgto\=="" then call sy 'A notification (via $M) of this error has been sent to' errmsgto
Line 391 ⟶ 497:
syitb: if left(sysy,1)==' ' then sysy=substr(sysy,2); call syit sysy; return
syline: if a5\==0 then call sy 'on line' a5 "of" ufid; _sl=g7; call syfunc; if _sl\=='' then do; call sy; call sy "REXX sourceline is:"; call sy; call sy _sl; call sy; end; if !cms then do;'EXECSTAT' a2 a3;if rc==0 then "EXECDROP" a2 a3;end;return
syntax: !sigl=sigl; call er 13,!fid(2) !fid(3) !sigl !cal() condition('D') sourceline(!sigl)</lang>
</syntaxhighlight>
 
[[Category:REXX library routines]]