ebook img

ANSI X3J18-199x standard.Programming language Rexx PDF

181 Pages·2016·0.4 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview ANSI X3J18-199x standard.Programming language Rexx

ANSI® X3J18-199X American National Standard for Information Systems – Programming Language R EXX Caution: This is a proposed American National Standard of Accredited Standards Com- mittee X3. As such, this is not a complete standard. The X3J18 Technical Committee may modify this document as a result of comments received prior to its approval as a standard. Caution: The developers of this standard have requested that holders of patents that may be required for the implementation of the standard disclose such patents to the publisher. However, neither the developers nor the publisher have undertaken a patent search to identify which, if any, patents may apply to this standard. As of the date of publication of this standard and following calls for identification of patents that may be required for the implementation of the standard, no such claims have been made. No further patent search is conducted by the developer or publisher in respect of any standard it processes. No representation is made or implied that licens- es are not required to avoid infringement in the use of this standard. American Approval of an American National Standard requires verification by ANSI that the requirements for due process, consensus, and other criteria for National approval have been met by the standards developer. Standard Consensus is established when, in the judgment of the ANSI Board of Standards Review, substantial agreement has been reached by directly and materially affected interests. Substantial agreement means much more than a simple majority, but not necessarily unanimity. Consensus requires that all views and objections be considered, and that a concerted effort be made toward their resolution. The use of American National Standards is completely voluntary; their existence does not in any respect preclude anyone, whether he has approved the standards or not, from manufacturing, marketing, purchasing, or using products, processes, or procedures not conforming to the stan- dards. The American National Standards Institute does not develop standards and will in no circumstances give an interpretation of any American National Standard. Moreover, no person shall have the right or authority to issue an interpretation of an American National Standard in the name of the Ameri- can National Standards Institute. Requests for interpretations should be addressed to the secretariat or sponsor whose name appears on the title page of this standard. CAUTION NOTICE: This American National Standard may be revised or withdrawn at any time. The procedures of the American National Standards Institute require that action be taken periodically to reaffirm, revise, or withdraw this standard. Purchasers of American National Standards may receive current information on all standards by calling or writing the Ameri- can National Standards Institute. ANSI X3J18-199X Contents 0 Introduction..................................................................................................1 1 Scope, purpose, and application................................................................1 1.1 Scope........................................................................................................1 1.2 Purpose.....................................................................................................1 1.3 Application................................................................................................1 1.4 Recommendation .....................................................................................1 2 Normative references..................................................................................1 3 Definitions and document notation.............................................................1 3.1 Definitions.................................................................................................1 3.2 Document notation...................................................................................3 3.2.1 Rexx Code.............................................................................................3 3.2.2 Italics......................................................................................................4 4 Conformance ...............................................................................................4 4.1 Conformance............................................................................................4 4.2 Limits.........................................................................................................4 5 Configuration ...............................................................................................5 5.1 Notation.....................................................................................................5 5.1.1 Notation for completion response and conditions...............................5 5.2 Processing initiation.................................................................................5 5.2.1 API_Start ...............................................................................................6 5.3 Source programs and character sets......................................................6 5.3.1 Syntactic_characters ............................................................................6 5.3.2 Extra_letters..........................................................................................7 5.3.3 Other_blank_characters .......................................................................7 5.3.4 Other_negators .....................................................................................8 5.3.5 Other_characters ..................................................................................8 5.4 Configuration characters and encoding ..................................................8 5.4.1 Config_SourceChar...............................................................................8 5.4.2 Config_OtherBlankCharacters..............................................................9 5.4.3 Config_Upper ........................................................................................9 5.4.4 Config_Compare ...................................................................................9 5.4.5 Config_B2C .........................................................................................10 5.4.6 Config_C2B .........................................................................................10 5.4.7 Config_Substr......................................................................................10 i ANSI X3J18-199X 5.4.8 Config_Length.....................................................................................10 5.4.9 Config_Xrange.....................................................................................11 5.5 Commands..............................................................................................11 5.5.1 Config_Command................................................................................11 5.6 External routines ....................................................................................12 5.6.1 Config_ExternalRoutine......................................................................12 5.7 External data queue...............................................................................13 5.7.1 Config_Push........................................................................................13 5.7.2 Config_Queue .....................................................................................13 5.7.3 Config_Pull ..........................................................................................13 5.7.4 Config_Queued ...................................................................................14 5.8 Streams...................................................................................................14 5.8.1 Config_Stream_Charin........................................................................15 5.8.2 Config_Stream_Position.....................................................................15 5.8.3 Config_Stream_Command .................................................................16 5.8.4 Config_Stream_State..........................................................................16 5.8.5 Config_Stream_Charout .....................................................................16 5.8.6 Config_Stream_Qualified....................................................................17 5.8.7 Config_Stream_Unique.......................................................................17 5.8.8 Config_Stream_Query ........................................................................17 5.8.9 Config_Stream_Close.........................................................................17 5.8.10 Config_Stream_Count ......................................................................18 5.9 External variable pools...........................................................................18 5.9.1 Config_Get ..........................................................................................19 5.9.2 Config_Set...........................................................................................19 5.10 Configuration characteristics...............................................................19 5.10.1 Config_Constants..............................................................................19 5.11 Configuration routines..........................................................................20 5.11.1 Config_Trace_Query.........................................................................20 5.11.2 Config_Trace_Input ..........................................................................20 5.11.3 Config_Trace_Output........................................................................21 5.11.4 Config_Default_Input ........................................................................21 5.11.5 Config_Default_Output .....................................................................21 5.11.6 Config_Initialization...........................................................................21 5.11.7 Config_Termination...........................................................................21 5.11.8 Config_Halt_Query............................................................................21 ii ANSI X3J18-199X 5.11.9 Config_Halt_Reset............................................................................22 5.11.10 Config_NoSource............................................................................22 5.11.11 Config_Time....................................................................................22 5.11.12 Config_Random_Seed....................................................................22 5.11.13 Config_Random_Next.....................................................................23 5.11.14 Config_Options................................................................................23 5.12 Traps.....................................................................................................23 5.13 Variable pool.........................................................................................24 5.13.1 API_Set..............................................................................................24 5.13.2 API_Value..........................................................................................25 5.13.3 API_Drop...........................................................................................25 5.13.4 API_SetDirect....................................................................................25 5.13.5 API_ValueDirect................................................................................26 5.13.6 API_DropDirect .................................................................................26 5.13.7 API_ValueOther ................................................................................26 5.13.8 API_Next ...........................................................................................27 5.13.9 API_NextVariable..............................................................................27 6 Syntax constructs......................................................................................29 6.1 Notation...................................................................................................29 6.1.1 Backus Normal Form (BNF)...............................................................29 6.1.2 Operands.............................................................................................29 6.1.3 Operators.............................................................................................29 6.1.4 Grouping..............................................................................................29 6.1.5 BNF syntax definition..........................................................................29 6.1.6 Syntactic errors...................................................................................30 6.2 Lexical.....................................................................................................30 6.2.1 Lexical elements .................................................................................30 6.2.1.1 Events...............................................................................................30 6.2.1.2 Actions and tokens ..........................................................................30 6.2.1.3 Source characters............................................................................31 6.2.1.4 Rules.................................................................................................31 6.2.2 Lexical level.........................................................................................31 6.2.3 Interaction between levels of syntax..................................................33 6.2.3.1 Reserved symbols ...........................................................................34 6.2.3.2 Function name syntax .....................................................................34 iii ANSI X3J18-199X 6.3 Syntax.....................................................................................................34 6.3.1 Syntax elements..................................................................................34 6.3.2 Syntax level.........................................................................................34 6.4 Syntactic information..............................................................................38 6.4.1 VAR_SYMBOL matching....................................................................38 6.4.2 Trace-only labels.................................................................................38 6.4.3 Clauses and line numbers ..................................................................38 6.4.4 Nested IF instructions.........................................................................38 6.4.5 Choice of messages ...........................................................................39 6.4.6 Creation of messages.........................................................................39 6.4.6.1 Error message prefix .......................................................................39 6.4.6.2 Replacement of insertions...............................................................39 7 Evaluation..................................................................................................41 7.1 Variables.................................................................................................41 7.1.1 Var_Empty...........................................................................................41 7.1.2 Var_Set................................................................................................42 7.1.3 Var_Value............................................................................................42 7.1.4 Var_Drop .............................................................................................42 7.1.5 Var_Expose.........................................................................................43 7.1.6 Var_Reset............................................................................................43 7.2 Symbols..................................................................................................43 7.3 Value of a variable .................................................................................43 7.3.1 Derived names ....................................................................................44 7.3.2 Value of a reserved symbol................................................................44 7.4 Expressions and operators....................................................................44 7.4.1 The value of a term.............................................................................44 7.4.2 The value of a prefix_expression.......................................................44 7.4.3 The value of a power_expression ......................................................45 7.4.4 The value of a multiplication...............................................................45 7.4.5 The value of an addition .....................................................................45 7.4.6 The value of a concatenation.............................................................46 7.4.7 The value of a comparison.................................................................47 7.4.8 The value of an and_expression........................................................48 7.4.9 The value of an expression ................................................................48 7.4.10 Arithmetic operations........................................................................48 iv ANSI X3J18-199X 7.5 Functions ................................................................................................58 7.5.1 Invocation............................................................................................58 7.5.2 Evaluation of arguments.....................................................................58 7.5.3 The value of a label.............................................................................58 7.5.4 The value of a function.......................................................................59 7.5.5 Use of Config_ExternalRoutine..........................................................59 8 Execution ...................................................................................................61 8.1 Notation...................................................................................................61 8.2 Initializations, terminations ....................................................................62 8.2.1 Program initialization and message texts..........................................62 8.2.2 Routine initialization............................................................................71 8.2.3 Clause initialization.............................................................................72 8.2.4 Clause termination..............................................................................72 8.3 Instructions.............................................................................................74 8.3.1 ADDRESS ...........................................................................................74 8.3.2 ARG .....................................................................................................77 8.3.3 Assignment..........................................................................................77 8.3.4 CALL....................................................................................................77 8.3.5 Command to the configuration...........................................................78 8.3.6 DO........................................................................................................80 8.3.6.1 DO loop tracing................................................................................82 8.3.7 DROP...................................................................................................82 8.3.8 EXIT.....................................................................................................83 8.3.9 IF..........................................................................................................83 8.3.10 INTERPRET......................................................................................83 8.3.11 ITERATE ...........................................................................................84 8.3.12 Execution of labels............................................................................84 8.3.13 LEAVE ...............................................................................................84 8.3.14 NOP ...................................................................................................84 8.3.15 NUMERIC..........................................................................................84 8.3.15.1 NUMERIC DIGITS.........................................................................84 8.3.15.2 NUMERIC FORM...........................................................................85 8.3.15.3 NUMERIC FUZZ............................................................................85 8.3.16 OPTIONS ..........................................................................................86 8.3.17 PARSE...............................................................................................86 8.3.18 PROCEDURE....................................................................................90 v ANSI X3J18-199X 8.3.19 PULL..................................................................................................91 8.3.20 PUSH.................................................................................................91 8.3.21 QUEUE..............................................................................................91 8.3.22 RETURN............................................................................................91 8.3.23 SAY....................................................................................................92 8.3.24 SELECT.............................................................................................92 8.3.25 SIGNAL..............................................................................................93 8.3.26 TRACE...............................................................................................93 8.3.26.1 Trace output...................................................................................94 8.4 Conditions and Messages......................................................................95 8.4.1 Raising of conditions...........................................................................95 8.4.2 Messages during execution................................................................97 9 Built-in functions........................................................................................99 9.1 Notation...................................................................................................99 9.2 Routines used by built-in functions .......................................................99 9.2.1 Argument checking .............................................................................99 9.2.2 Date calculations...............................................................................102 9.2.3 Radix conversion...............................................................................103 9.2.4 Raising the SYNTAX condition.........................................................104 9.3 Character built-in functions..................................................................104 9.3.1 ABBREV ............................................................................................104 9.3.2 CENTER............................................................................................104 9.3.3 CENTRE............................................................................................105 9.3.4 CHANGESTR....................................................................................105 9.3.5 COMPARE.........................................................................................105 9.3.6 COPIES.............................................................................................106 9.3.7 COUNTSTR.......................................................................................106 9.3.8 DATATYPE........................................................................................106 9.3.9 DELSTR.............................................................................................109 9.3.10 DELWORD ......................................................................................110 9.3.11 INSERT............................................................................................110 9.3.12 LASTPOS........................................................................................111 9.3.13 LEFT................................................................................................111 9.3.14 LENGTH..........................................................................................111 9.3.15 OVERLAY........................................................................................111 9.3.16 POS .................................................................................................112 vi ANSI X3J18-199X 9.3.17 REVERSE........................................................................................112 9.3.18 RIGHT..............................................................................................112 9.3.19 SPACE.............................................................................................113 9.3.20 STRIP ..............................................................................................113 9.3.21 SUBSTR..........................................................................................114 9.3.22 SUBWORD......................................................................................114 9.3.23 TRANSLATE ...................................................................................115 9.3.24 VERIFY............................................................................................116 9.3.25 WORD..............................................................................................116 9.3.26 WORDINDEX..................................................................................116 9.3.27 WORDLENGTH...............................................................................117 9.3.28 WORDPOS......................................................................................117 9.3.29 WORDS...........................................................................................117 9.3.30 XRANGE..........................................................................................118 9.4 Arithmetic built-in functions .................................................................118 9.4.1 ABS....................................................................................................118 9.4.2 FORMAT............................................................................................118 9.4.3 MAX ...................................................................................................122 9.4.4 MIN ....................................................................................................122 9.4.5 SIGN..................................................................................................122 9.4.6 TRUNC ..............................................................................................122 9.5 State built-in functions .........................................................................123 9.5.1 ADDRESS .........................................................................................123 9.5.2 ARG ...................................................................................................123 9.5.3 CONDITION ......................................................................................123 9.5.4 DIGITS...............................................................................................124 9.5.5 ERRORTEXT ....................................................................................124 9.5.6 FORM ................................................................................................124 9.5.7 FUZZ..................................................................................................124 9.5.8 SOURCELINE ...................................................................................125 9.5.9 TRACE...............................................................................................125 9.6 Conversion built-in functions ...............................................................125 9.6.1 B2X ....................................................................................................125 9.6.2 BITAND..............................................................................................126 9.6.3 BITOR................................................................................................127 9.6.4 BITXOR .............................................................................................127 vii ANSI X3J18-199X 9.6.5 C2D....................................................................................................127 9.6.6 C2X....................................................................................................127 9.6.7 D2C....................................................................................................127 9.6.8 D2X....................................................................................................128 9.6.9 X2B ....................................................................................................128 9.6.10 X2C..................................................................................................129 9.6.11 X2D..................................................................................................129 9.7 Input/Output built-in functions .............................................................129 9.7.1 CHARIN.............................................................................................130 9.7.2 CHAROUT.........................................................................................131 9.7.3 CHARS ..............................................................................................132 9.7.4 LINEIN ...............................................................................................132 9.7.5 LINEOUT...........................................................................................133 9.7.6 LINES.................................................................................................134 9.7.7 QUALIFY ...........................................................................................134 9.7.8 STREAM............................................................................................134 9.8 Other built-in functions.........................................................................135 9.8.1 DATE .................................................................................................135 9.8.2 QUEUED............................................................................................137 9.8.3 RANDOM...........................................................................................138 9.8.4 SYMBOL............................................................................................138 9.8.5 TIME ..................................................................................................138 9.8.6 VALUE...............................................................................................140 Annex A — Rationale (informative)............................................................143 A.4.1 Conformance.....................................................................................143 A.4.2 Limits.................................................................................................143 A.5 Configuration........................................................................................143 A.5.1.1 Notation for completion response and conditions........................144 A.5.2.1 API_Start........................................................................................144 A.5.3 Source programs and character sets ..............................................144 A.5.3.2 Extra_letters...................................................................................144 A.5.3.3 Other_blank_characters................................................................144 A.5.3.4 Other_negators..............................................................................145 A.5.4 Configuration characters and encoding...........................................145 A.5.4.4 Config_Compare............................................................................145 A.5.4.5 Config_B2C....................................................................................145 viii

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.