CICS Transaction Server for VSE/ESA REXX Guide SC34-5764-01
CICS Transaction Server for VSE/ESA REXX Guide SC34-5764-01
Note! Before using this information and the product it supports, be sure to read the general information under “Notices” on page 443. Second edition (September 2000) This edition applies to Release 1 of CICS Transaction Server for VSE/ESA, program number 5648-054, and to all subsequent versions, releases, and modifications until otherwise indicated in new editions. Make sure you are using the correct edition for the level of the product. © Copyright IBM Corporation 1992, 2009.
Contents Preface . . . . . . What this book is about Who this book is for . What you need to know Prerequisites . . . . . . to . . . . . . . . . . . . . . . . . . . understand this . . . . . . . . . . . . . . . book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix xix xix xix xix Part 1. User's Guide. . . . . . . . . . . .
Tracing Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Exercises - Using the TRACE Instruction . . . . . . . . . . . . . . . . . . . . . . . 30 Chapter 4. Controlling the Flow within a program Conditional, Looping, and Interrupt Instructions . . Using Conditional Instructions . . . . . . . . . IF...THEN...ELSE Instructions . . . . . . . . Nested IF...THEN...ELSE Instructions . . . . . SELECT WHEN...OTHERWISE...END Instruction. Using Looping Instructions . . . . . . . . . .
What is a Host Command Environment? . . . . . . . . . . . . . . . . . . . . . . . 82 How Is a Command Passed to the Host Environment?. . . . . . . . . . . . . . . . . . 83 Changing the Host Command Environment . . . . . . . . . . . . . . . . . . . . . . 83 Chapter 9. Diagnosing Problems within a program Debugging Programs . . . . . . . . . . . . Tracing Commands with the TRACE Instruction . Using REXX Special Variables RC and SIGL . . Tracing with the Interactive Debug Facility . . .
Operators . . . . . . . . . . . . . Parentheses and Operator Precedence . . Clauses and Instructions . . . . . . . . Null Clauses . . . . . . . . . . . . Labels . . . . . . . . . . . . . . Instructions . . . . . . . . . . . . Assignments . . . . . . . . . . . . Keyword Instructions . . . . . . . . . Commands . . . . . . . . . . . . Assignments and Symbols. . . . . . . . Constant Symbols . . . . . . . . . . Simple Symbols . . . . . . . . . . Compound Symbols . . . . . . . . . Stems . . . . . . . . . . . . .
OPTIONS . . PARSE . . . PROCEDURE PULL . . . PUSH . . . QUEUE . . RETURN . . SAY . . . . SELECT . . SIGNAL . . TRACE . . . UPPER. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OVERLAY. . . . . . . . . . . . POS (Position) . . . . . . . . . . QUEUED . . . . . . . . . . . . RANDOM . . . . . . . . . . . . REVERSE . . . . . . . . . . . RIGHT . . . . . . . . . . . . . SIGN . . . . . . . . . . . . . SOURCELINE . . . . . . . . . . SPACE . . . . . . . . . . . . . STORAGE . . . . . . . . . . . STRIP . . . . . . . . . . . . . SUBSTR (Substring) . . . . . . . . SUBWORD . . . . . . . . . . . SYMBOL . . . . . . . . . . . . TIME . . . . . . . . . . . . . TRACE . . . . . . . . . . . . .
Arithmetic Operation Rules—Additional Numeric Comparisons . . . . . . Exponential Notation . . . . . . . Numeric Information . . . . . . . Whole Numbers . . . . . . . . Numbers Used Directly by REXX . . Errors . . . . . . . . . . . . Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
QQUIT . . QUERY . QUIT . . RESERVED RESET . . RIGHT . . SAVE . . SORT . . SPLIT . . STRIP . . SYNONYM TOP . . . TRUNC. . UP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Security . . . RLS commands CKDIR . . . DELETE . . LPULL . . . LPUSH . . . LQUEUE . . MKDIR . . . READ . . . VARDROP . VARGET . . VARPUT . . WRITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Options. . . . . . . . . . . . . . . PANEL Variables . . . . . . . . . . . Panel Facility Return Code Information . . . Return Codes . . . . . . . . . . . . System Error Reason Codes . . . . . . . Programmer Introduced Warning/Error Reason State Codes and Input Codes . . . . . . Location Codes. . . . . . . . . . . . Examples of Sample Panels . . . . . . . . Example 1 . . . . . . . . . . . . . Example 2 . . . . . . . . . . . . . Example 3 . . . . . . . . . . . . . Example 4 . . . . . . . . . . . . .
Example . . Notes . . . DEFCMD . . . Operands . . Return Codes Example . . Notes . . . DEFSCMD . . Operands . . Return Codes Example . . Notes . . . DEFTRNID . . Operands . . Return Codes Example . . Notes . . . DIR . . . . . Operands . . Return Codes Examples . . Note . . . . EDIT. . . . . Operands . . Return Codes Example . . Note . . . . EXEC . . . . Operands . . Return Codes Example . . EXECDROP . . Operands . . Return Codes Example . . Note . . . . EXECIO . . . Operands . . Return Codes Examples . .
Return Codes Example . . Note . . . . FLST . . . . Operands . . Return Codes Example . . Notes . . . GETVERS . . Return Codes Example . . HELP . . . . Operands . . Return Codes IMPORT . . . Operands . . Return Codes Example . . LISTCMD . . . Operands . . Return Codes Example . . LISTCLIB . . . Operands . . Return Codes Example . . LISTELIB . . . Operands . . Return Codes Example . . LISTPOOL . . Operands . . Return Codes Example . . Note . . . . LISTTRNID . . Return Codes Example . . PATH . . . . Operands .
Return Codes Example . . Notes . . . SET . . . . . Operands . . Return Codes Example . . Notes . . . SETSYS . . . Operands . . Return Codes Example . . S2C . . . . . Operands . . Return Codes Example . . Notes . . . TERMID . . . Return Codes Example . . WAITREAD . . Return Codes Example . . Note . . . . WAITREQ. . . Return Codes Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LISTPOOL . . LISTTRNID . . C2S . . . . . PSEUDO . . . AUTHUSER . . SETSYS . . . S2C . . . . . TERMID . . . WAITREAD . . WAITREQ. . . EXEC . . . . CEDA and CEMT EXECIO . . . CONVTMAP . . SCRNINFO . . CICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
System Profile Exec . . . . . . . . . . . . . . . . Authorized REXX/CICS VSE Librarian sublibraries . . . . . Defining Authorized Users . . . . . . . . . . . . . . Setting System Options . . . . . . . . . . . . . . . Defining and Initializing a REXX File System (RFS) File Pool . Adding Files to a REXX File System (RFS) File Pool . . . . RFS File Sharing Authorization . . . . . . . . . . . . Creating a PLT Entry for CICSTART . . . . . . . . . . Security Exit . . . . . . . . . . . . . . . . . . . CICSECX2 . .
Screen Definition Facility II (SDF II) . . . . . . . . . . . . . . . . . . . . . . . . 441 Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 Sending your comments to IBM . . . . . . . . . . . . . . . . . . . . . . . . . .
Preface What this book is about This book describes REXX/CICS or REXX for CICS Transaction Server for VSE/ESA. This IBM program product provides a native REXX-based application development, customization, prototyping, and procedures language environment for REXX/CICS, along with associated runtime facilities.
xx CICS TS for VSE/ESA: REXX Guide
Part 1. User's Guide © Copyright IBM Corp.
2 CICS TS for VSE/ESA: REXX Guide
Chapter 1. Introduction This chapter describes the REXX programming language and some of its features. What is REXX? REXX is an extremely versatile programming language. Common programming structure, readability, and free format make it a good language for beginners and general users. REXX is also suitable for more experienced computer professionals because it can be intermixed with commands to host environments, it provides powerful functions, and it has extensive mathematical capabilities.
Introduction Components of REXX The various components of REXX make it a powerful tool for programmers. REXX is made up of: v Clauses, which can be instructions, null clauses, or labels. Instructions can be: – Keyword instructions – Assignments – Commands (REXX/CICS and CICS commands and SQL). The language processor processes keyword instructions and assignments. v Built-in functions — These functions are built into the language processor and provide convenient processing options.
Chapter 2. Writing and Running a REXX Program This chapter introduces programs and their syntax, describes the steps involved in writing and running programs, and explains concepts you need to understand to avoid common problems. What you need to run a REXX Program? Before you can run a REXX Program, you must configure the REXX support. Go through the following steps: 1. Create the RFS Filepools 2. Install Resource Definitions 3. Update LSRPOOL Definitions 4. Rename supplied Procedures 5. Update CICSTART.
Writing and Running a REXX Program /**************************** REXX *********************************/ /* This program adds two numbers and produces their sum. */ /*******************************************************************/ say 'Enter first number.' PULL number1 /* Assigns: number1=42 */ say 'Enter second number.' PULL number2 /* Assigns: number2=21 */ sum = number1 + number2 SAY 'The sum of the two numbers is' sum'.' Figure 2.
Writing and Running a REXX Program SAY 'This is a REXX literal string.' /* Using single quotation marks */ SAY "This is a REXX literal string." /* Using double quotation marks */ Do not enclose a literal string with one each of the two different types of quotation marks. For example, the following is incorrect: SAY 'This is a REXX literal string.
Writing and Running a REXX Program SAY 'This is' 'a string.' The space between the two separate strings is preserved: This is a string. Continuing a literal string without adding a space If you need to continue an instruction to a second or more lines, but do not want REXX to add spaces in the line, use the concatenation operand (two single OR bars, ||). SAY 'This is an extended literal string that is bro'||, 'ken in an awkward place.' This example results in one line no space in the word “broken”.
Writing and Running a REXX Program Types of REXX Clauses REXX clauses can be: instructions, null clauses, and labels. Instructions can be keyword instructions, assignments, or commands. The following example shows a program with these types of clauses. A description of each type of clause follows the example. /* QUOTA REXX program. Two car dealerships are competing to /* sell the most cars in 30 days.
Writing and Running a REXX Program Label A label, such as sub: is a symbolic name followed by a colon. A label can contain either single- or double-byte characters or a combination of single- and double-byte characters. (Double-byte characters are valid only if OPTIONS ETMODE is the first instruction in your program.) A label identifies a portion of the program and is commonly used in subroutines and functions, and with the SIGNAL instruction.
Writing and Running a REXX Program character is X'0F') The SO and SI characters are non-printable. In the following example, the less than (<) and greater than (>) symbols represent shift-out (SO) and shift-in (SI), respectively. For example, <.S.Y.M.D> and <.D.B.C.S.R.T.N> represent DBCS symbols in the following example. Example The following is an example of a program using a DBCS variable name and a DBCS subroutine label. /* REXX */ OPTIONS 'ETMODE' <.S.Y.M.
Writing and Running a REXX Program rexx hello Hello! What is your name? sam Hello SAM Here is what happens: 1. The SAY instruction displays Hello! What is your name? 2. The PULL instruction pauses the program, waiting for a reply. 3. You type sam on the command line and then press Enter. 4. The PULL instruction puts the word SAM into the variable (the place in the computer's storage) called who. 5.
Writing and Running a REXX Program /************************** REXX **********************************/ /* This REXX program contains a deliberate error of not closing */ /* a comment. Without the error, it would pull input to produce */ /* a greeting. */ /******************************************************************/ PULL who IF who = '' THEN SAY 'Hello, stranger' ELSE SAY 'Hello,' who /* Get the person's name. Figure 5.
Writing and Running a REXX Program Quotation marks ensure that information in a program is processed exactly as typed. This is important in the following situations: v For output that must be lowercase or a mixture of uppercase and lowercase. v To ensure that commands are processed correctly. For example, if a variable name in a program is the same as a command name, the program can end in error when the command is issued.
Writing and Running a REXX Program /**************************** REXX ******************************/ /* This program adds two numbers and produces their sum. */ /****************************************************************/ PULL number1 PULL number2 sum = number1 + number2 SAY 'The sum of the two numbers is' sum'.' Figure 7. Example of a program That Uses PULL The PULL instruction can extract more than one value at a time from the terminal by separating a line of input.
Writing and Running a REXX Program REXX add 42 21 10 The language processor assigns the value 42 to number1, the first variable following ARG. It assigns the value 21 10 to number2, the second variable. In this situation, the program ends with an error when it tries to add the two variables. In other situations, the program might not end in error. To prevent the last variable from getting the remaining values, use a period (.) at the end of the PULL or ARG instruction. ARG number1 number2 .
Writing and Running a REXX Program 4. lastname = WEBER, firstname = JOE, score = 91 5. lastname = Baker, firstname = Amanda, score = Marie 95 6. lastname = Callahan, firstname = Eunice, score = 88 Passing Arguments Values passed to a program are usually called arguments. An argument can consist of one word or a string of words. Blanks separate words within an argument from each other. The number of arguments passed depends on how the program is called.
18 CICS TS for VSE/ESA: REXX Guide
Chapter 3. Using Variables and Expressions This chapter describes variables, expressions, and operators, and explains how to use them in REXX programs. Program Variables One of the most powerful aspects of computer programming is the ability to process variable data to achieve a result. Regardless of the complexity of a process, when data is unknown or varies, you substitute a symbol for the data. This is much like substituting x and y in an algebraic equation.
Using Variables and Expressions v The first character cannot be 0 through 9 or a period (.) v The variable name cannot exceed 250 bytes. For names containing DBCS characters, count each DBCS character as 2 bytes, and count the shift-out (SO) and shift-in (SI) as 1 byte each. v SO (X'0E') and SI (X'0F') must delimit DBCS characters within a DBCS name. Also note that: – SO and SI cannot be contiguous. – Nesting of SO / SI is not permitted. – A DBCS name cannot contain a DBCS blank (X'4040').
Using Variables and Expressions ANSWERS 1. Incorrect, because the first character is a number. 2. Incorrect, because the first character is a “£”. 3. Valid 4. Valid 5. Valid, but it is a special variable name that you should use only to receive results from a subroutine. Using Expressions An expression is something that needs to be evaluated and consists of numbers, variables, or strings, and zero or more operators.
Using Variables and Expressions ** Raise a number to a whole number power −number (Prefix −) Same as the subtraction 0 - number +number (Prefix +) Same as the addition 0 + number Using numeric constants and arithmetic operators, you can write arithmetic expressions such as: 7 7 7 7 7 + 2 - 2 * 2 ** 2 ** 2.5 /* /* /* /* /* result result result result result is is is is is 9 5 14 49 an error */ */ */ */ */ Division Notice that three operators represent division.
Using Variables and Expressions 7 + 2 * 3 - 1 \___/ 6 3. Addition and subtraction from left to right 7 + 6 - 1 = 12 Using Arithmetic Expressions You can use arithmetic expressions in a program many different ways. The following example uses several arithmetic operators to round and remove extra decimal places from a dollar and cents value.
Using Variables and Expressions For example, if A = 4 and Z = 3, then the results of the previous comparison questions are: (A = Z) (A > Z) (A < Z) Does 4 = 3? Is 4 > 3? Is 4 < 3? 0 (False) 1 (True) 0 (False) The more commonly used comparison operators are as follows: Operator Meaning = Equal == Strictly Equal \= Not equal \ == Not strictly equal > Greater than < Less than >< Greater than or less than (same as not equal) >= Greater than or equal to \< Not less than <= Less than or equa
Using Variables and Expressions /****************************** REXX *********************************/ /* This program compares what you paid for lunch for two */ /* days in a row and then comments on the comparison. */ /*********************************************************************/ PARSE PULL yesterday /* Gets yesterday's price from input stream */ PARSE PULL today /* Gets today's price */ IF today > yesterday THEN /* lunch cost increased */ SAY "Today's lunch cost more than yesterday's.
Using Variables and Expressions Operator Meaning & AND Returns 1 if both comparisons are true. For example: | (4 > 2) & (a = a) /* true, so result is 1 */ (2 > 4) & (a = a) /* false, so result is 0 */ Inclusive OR Returns 1 if at least one comparison is true. For example: && (4 > 2) | (5 = 3) /* at least one is true, so result is 1 */ (2 > 4) | (5 = 3) /* neither one is true, so result is 0 */ Exclusive OR Returns 1 if only one comparison (but not both) is true.
Using Variables and Expressions \___________________/ / true / \_____________________________/ true As a result, when you run the program, it produces the result: Go skiing. Exercises - Using Logical Expressions A student applying to colleges has decided to evaluate them according to the following specifications: IF (inexpensive | scholarship) & (reputable | nearby) SAY "I'll consider it.
Using Variables and Expressions /****************************** REXX *********************************/ /* This program formats data into columns for output. */ /*********************************************************************/ sport = 'base' equipment = 'ball' column = ' ' cost = 5 SAY sport||equipment column '£' cost Figure 14. Example Using Concatenation Operators The result of this example is: baseball £ 5 A more sophisticated way to format information is with parsing and templates.
Using Variables and Expressions 3. Evaluate 0 & 1 is 0 Exercises - Priority of Operators 1. What are the answers to the following examples? a. 22 + (12 * 1) b. -6 / -2 > (45 % 7 / 2) - 1 c. 10 * 2 - (5 + 1) // 5 * 2 + 15 - 1 2.
Using Variables and Expressions 1 2 3 4 5 6 7 8 9 10 11 /************************* REXX ***************************/ /* This program uses the TRACE instruction to show how */ /* an expression is evaluated, operation by operation. */ /**********************************************************/ a = 9 y = 2 TRACE I IF a + 1 > 5 * y THEN SAY 'a is big enough.' ELSE NOP /* No operation on the ELSE path */ Figure 15.
Using Variables and Expressions /****************************** REXX ********************************/ /* This program uses the TRACE instruction to show how the language */ /* processor evaluates an expression, operation by operation. */ /********************************************************************/ a = 1 z = 2 c = 3 d = 4 TRACE I IF (a > z) | (c < 2 * d) THEN SAY 'At least one expression was true.' ELSE SAY 'Neither expression was true.' Figure 16.
Using Variables and Expressions 32 CICS TS for VSE/ESA: REXX Guide
Chapter 4. Controlling the Flow within a program This chapter introduces instructions that alter the sequential execution of a program and demonstrates how to use those instructions. Conditional, Looping, and Interrupt Instructions Generally, when a program runs, one instruction after another executes, starting with the first and ending with the last. The language processor, unless told otherwise, executes instructions sequentially.
Control Flow within a Program As a REXX instruction, the flowchart example looks like: IF expression THEN instruction ELSE instruction You can also arrange the clauses in one of the following ways to enhance readability: IF expression THEN instruction ELSE instruction or IF expression THEN instruction ELSE instruction When you put the entire instruction on one line, you must use a semicolon before the ELSE to separate the THEN clause from the ELSE clause.
Control Flow within a Program /******************************** REXX *******************************/ /* This program demonstrates what can happen when you do not include */ /* DOs, ENDs, and ELSEs in nested IF...THEN...ELSE instructions. */ /*********************************************************************/ weather = 'fine' tenniscourt = 'occupied' IF weather = 'fine' THEN SAY 'What a lovely day!' IF tenniscourt = 'free' THEN SAY 'Let''s play tennis!' ELSE SAY 'We should take our raincoats!' Figure 17.
Control Flow within a Program Exercise - Using the IF...THEN...
Control Flow within a Program SELECT WHEN...OTHERWISE...END Instruction To select one of any number of choices, use the SELECT WHEN...OTHERWISE...END instruction.
Control Flow within a Program /******************************** REXX *******************************/ /* This program receives input with a person's age and sex. In */ /* reply, it produces a person's status as follows: */ /* BABIES - under 5 */ /* GIRLS - female 5 to 12 */ /* BOYS - male 5 to 12 */ /* TEENAGERS - 13 through 19 */ /* WOMEN - female 20 and up */ /* MEN - male 20 and up */ /*********************************************************************/ PARSE ARG age sex .
Control Flow within a Program /******************************** REXX *******************************/ /* This program uses the input of a whole number from 1 to 12 that */ /* represents a month. It produces the number of days in that */ /* month.
Control Flow within a Program DO number = 1 TO 5 SAY 'Loop' number SAY 'Hello!' END SAY 'Dropped out of the loop when number reached' number This example results in five lines of Hello! preceded by the number of the loop. The number increases at the bottom of the loop and is tested at the top.
Control Flow within a Program /******************************* REXX ********************************/ /* This program processes strings until the value of a string is */ /* a null string. */ /*********************************************************************/ DO FOREVER PULL string /* Gets string from input stream */ IF string = '' THEN PULL file_name IF file_name = '' THEN EXIT ELSE DO result = process(string) /* Calls a user-written function */ /* to do processing on string.
Control Flow within a Program Number Number Number Number Number Number Number Number Number 1 2 3 4 5 6 7 9 10 Exercises - Using Loops 1. What are the results of the following loops? a. DO digit = 1 TO 3 SAY digit END SAY 'Digit is now' digit b. DO count = 10 BY -2 TO 6 SAY count END SAY 'Count is now' count c. DO index = 10 TO 8 SAY 'Hup! Hup! Hup!' END SAY 'Index is now' index 2. Sometimes an infinite loop can occur when input to end the loop does not match what is expected.
Control Flow within a Program DO WHILE Loops DO WHILE loops in a flowchart appear as follows: DO WHILE expression True instruction(s) False END As REXX instructions, the flowchart example looks like: DO WHILE expression instruction(s) END /* expression must be true */ Use a DO WHILE loop when you want to execute the loop while a condition is true. DO WHILE tests the condition at the top of the loop. If the condition is initially false, the language processor never executes the loop.
Control Flow within a Program /******************************** REXX *******************************/ /* This program uses a DO WHILE loop to keep track of window seats */ /* in an 8-seat commuter airline.
Control Flow within a Program /******************************** REXX ******************************/ /* This program uses a DO UNTIL loop to ask for a password. If the */ /* password is incorrect three times, the loop ends. */ /********************************************************************/ password = 'abracadabra' time = 0 DO UNTIL (answer = password) | (time = 3) PULL answer /* Gets ANSWER from input stream */ time = time + 1 END Figure 24.
Control Flow within a Program ANSWER /******************************** REXX *******************************/ /* This program uses a DO UNTIL loop to keep track of window seats */ /* in an 8-seat commuter airline.
Control Flow within a Program DO outer = 1 TO 2 DO inner = 1 TO 2 SAY 'HIP' END SAY 'HURRAH' END The output from this example is: HIP HIP HURRAH HIP HIP HURRAH If you need to leave a loop when a certain condition arises, use the LEAVE instruction followed by the name of the control variable of the loop. If the LEAVE instruction is for the inner loop, processing leaves the inner loop and goes to the outer loop. If the LEAVE instruction is for the outer loop, processing leaves both loops.
Control Flow within a Program Outer 1 Outer 1 Outer 1 Inner 1 Inner 2 Inner 3 Outer 2 Outer 2 Outer 2 Inner 1 Inner 2 Inner 3 Outer 3 Outer 3 Outer 3 Inner 1 Inner 2 Inner 3 2. The result is one line of output for each of the inner loops.
Control Flow within a Program CALL and RETURN Instructions The CALL instruction interrupts the flow of a program by passing control to an internal or external subroutine. An internal subroutine is part of the calling program. An external subroutine is another program. The RETURN instruction returns control from a subroutine back to the calling program and optionally returns a value. For more detailed information on the CALL and RETURN instructions, see sections “CALL” on page 135 and “RETURN” on page 161.
Control Flow within a Program SIGNAL Instruction The SIGNAL instruction, like CALL, interrupts the usual flow of a program and causes control to pass to a specified label. The label to which control passes can be before or after the SIGNAL instruction. Unlike CALL, SIGNAL does not return to a specific instruction to resume execution. When you use SIGNAL from within a loop, the loop automatically ends. When you use SIGNAL from an internal routine, the internal routine does not return to its caller.
Chapter 5. Using Functions This chapter defines what a function is and describes how to use the built-in functions. What is a Function? A function is a sequence of instructions that can receive data, process it, and return a value. In REXX, there are several kinds of functions: v Built-in functions are built into the language processor. More about built-in functions appears later in this chapter. v User-written functions are those an individual user writes or an installation supplies.
Using Functions /***************************** REXX **********************************/ /* This program receives three numbers as arguments and analyzes */ /* which number is the greatest. */ /*********************************************************************/ PARSE ARG number1, number2, number3 . IF number1 > number2 THEN IF number1 > number3 THEN greatest = number1 ELSE greatest = number3 ELSE IF number2 > number3 THEN greatest = number2 ELSE greatest = number3 RETURN greatest Figure 27.
Using Functions Arithmetic Functions Function Description ABS Returns the absolute value of the input number. DIGITS Returns the current setting of NUMERIC DIGITS. FORM Returns the current setting of NUMERIC FORM. FUZZ Returns the current setting of NUMERIC FUZZ. MAX Returns the largest number from the list specified, formatted according to the current NUMERIC settings. MIN Returns the smallest number from the list specified, formatted according to the current NUMERIC settings.
Using Functions Formatting Functions Function Description CENTER or CENTRE Returns a string of a specified length with the input string centered in it, with pad characters added as necessary to make up the length. COPIES Returns the specified number of concatenated copies of the input string. FORMAT JUSTIFY 1 Returns the input number, rounded and formatted. Returns a specified string formatted by adding pad characters between words to justify to both margins.
Using Functions Function Description WORDPOS Returns the word number of the first word of a specified phrase in the input string. WORDS Returns the number of words in the input string. Miscellaneous Functions Function Description ADDRESS Returns the name of the environment to which commands are currently being sent. ARG Returns an argument string or information about the argument strings to a program or internal routine.
Using Functions Other useful built-in functions to test input are WORDS, VERIFY, LENGTH, and SIGN. Exercise - Writing a program with Built-In Functions Write a program that checks a file name for a length of 8 characters. If the name is longer than 8 characters, the program truncates it to 8 and sends a message indicating the shortened name. Use the built-in functions LENGTH, see page 188, and SUBSTR, see page 192.
Chapter 6. Writing Subroutines and Functions This chapter shows how to write subroutines and functions and discusses their differences and similarities. What are Subroutines and Functions? Subroutines and functions are routines made up of a sequence of instructions that can receive data, process it, and return a value. The routines can be: Internal The routine is within the current program, marked by a label, and only that program uses the routine. External A REXX subroutine that exists as a separate file.
Writing Subroutines and Functions CALL SUBSTR 'verylongword', 1, 8 a = RESULT /* a is set to 'verylong' */ When deciding whether to write a subroutine or a function, ask yourself the following questions: v Is a returned value optional? If so, write a subroutine. v Do I need a value returned as an expression within an instruction? If so, write a function. The rest of this chapter describes how to write subroutines and functions and finally summarizes the differences and similarities between the two.
Writing Subroutines and Functions instruction(s) z=func1(arg1, arg2) instruction(s) EXIT instruction(s) RETURN Both subroutines and functions can be internal (designated by a label) or external (designated by the subroutine or function in the REXX File System/VSE Librarian sublibrary member name). The two preceding examples illustrate an internal subroutine named sub1 and an internal function named func1.
Writing Subroutines and Functions MAIN instruction(s) z=func2(arg1) instruction(s) … … … exit FUNC2 ARG var1 instruction(s) RETURN value When to Use Internal Versus External Subroutines or Functions To determine whether to make a subroutine or function internal or external, you might consider factors, such as: v Size of the subroutine or function. Very large subroutines and functions often are external, whereas small ones fit easily within the calling program. v How you want to pass information.
Writing Subroutines and Functions /******************************* REXX ********************************/ /* This program receives a calculated value from an internal */ /* subroutine and uses that value in a SAY instruction. */ /*********************************************************************/ number1 = 5 number2 = 10 CALL subroutine SAY answer EXIT /* Produces 15 */ subroutine: answer = number1 + number2 RETURN Figure 29.
Writing Subroutines and Functions /******************************* REXX ********************************/ /* NOTE: This program contains an error. */ /* It uses a DO loop to call an internal subroutine, and the */ /* subroutine uses a DO loop with the same control variable as the */ /* main program. The DO loop in the main program runs only once.
Writing Subroutines and Functions The following examples show how results differ when a subroutine or function uses or does not use PROCEDURE. /******************************* REXX ********************************/ /* This program uses a PROCEDURE instruction to protect the */ /* variables within its subroutine.
Writing Subroutines and Functions /******************************* REXX ********************************/ /* This program does not use a PROCEDURE instruction to protect the */ /* variables within its function. */ /*********************************************************************/ number1 = 10 SAY pass() number2 /* Produces 7 5 */ EXIT pass: number1 = 7 number2 = 5 RETURN number1 Figure 36.
Writing Subroutines and Functions In a function call, you can pass up to 20 arguments separated by commas. function(argument1,argument2,argument3,...) Using the ARG Instruction: A subroutine or function can receive the arguments with the ARG instruction. In the ARG instruction, commas also separate arguments. ARG arg1, arg2, arg3, ...
Writing Subroutines and Functions /***********************************REXX***********************************/ /* This program receives as arguments the length and width of a */ /* rectangle and passes that information to an internal function, */ /* named perimeter. The function then calculates the perimeter of */ /* the rectangle. */ /*****************************************************************************/ PARSE ARG long wide SAY ‘The perimeter is’ perimeter (long,wide) ‘inches.
Writing Subroutines and Functions Exercise - Writing an Internal and an External Subroutine Write a program that plays a simulated coin toss game and produces the accumulated scores. There should be four possible inputs: v 'HEADS' v 'TAILS' v '' (Null—to quit the game) v None of these three (incorrect response). Write an internal subroutine without arguments to check for valid input. Send valid input to an external subroutine that uses the RANDOM built-in function to generate random outcomes.
Writing Subroutines and Functions /*************************** REXX ************************************/ /* This internal subroutine checks for valid input of "HEADS", */ /* "TAILS", or "" (to quit). If the input is anything else, the */ /* subroutine says the input is not valid and gets the next input. */ /* The subroutine keeps repeating until the input is valid.
Writing Subroutines and Functions /******************************* REXX ********************************/ /* This function receives a list of numbers, adds them, computes */ /* their average, and returns the average to the calling program.
Writing Subroutines and Functions Subroutines and Functions—Similarities and Differences The following tables highlight similarities and differences between subroutines and functions: Similarities between Subroutines and Functions Can be internal or external. Internal – Can pass information by using common variables – Can protect variables with the PROCEDURE instruction – Can pass information by using arguments.
Chapter 7. Manipulating Data This chapter describes how to use compound variables and stems and explains parsing. Using Compound Variables and Stems Sometimes it is useful to store groups of related data in a way that makes data retrieval easy. For example, you could store a list of employee names in an array and retrieve them by number. An array is an arrangement of elements in one or more dimensions, identified by a single name.
Manipulating Data DO i = 1 TO 6 PARSE PULL employee.i END If you use the same names used in the example of the employee array, you have a group of compound variables as follows: employee.1 employee.2 employee.3 employee.4 employee.5 employee.6 = = = = = = 'Adams, Joe' 'Crandall, Amy' 'Devon, David' 'Garrison, Donna' 'Leone, Mary' 'Sebastian, Isaac' After the names are in the group of compound variables, you can easily access a name by its number or by a variable that represents its number.
Manipulating Data h. SAY a.first i. SAY z.a.4 2. After these assignment instructions, what output do the SAY instructions produce? hole.1 = 'full' hole. = 'empty' hole.s = 'full' a. b. c. SAY hole.1 SAY hole.s SAY hole.mouse ANSWERS 1. a. 3 b. 4 c. last d. A.3 e. 2 f. D.last g. C.3 h. A.FIRST i. cv3d 2. a. empty b. full c. empty Parsing Data Parsing is separating data and assigning parts of it into one or more variables.
Manipulating Data /* This REXX program parses the string: "Knowledge is power." PARSE PULL word1 word2 word3 /* word1 contains 'Knowledge' */ /* word2 contains 'is' */ /* word3 contains 'power.' */ */ You can include the optional keyword UPPER on any variant of the PARSE instruction.This causes the language processor to uppercase character information before assigning it into variables. For example, using PARSE UPPER PULL... gives the same result as using PULL.
Manipulating Data quote = 'Knowledge is power.' PARSE VAR quote word1 word2 word3 /* word1 contains 'Knowledge' */ /* word2 contains 'is' */ /* word3 contains 'power.' */ PARSE VAR does not uppercase character information before assigning it into variables. If you want uppercase translation, use PARSE UPPER VAR. More about Parsing into Words In the preceding examples, the number of words in the data to parse is always the same as the number of variables in the template.
Manipulating Data String If you use a string in a template, parsing checks the input data for a matching string. When assigning data into variables, parsing generally skips over the part of the input string that matches the string in the template.
Manipulating Data /* /* /* /* part1 part2 part3 part4 contains contains contains contains 'Igno' 'rance' ' is bliss.' 'Ignorance is bliss.' */ */ */ */ When each variable in a template has column numbers both before and after it, the two numbers indicate the beginning and the end of the data for the variable. quote = 'Ignorance is bliss.' ....+....1....+....
Manipulating Data (Without +, −, or = before the left parenthesis, the language processor would consider the variable to be a string pattern.) The following example uses the variable numeric pattern movex. quote = 'Ignorance is bliss.' ....+....1....+....2 movex = 3 /* variable position */ PARSE VAR quote part5 +10 part6 +3 part7 -(movex) part8 /* part5 contains 'Ignorance ' */ /* part6 contains 'is ' */ /* part7 contains 'bliss.' */ /* part8 contains 'is bliss.
Manipulating Data c) word3 = 4. PARSE VALUE 'Experience is the best teacher.' WITH v1 5 v2 ....+....1....+....2....+....3. a) v1 = b) v2 = 5. quote = 'Experience is the best teacher.' ....+....1....+....2....+....3. PARSE VAR quote v1 v2 15 v3 3 v4 a) v1 = b) v2 = c) v3 = d) v4 = 6. quote = 'Experience is the best teacher.' ....+....1....+....2....+....3. PARSE UPPER VAR quote 15 v1 +16 =12 v2 +2 1 v3 +10 a) v1 = b) v2 = c) v3 = 7. quote = 'Experience is the best teacher.' ....+....1....+....2....+..
Manipulating Data f) word6 = '' 3. a) word1 = Experience b) word2 = is c) word3 = teacher. 4. a) v1 = Expe b) v2 = rience is the best teacher. 5. a) v1 = Experience b) v2 = is (Note that v2 contains 'is '.) c) v3 = the best teacher. d) v4 = perience is the best teacher. 6. a) v1 = THE BEST TEACHER b) v2 = IS c) v3 = EXPERIENCE 7. a) v1 = 'Experience ' b) v2 = 'is the' c) v3 = ' best teacher.' d) v4 = ' the best teacher.' 8. a) v1 = 'Experi' b) v2 = 'ence i' c) v3 = 's the best teacher.' 9.
Chapter 8. Using Commands from a program This chapter describes how to use commands in a REXX program. Types of Commands A REXX program can issue several types of commands. The main categories of commands are: REXX/CICS commands These commands provide access to miscellaneous REXX/CICS facilities. See Chapter 25, “REXX/CICS Commands,” on page 319. CICS commands These commands implement the EXEC CICS commands that application programs use to access CICS services.
Using Commands from a Program Calling Another REXX Program as a Command Previously, this book discussed how to call another program as an external routine (Chapter 6, “Writing Subroutines and Functions,” on page 57). You can also call a program from another program explicitly with the EXEC command. Like an external routine, a program called explicitly or implicitly can return a value to the caller with the RETURN or EXIT instruction.
Using Commands from a Program RFS This is an optional environment that executes commands for the REXX File System. RLS This is an optional environment that executes commands for the REXX List System. Note: It is recommended that the default environment of REXXCICS be used for all commands (that is, the ADDRESS instruction should not be specified). How Is a Command Passed to the Host Environment? The language processor evaluates each expression in a REXX program.
84 CICS TS for VSE/ESA: REXX Guide
Chapter 9. Diagnosing Problems within a program This chapter describes how to trace command output and other debugging techniques. Debugging Programs When you encounter an error in a program, there are several ways to locate the error. v The TRACE instruction shows how the language processor evaluates each operation. For information about using the TRACE instruction to evaluate expressions, see section “Tracing Expressions with the TRACE Instruction” on page 29.
Diagnosing Problems within a Program SIGL The language processor sets the SIGL special variable in connection with a transfer of control within a program because of a function, a SIGNAL or a CALL instruction. When the language processor transfers control to another routine or another part of the program, it sets the SIGL special variable to the line number from which the transfer occurred. (The line numbers in the following example are to aid in discussion after the example.
Diagnosing Problems within a Program instruction2 END ELSE instructionA If the command ends with a nonzero return code, the ELSE path is taken. To force taking the first path, the input during interactive debug could be: RC = 0 Ending Interactive Debug You can end interactive debug in one of the following ways: v Use the TRACE OFF instruction as input. The TRACE OFF instruction ends tracing, as stated in the message at the beginning of interactive debug: +++ Interactive trace.
88 CICS TS for VSE/ESA: REXX Guide
Chapter 10. Programming Style and Techniques The method you use for constructing your programs is just as important as the language you use to write them. Consider the Data When you are faced with the task of writing a program, the first thing to consider is the data you are required to process. Make a list of the input data—what are the items and what are the possible values of each? If the items have a kind of structure or pattern, draw a diagram to illustrate it. Then do the same for the output data.
Programming Style and Techniques Answer: /* CON EXEC */ /* Tossing a coin. The machine is lucky, not the user */ do forever say "Let's play a game! Type 'Heads', 'Tails'", "or 'Quit' and press ENTER." pull answer select when answer = "HEADS" then say "Sorry! It was TAILS. Hard luck!" when answer = "TAILS" then say "Sorry! It was HEADS. Hard luck!" when answer = "QUIT" then exit otherwise say "That's not a valid answer. Try again!" end say end Happy Hour Here is a chance to have some fun.
Programming Style and Techniques /* CATMOUSE EXEC */ /* The user says where the mouse is to go. /* will the cat jump? say say say say say say "This is the mouse ----------> "These are the cat's paws ---> "This is the mousehole ------> "This is a wall -------------> But where */ */ @" ( )" O" |" "You are the mouse. You win if you reach", "the mousehole. You cannot go past" say "the cat. Wait for him to jump over you.
Programming Style and Techniques then mouse = cat otherwise /* moves */ mouse = mouse + move end if mouse = hole then leave /* reaches hole */ if mouse = cat then leave /* hits cat */ /*---------------------------------------------------*/ /* Cat turn */ /*---------------------------------------------------*/ jump = random(1,spring) if cat > mouse then do /* cat tries to jump left */ Temp = cat - jump if Temp < 1 then nop /* hits wall */ else cat = Temp end else do /* cat tries to jump right */ if cat + jum
Programming Style and Techniques Do forever call Display Mouse's move Cat's move end Conclusion Methods for Designing Loops The method for designing loops is to ask two questions: v Will it always end? v Whenever it terminates, will the data meet the conditions required? Well, the loop terminates (and the game ends) when: 1. The mouse runs to the hole. 2. The mouse runs into the cat. 3. The cat catches the mouse. The Conclusion At the end of the program, the user must be told what happened.
Programming Style and Techniques What Do We Have So Far? Putting all this together, we have: /*------------------------------------------------------*/ /* Main program */ /*------------------------------------------------------*/ do forever call display /*---------------------------------------------------*/ /* Mouse's turn */ /*---------------------------------------------------*/ ...
Programming Style and Techniques At this stage, look at the specification again. A sailor might need to put on the pullover in the dark, quickly, without worrying about the front or back. Therefore, the front should be the same as the back; and the two sleeves should also be the same.
Programming Style and Techniques /* ROTATE EXEC */ /* Example: two iterations of wheel, six iterations */ /* of cog. On the first three iterations, "x < 2" */ /* is true. On the next three, it is false. */ trace L do x = 1 to 2 wheel: do 3 cog: if x < 2 then do true: end else do false: end end end done: Figure 47.
Programming Style and Techniques /********************************************************/ /* SAMPLE #1: A portion of CATMOUSE EXEC */ /* not divided into segments and written with no */ /* indentation, and no comments. This style is not */ /* recommended.
Programming Style and Techniques /********************************************************/ /* SAMPLE #2: A portion of CATMOUSE EXEC */ /* divided into segments and written with 'some' */ /* indentation and 'some' comments.
Programming Style and Techniques /********************************************************/ /* SAMPLE #3: A portion of CATMOUSE EXEC */ /* divided into segments and written with 'more' */ /* indentation and 'more' comments.
100 CICS TS for VSE/ESA: REXX Guide
Part 2. Reference © Copyright IBM Corp.
102 CICS TS for VSE/ESA: REXX Guide
Chapter 11. Introduction This introductory section: v Identifies the reference's purpose and audience v Explains how to use the reference v Gives an overview of product features v Explains how to read a syntax diagram. Who Should Read This Reference This reference describes the CICS Transaction Server for VSE/ESA REXX Guide and Reference Interpreter (hereafter referred to as the interpreter or language processor) and the REstructured eXtended eXecutor (called REXX) language.
Introduction Overview of Product Features The following list is the product features of REXX/CICS described in this section.
Introduction Dynamic Support for EXEC CICS Commands Support for most EXEC CICS API commands is included in REXX/CICS. This is a dynamic interface (no EXEC CICS command translation pre-processing step is needed). This support is provided through the addition of an ADDRESS CICS command environment.
Introduction SQL Interface REXX programs may contain SQL statements. These statements are interpreted and executed dynamically. The results of the SQL statements are placed into REXX variables for use within the REXX program. Programming Considerations To embed SQL statements withn a REXX exec, the host command environment must be changed, The ADDRESS instruction, followed by the name of the environment, is used to change the host command environment.
Introduction v Required items appear on the horizontal line (the main path). STATEMENT required_item v Optional items appear below the main path. STATEMENT optional_item v If you can choose from two or more items, they appear vertically, in a stack. If you must choose one of the items, one item of the stack appears on the main path. STATEMENT required_choice1 required_choice2 If choosing is optional, the entire stack appears below the main path.
Introduction 108 CICS TS for VSE/ESA: REXX Guide
Chapter 12. REXX General Concepts The REstructured eXtended eXecutor (REXX) language is particularly suitable for: v Command procedures v Application front ends v User-defined macros (such as editor subcommands) v User-defined XEDIT subcommands v Prototyping v Personal computing. REXX is a general purpose programming language like PL/I. REXX has the usual structured-programming instructions—IF, SELECT, DO WHILE, LEAVE, and so on—and a number of useful built-in functions.
REXX General Concepts v v v v Zero or more blanks (which are ignored) A sequence of tokens (see section “Tokens” on page 111) Zero or more blanks (again ignored) A semicolon (;) delimiter that may be implied by line-end, certain keywords, or the colon (:). Conceptually, each clause is scanned from left to right before processing, and the tokens composing it are identified.
REXX General Concepts You can avoid this type of problem by using concatenation for literal strings containing /* or */; line 2 would be: if substr(input,1,5) = '/' || '*123' You could comment out lines 2 and 3 correctly as follows: 01 parse pull input 02 /* if substr(input,1,5) = '/' || '*123' 03 then call process 04 */ dept = substr(input,32,5) For information about Double-Byte Character Set characters, see Appendix C, “Double-Byte Character Set (DBCS) Support,” on page 395 and the OPTIONS instruction o
REXX General Concepts Note: A hexadecimal string is not a representation of a number. Rather, it is an escape mechanism that lets a user describe a character in terms of its encoding (and, therefore, is machine-dependent). In EBCDIC, '40'X is the encoding for a blank. In every case, a string of the form '.....'x is simply an alternative to a straightforward string. In EBCDIC 'C1'x and 'A' are identical, as are '40'x and a blank, and must be treated identically.
REXX General Concepts If a symbol does not begin with a digit or a period, you can use it as a variable and can assign it a value. If you have not assigned it a value, its value is the characters of the symbol itself, translated to uppercase (that is, lowercase a–z to uppercase A–Z). Symbols that begin with a number or a period are constant symbols and cannot be assigned a value. One other form of symbol is allowed to support the representation of numbers in exponential format.
REXX General Concepts 345>=123 345 >=123 345 >= 123 345 > = 123 Some of these characters may not be available in all character sets, and, if this is the case, appropriate translations may be used. In particular, the vertical bar (|) or character is often shown as a split vertical bar. Throughout the language, the not character, ¬, is synonymous with the backslash (\). You can use the two characters interchangeably according to availability and personal preference.
REXX General Concepts Continuations One way to continue a clause onto the next line is to use the comma, which is referred to as the continuation character. The comma is functionally replaced by a blank, and, thus, no semicolon is implied. One or more comments can follow the continuation character before the end of the line. The continuation character cannot be used in the middle of a string or it will be processed as part of the string itself. The same situation holds true for comments.
REXX General Concepts blanks and comments. In addition, one or more blanks, where they occur in expressions but are not adjacent to another operator, also act as an operator. There are four types of operators: v Concatenation v Arithmetic v Comparison v Logical String Concatenation The concatenation operators combine two strings to form one string by appending the second string to the right-hand end of the first string. The concatenation may occur with or without an intervening blank.
REXX General Concepts Prefix − Same as the subtraction: 0 - number Prefix + Same as the addition: 0 + number. See Chapter 16, “Numbers and Arithmetic,” on page 217 for details about precision, the format of valid numbers, and the operation rules for arithmetic. Note that if an arithmetic result is shown in exponential notation, it is likely that rounding has occurred. Comparison The comparison operators compare two terms and return the value 1if the result of the comparison is true, or 0 otherwise.
REXX General Concepts >>= Strictly greater than or equal to \<<, ¬<< Strictly NOT less than <<= Strictly less than or equal to \>>, ¬>> Strictly NOT greater than Note: Throughout the language, the not character, ¬, is synonymous with the backslash (\). You can use the two characters interchangeably, according to availability and personal preference. The backslash can appear in the following operators: \ (prefix not), \=, \==, \<, \>, \<<, and \>>.
REXX General Concepts = > < (comparison operators) == >> << \= ¬= >< <> \> ¬> \< ¬< \== ¬== \>> ¬>> \<< ¬<< >= >>= <= <<= /= /== & (and) | && (or, exclusive or) Examples: Suppose the symbol A is a variable whose value is 3, DAY is a variable whose value is Monday, and other variables are uninitialized. Then: A+5 A-4*2 A/2 0.
REXX General Concepts Clauses and Instructions Clauses can be subdivided into the following types: Null Clauses A clause consisting only of blanks or comments or both is a null clause. It is completely ignored (except that if it includes a comment it is traced, if appropriate). Note: A null clause is not an instruction; for example, putting an extra semicolon after the THEN or ELSE in an IF instruction is not equivalent to using a dummy instruction (as it would be in PL/I).
REXX General Concepts Assignments and Symbols A variable is an object whose value can change during the running of a REXX program. The process of changing the value of a variable is called assigning a new value to it. The value of a variable is a single character string, of any length, that may contain any characters.
REXX General Concepts Simple Symbols A simple symbol does not contain any periods and does not start with a digit (0–9). By default, its value is the characters of the symbol (that is, translated to uppercase). If the symbol has been assigned a value, it names a variable and its value is the value of that variable. These are simple symbols: FRED Whatagoodidea? ?12 <.D.A.T.
REXX General Concepts where d0 is the uppercase form of the symbol s0, and v1 to vn are the values of the constant or simple symbols s1 through sn. Any of the symbols s1-sn can be null. The values v1-vn can also be null and can contain any characters (in particular, lowercase characters are not translated to uppercase, blanks are not removed, and periods have no special significance). Some examples follow in the form of a small extract from a REXX program: a=3 /* assigns '3' z=4 /* c='Fred' /* a.
REXX General Concepts pull amount name if datatype(amount)='CHAR' then leave total.name = total.name + amount end Note: You can always obtain the value that has been assigned to the whole collection of variables by using the stem. However, this is not the same as using a compound variable whose derived name is the same as the stem. For example: total. = 0 null = "" total.null = total.null + 5 say total. total.
REXX General Concepts The expression is evaluated, resulting in a character string (which may be the null string), which is then prepared as appropriate and submitted to the underlying system. Any part of the expression not to be evaluated should be enclosed in quotation marks. The environment then processes the command, which may have side-effects. It eventually returns control to the language processor, after setting a return code.
REXX General Concepts argument to the exec. For example: EDIT TEST.EXEC causes the REXX/CICS editor exec, CICEDIT, to start and TEST.EXEC, the argument, names the file to edit or create. All REXX/CICS transaction identifiers must have CICS definitions which associate them with the REXX/CICS main module, CICREXD. v Execs started using a CICS START command REXX/CICS execs may be started using the CICS START command.
REXX General Concepts REXX File System Execs can be stored as members in the VSAM-based REXX File System (RFS), provided with REXX/CICS, or in VSE librarian members with a member type of PROC. Note: If the file identifier you specified for invoking an exec does not include a file type extension, then only RFS file identifiers with a file type of EXEC are searched when you attempt to locate and issue the REXX exec.
REXX General Concepts v The USERID function returns a 1 to 8 character CICS user ID if the user is signed on. If the CICS user has not signed on and a default user has been specified for the CICS region (by the CICS Systems Programmer specifying DFLTUSER in the CICS startup parameters) then that value is used. Note: The default user shares REXX File System and REXX List System directories. v The STORAGE function, that allows a REXX user to display or modify the virtual storage of the CICS region.
REXX General Concepts Pseudo-conversational Transaction Support CICS pseudo-conversational support for REXX execs is supported though the use of the CICS RETURN TRANSID() command, by the REXX/CICS PSEUDO command (see section “PSEUDO” on page 362), and the SETSYS PSEUDO command (see section “SETSYS” on page 371).
REXX General Concepts 130 CICS TS for VSE/ESA: REXX Guide
Chapter 13. Keyword Instructions A keyword instruction is one or more clauses, the first of which starts with a keyword that identifies the instruction. Some keyword instructions affect the flow of control, while others provide services to the programmer. Some keyword instructions, like DO, can include nested instructions.
ADDRESS ADDRESS Purpose ADDRESS ; environment expression expression1 VALUE ADDRESS temporarily or permanently changes the destination of commands. Commands are strings sent to an external environment. You can send commands by specifying clauses consisting of only an expression or by using the ADDRESS instruction. The concept of alternative subcommand environments is described in section “Issuing Commands from a program” on page 82.
ADDRESS The two environment names are automatically saved across internal and external subroutine and function calls. See the CALL instruction (page “Purpose” on page 135) for more details. The address setting is the currently selected environment name. You can retrieve the current address setting by using the ADDRESS built-in function (see page 175). Chapter 13.
ARG ARG Purpose ARG ; template_list ARG retrieves the argument strings provided to a program or internal routine and assigns them to variables. It is a short form of the instruction: PARSE UPPER ARG ; template_list The template_list is often a single template but can be several templates separated by commas. If specified, each template is a list of symbols separated by blanks or patterns or both.
CALL CALL Purpose , CALL name OFF ON ; expression ERROR FAILURE HALT ERROR FAILURE NAME HALT trapname CALL calls a routine (if you specify name) or controls the trapping of certain conditions (if you specify ON or OFF). To control trapping, you specify OFF or ON and the condition you want to trap. OFF turns off the specified condition trap. ON turns on the specified condition trap. All information on condition traps is contained in Chapter 17, “Conditions and Condition Traps,” on page 225.
CALL The CALL then causes a branch to the routine called name, using exactly the same mechanism as function calls, see Chapter 14, “Functions,” on page 171. The search order is in the section on functions but briefly is as follows: Internal routines: These are sequences of instructions inside the same program, starting at the label that matches name in the CALL instruction. If you specify the routine name in quotation marks, then an internal routine is not considered for that search order.
CALL v The status of DO loops and other structures: Executing a SIGNAL while within a subroutine is safe because DO loops, and so forth, that were active when the subroutine was called are not ended. (But those currently active within the subroutine are ended.) v Trace action: After a subroutine is debugged, you can insert a TRACE Off at the beginning of it, and this does not affect the tracing of the caller.
DO DO Purpose DO ; repetitor END conditional ; name instruction repetitor: name=expri TO exprt BY exprb FOR exprf FOREVER exprr conditional: WHILE UNTIL exprw expru DO groups instructions together and optionally processes them repetitively. During repetitive execution, a control variable (name) can be stepped through some range of values. Syntax Notes: v The exprr, expri, exprb, exprt, and exprf options (if present) are any expressions that evaluate to a number.
DO Repetitive DO Loops If a DO instruction has a repetitor phrase or a conditional phrase or both, the group of instructions forms a repetitive DO loop. The instructions are processed according to the repetitor phrase, optionally modified by the conditional phrase. (See section “Conditional Phrases (WHILE and UNTIL)” on page 140). Simple Repetitive Loops: A simple repetitive loop is a repetitive DO loop in which the repetitor phrase is an expression that evaluates to a count of the iterations.
DO end /* /* /* /* 1.7 2.4 3.1 3.8 */ */ */ */ The control variable can be altered within the loop, and this may affect the iteration of the loop. Altering the value of the control variable is not usually considered good programming practice, though it may be appropriate in certain circumstances. Note that the end condition is tested at the start of each iteration (and after the control variable is stepped, on the second and subsequent iterations).
DO Note: Using the LEAVE or ITERATE instructions can also modify the execution of repetitive loops.
DROP DROP Purpose DROP name (name) ; DROP “unassigns” variables, that is, restores them to their original uninitialized state. If name is not enclosed in parentheses, it identifies a variable you want to drop and must be a symbol that is a valid variable name, separated from any other name by one or more blanks or comments. If parentheses enclose a single name, then its value is used as a subsidiary list of variables to drop.
EXIT EXIT Purpose EXIT ; expression EXIT leaves a program unconditionally. Optionally EXIT returns a character string to the caller. The program is stopped immediately, even if an internal routine is currently being run. If no internal routine is active, RETURN (see page “Purpose” on page 161) and EXIT are identical in their effect on the program that is being run.
IF IF Purpose IF expression THEN instruction ; ; ELSE instruction ; IF conditionally processes an instruction or group of instructions depending on the evaluation of the expression. The expression is evaluated and must result in 0 or 1. The instruction after the THEN is processed only if the result is 1 (true). If you specify an ELSE, the instruction after the ELSE is processed only if the result of the evaluation is 0 (false).
INTERPRET INTERPRET Purpose INTERPRET expression ; INTERPRET processes instructions that have been built dynamically by evaluating expression. The expression is evaluated and is then processed (interpreted) just as though the resulting string were a line inserted into the program (and bracketed by a DO; and an END;). Any instructions (including INTERPRET instructions) are allowed, but note that constructions such as DO...END and SELECT...END must be complete.
INTERPRET >O> >L> >O> Hello Kitty! "Hello Kitty" "!" "Hello Kitty!" Here, lines 3 and 4 set the variables used in line 5. Execution of line 5 then proceeds in two stages. First the string to be interpreted is built up, using a literal string, a variable (INDIRECT), and another literal string. The resulting pure character string is then interpreted, just as though it were actually part of the original program.
ITERATE ITERATE Purpose ITERATE ; name ITERATE alters the flow within a repetitive DO loop (that is, any DO construct other than that with a simple DO). Execution of the group of instructions stops, and control is passed to the DO instruction just as though the END clause had been encountered. The control variable (if any) is incremented and tested, as usual, and the group of instructions is processed again, unless the DO instruction ends the loop. The name is a symbol, taken as a constant.
LEAVE LEAVE Purpose LEAVE ; name LEAVE causes an immediate exit from one or more repetitive DO loops (that is, any DO construct other than a simple DO). Processing of the group of instructions is ended, and control is passed to the instruction following the END clause, just as though the END clause had been encountered and the termination condition had been met. However, on exit, the control variable (if any) will contain the value it had when the LEAVE instruction was processed.
NOP NOP Purpose NOP ; NOP is a dummy instruction that has no effect. It can be useful as the target of a THEN or ELSE clause: Example: Select when a=c then nop when a>c then say 'A > C' otherwise say 'A < C' end /* Do nothing */ Note: Putting an extra semicolon instead of the NOP would merely insert a null clause, which would be ignored. The second WHEN clause would be seen as the first instruction expected after the THEN, and would, therefore, be treated as a syntax error.
NUMERIC NUMERIC Purpose NUMERIC DIGITS ; expression1 SCIENTIFIC FORM ENGINEERING expression2 VALUE FUZZ expression3 NUMERIC changes the way in which a program carries out arithmetic operations. The options of this instruction are described in detail on pages 217-224, but in summary: NUMERIC DIGITS controls the precision to which arithmetic operations and arithmetic built-in functions are evaluated. If you omit expression1, the precision defaults to 9 digits.
OPTIONS OPTIONS Purpose OPTIONS expression ; OPTIONS passes special requests or parameters to the language processor. For example, these may be language processor options or perhaps define a special character set. The expression is evaluated, and the result is examined one word at a time. The language processor converts the words to uppercase. If the language processor recognizes the words, then they are obeyed.
PARSE PARSE Purpose PARSE UPPER ARG EXTERNAL LINEIN NUMERIC PULL SOURCE VALUE ; template_list WITH expression VAR name VERSION PARSE assigns data (from various sources) to one or more variables according to the rules of parsing. (See Chapter 15, “Parsing,” on page 203.) The template_list is often a single template but may be several templates separated by commas. If specified, each template is a list of symbols separated by blanks or patterns or both.
PARSE Example: Parse Numeric Var1 After this instruction, Var1 would be equal to: 9 0 SCIENTIFIC. See section “NUMERIC” on page 150 and the built-in functions in section “DIGITS” on page 183, and section “FORM” on page 185, and section “FUZZ” on page 186. PARSE PULL parses the next string from the external data queue. If the external data queue is empty, PARSE PULL reads a line from the default input stream (the user's terminal), and the program pauses, if necessary, until a line is complete.
PARSE PARSE VERSION parses information describing the language level and the date of the language processor. This information consists of five words delimited by blanks: 1. The string REXX370, signifying the 370 implementation. 2. The language level description (for example, 3.48). 3. The language processor release date (for example, 05 April 2000).
PROCEDURE PROCEDURE Purpose PROCEDURE ; EXPOSE name (name) PROCEDURE, within an internal routine (subroutine or function), protects variables by making them unknown to the instructions that follow it. After a RETURN instruction is processed, the original variables environment is restored and any variables used in the routine (that were not exposed) are dropped. (An exposed variable is one belonging to a caller of a routine that the PROCEDURE instruction has exposed.
PROCEDURE Example: /* This is the main REXX program */ j=1; z.1='a' call toft say j k m /* Displays "1 7 M" exit */ /* This is a subroutine */ toft: procedure expose j k z.j say j k z.j /* Displays "1 K a" k=7; m=3 /* Note: M is not exposed return */ */ Note that if Z.J in the EXPOSE list had been placed before J, the caller's value of J would not have been visible at that time, so Z.1 would not have been exposed. The variables in a subsidiary list are also exposed from left to right.
PROCEDURE Example: /* This is the main REXX program */ a.=11; i=13; j=15 i = i + 1 C.5 = 'FRED' call lucky7 say a. a.1 i j c. c.5 say 'You should see 11 7 14 15 C. FRED' exit lucky7:Procedure Expose i j a. c. /* This exposes I, J, and all variables whose /* names start with A. or C. A.1='7' /* This sets A.1 in the caller's /* environment, even if it did not /* previously exist.
PULL PULL Purpose PULL ; template_list PULL reads a string from the program stack. If the program stack is empty, PULL then tries reading a line from the current terminal input device. It is just a short form of the instruction: PARSE UPPER PULL ; template_list The current head-of-queue is read as one string. Without a template_list specified, no further action is taken (and the string is thus effectively discarded).
PUSH PUSH Purpose PUSH ; expression PUSH stacks the string resulting from the evaluation of expression LIFO (Last In, First Out) onto the external data queue. If you do not specify expression, a null string is stacked. Note: The REXX/CICS implementation of the external data queue is the program stack. The language processor reads a line from the program stack. If the program stack is empty, a terminal read occurs.
QUEUE QUEUE Purpose QUEUE ; expression QUEUE appends the string resulting from expression to the tail of the external data queue. That is, it is added FIFO (First In, First Out). If you do not specify expression, a null string is queued. Note: The REXX/CICS implementation of the external data queue is the program stack. The language processor reads a line from the program stack. If the program stack is empty, a terminal read occurs.
RETURN RETURN Purpose RETURN ; expression RETURN returns control (and possibly a result) from a REXX program or internal routine to the point of its invocation. If no internal routine (subroutine or function) is active, RETURN and EXIT are identical in their effect on the program that is being run, (see page “Purpose” on page 143.
SAY SAY Purpose SAY ; expression SAY writes a line to the default output stream (the terminal) so the user sees it displayed. The result of expression may be of any length. If you omit expression, the null string is written. You can use the SET TERMOUT command to redirect SAY output.
SELECT SELECT Purpose SELECT; WHEN expression THEN instruction ; OTHERWISE ; instruction END ; ; SELECT conditionally calls one of several alternative instructions. Each expression after a WHEN is evaluated in turn and must result in 0 or 1. If the result is 1, the instruction following the associated THEN (which may be a complex instruction such as IF, DO, or SELECT) is processed and control then passes to the END. If the result is 0, control passes to the next WHEN clause.
SIGNAL SIGNAL Purpose SIGNAL labelname ; expression VALUE OFF ERROR FAILURE HALT NOVALUE SYNTAX ON ERROR FAILURE HALT NOVALUE SYNTAX NAME trapname SIGNAL causes an unusual change in the flow of control (if you specify labelname or VALUE expression), or controls the trapping of certain conditions (if you specify ON or OFF). To control trapping, you specify OFF or ON and the condition you want to trap. OFF turns off the specified condition trap. ON turns on the specified condition trap.
SIGNAL The VALUE form of the SIGNAL instruction allows a branch to a label whose name is determined at the time of execution. This can safely effect a multi-way CALL (or function call) to internal routines because any DO loops, and so forth, in the calling routine are protected against termination by the call mechanism. Example: fred='PETE' call multiway fred, 7 .... .... exit Multiway: procedure arg label .
TRACE TRACE Purpose TRACE ; number Normal ? ! All Commands Error Failure Intermediates Labels Off Results Scan Or, alternatively: TRACE ; string symbol expression VALUE TRACE controls the tracing action (that is, how much is displayed to the user) during processing of a REXX program. (Tracing describes some or all of the clauses in a program, producing descriptions of clauses as they are processed.) TRACE is mainly used for debugging.
TRACE All Traces (that is, displays) all clauses before execution. Commands Traces all commands before execution. If the command results in an error or failure displays the return code from the command. Error Traces any command resulting in an error or failure from the command. 4 4 ,tracing also after execution, together with the return code Failure Traces any command resulting in a failure 4 after execution, together with the return code from the command. This is the same as the Normal option.
TRACE Using the ? prefix, therefore, switches you alternately in or out of interactive debug. (Because the language processor ignores any further TRACE statements in your program after you are in interactive debug, use CALL TRACE '?' to turn off interactive debug.) ! Inhibits host command execution. During regular execution, a TRACE instruction with a prefix of ! suspends execution of all subsequent host commands. For example, TRACE !C causes commands to be traced but not processed.
TRACE message when interactive debug is entered, an indication of a syntax error when in interactive debug, or the traceback clauses after a syntax error in the program (see below). >>> Identifies the result of an expression (for TRACE R) or the value assigned to a variable during parsing, or the value returned from a subroutine call. >.> Identifies the value “assigned” to a placeholder during parsing (see page 204).
UPPER UPPER Purpose This is a non-SAA instruction provided in REXX/CICS. UPPER variable ; UPPER translates the contents of one or more variables to uppercase. The variables are translated in sequence from left to right. The variable is a symbol, separated from any other variables by one or more blanks or comments. Specify only simple symbols and compound symbols. (See page 122.) Using this instruction is more convenient than repeatedly invoking the TRANSLATE built-in function.
Chapter 14. Functions A function is an internal, built-in, or external routine that returns a single result string. (A subroutine is a function that is an internal, built-in, or external routine that may or may not return a result and that is called with the CALL instruction.) Syntax A function call is a term in an expression that calls a routine that carries out some procedures and returns a string. This string replaces the function call in the continuing evaluation of the expression.
Functions instruction, various other status information (TRACE and NUMERIC settings and so forth) is saved too. See the CALL instruction (page “Purpose” on page 135) for details about this. You can use SIGNAL and CALL together to call an internal routine whose name is determined at the time of execution; this is known as a multi-way call (see page 165). If you are calling an internal routine as a function, you must specify an expression in any RETURN instruction to return from it.
Functions Internal routines are not used if the function name is given as a literal string (that is, specified in quotation marks); in this case the function must be built-in or external. This lets you usurp the name of, say, a built-in function to extend its capabilities, yet still be able to call the built-in function when needed. Example: /* This internal DATE function modifies the /* default for the DATE function to standard date.
Functions Built-in Functions REXX provides a rich set of built-in functions, including character manipulation, conversion, and information functions. Other built-in and external functions are generally available—see section “External Functions Provided in REXX/CICS” on page 200. The following are general notes on the built-in functions: v The parentheses in a function are always needed, even if no arguments are required. The first parenthesis must follow the name of the function with no space in between.
Functions ABBREV (Abbreviation) ABBREV(information,info ) ,length returns 1 if info is equal to the leading characters of information and the length of info is not less than length. Returns 0 if either of these conditions is not met. If you specify length, it must be a positive whole number or zero. The default for length is the number of characters in info.
Functions returns an argument string or information about the argument strings to a program or internal routine. If you do not specify n, the number of arguments passed to the program or internal routine is returned. If you specify only n, the nth argument string is returned. If the argument string does not exist, the null string is returned. The n must be a positive whole number. If you specify option, ARG tests for the existence of the nth argument string. The following are valid options.
Functions BITAND('12'x) BITAND('73'x,'27'x) BITAND('13'x,'5555'x) BITAND('13'x,'5555'x,'74'x) BITAND('pQrS',,'BF'x) -> -> -> -> -> '12'x '23'x '1155'x '1154'x 'pqrs' /* EBCDIC */ BITOR (Bit by Bit OR) BITOR(string1 ) , string2 ,pad returns a string composed of the two input strings logically inclusive-ORed together, bit by bit. (The encodings of the strings are used in the logical operation.) The length of the result is the length of the longer of the two strings.
Functions If binary_string is the null string, B2X returns a null string. If the number of binary digits in binary_string is not a multiple of four, then up to three 0 digits are added on the left before the conversion to make a total that is a multiple of four. Here are some examples: B2X('11000011') B2X('10111') B2X('101') B2X('1 1111 0000') -> -> -> -> 'C3' '17' '5' '1F0' You can combine B2X with the functions X2D and X2C to convert a binary number into other forms.
Functions v The instruction processed as a result of the condition trap (CALL or SIGNAL) v The status of the trapped condition. To select the information to return, use the following options. (Only the capitalized and highlighted letter is needed; all characters following it are ignored.) Condition name returns the name of the current trapped condition. Description returns any descriptive string associated with the current trapped condition. If no description is available, returns a null string.
Functions If string is null, returns 0. Here are some examples: C2D('09'X) C2D('81'X) C2D('FF81'X) C2D('') C2D('a') -> -> -> -> -> 9 129 65409 0 129 /* EBCDIC */ If you specify n, the string is taken as a signed number expressed in n characters. The number is positive if the leftmost bit is off, and negative, in two's complement notation, if the leftmost bit is on. In both cases, it is converted to a whole number, which may, therefore, be negative.
Functions Binary returns 1 if string contains only the characters 0 or 1 or both. C returns 1 if string is a mixed SBCS/DBCS string. Dbcs returns 1 if string is a DBCS-only string enclosed by SO and SI bytes. Lowercase returns 1 if string contains only characters from the range a–z. Mixed case returns 1 if string contains only characters from the ranges a–z and A–Z. Number returns 1 if string is a valid REXX number. Symbol returns 1 if string contains only characters that are valid in REXX symbols.
Functions base date, 1 January 0001, in the format: dddddd (no leading zeros or blanks). The expression DATE('B')//7 returns a number in the range 0–6 that corresponds to the current day of the week, where 0 is Monday and 6 is Sunday. Thus, this function can be used to determine the day of the week independent of the national language in which you are working.
Functions DBCS (Double-Byte Character Set Functions) The following are all part of DBCS processing functions. DBADJUST DBBRACKET DBCENTER DBCJUSTIFY DBLEFT DBRIGHT DBRLEFT DBRRIGHT DBTODBCS DBTOSBCS DBUNBRACKET DBVALIDATE DBWIDTH DELSTR (Delete String) DELSTR(string,n ) ,length returns string after deleting the substring that begins at the nth character and is of length characters.
Functions If you specify n, it is the length of the final result in characters; after conversion, the input string is sign-extended to the required length. If the number is too big to fit into n characters, then the result is truncated on the left. The n must be a positive whole number or zero. If you omit n, wholenumber must be a positive whole number or zero, and the result length is as needed. Therefore, the returned result has no leading '00'x characters.
Functions returns the REXX error message associated with error number n. The n must be in the range 0–99, and any other value is an error. Returns the null string if n is in the allowed range but is not a defined REXX error number. See Appendix A, “Error Numbers and Messages,” on page 379 for a complete description of error numbers and messages. Here are some examples: ERRORTEXT(16) ERRORTEXT(60) -> -> 'Label not found' '' EXTERNALS EXTERNALS() always returns a 0.
Functions The number is first rounded according to standard REXX rules, just as though the operation number+0 had been carried out. The result is precisely that of this operation if you specify only number. If you specify any other options, the number is formatted as follows. The before and after options describe how many characters are used for the integer and decimal parts of the result, respectively. If you omit either or both of these, the number of characters used for that part is as needed.
Functions INDEX POS is the preferred built-in function for obtaining the position of one string in another. See page 189 for a complete description. INDEX(haystack,needle ) ,start returns the character position of one string, needle, in another, haystack, or returns 0 if the string needle is not found or is a null string. By default the search starts at the first character of haystack (start has the value 1).
Functions LASTPOS (Last Position) LASTPOS(needle,haystack ) ,start returns the position of the last occurrence of one string, needle, in another, haystack. (See also the POS function.) Returns 0 if needle is the null string or is not found. By default the search starts at the last character of haystack and scans backward. You can override this by specifying start, the point at which the backward scan starts.
Functions , MAX( number ) returns the largest number from the list specified, formatted according to the current NUMERIC settings. Here are some examples: MAX(12,6,7,9) MAX(17.3,19,17.03) MAX(-7,-3,-4.3) MAX(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,MAX(20,21)) -> -> -> -> 12 19 -3 21 Implementation maximum: You can specify up to 20 numbers, and can nest calls to MAX if more arguments are needed.
Functions haystack. By default the search starts at the first character of haystack (that is, the value of start is 1). You can override this by specifying start (which must be a positive whole number), the point at which the search starts. Here are some examples: POS('day','Saturday') POS('x','abc def ghi') POS(' ','abc def ghi') POS(' ','abc def ghi',5) -> -> -> -> 6 0 4 8 QUEUED QUEUED() returns the number of lines remaining in the external data queue when the function is called.
Functions REVERSE REVERSE(string) returns string, swapped end for end. Here are some examples: REVERSE('ABc.') REVERSE('XYZ ') -> -> '.cBA' ' ZYX' RIGHT RIGHT(string,length ) ,pad returns a string of length length containing the rightmost length characters of string. The string returned is padded with pad characters (or truncated) on the left as needed. The default pad character is a blank. The length must be a positive whole number or zero.
Functions Here are some examples: SPACE('abc def ') SPACE(' abc def',3) SPACE('abc def ',1) SPACE('abc def ',0) SPACE('abc def ',2,'+') -> -> -> -> -> 'abc def' 'abc def' 'abc def' 'abcdef' 'abc++def' STORAGE See section “External Functions Provided in REXX/CICS” on page 200. STRIP STRIP(string ) , option ,char returns string with leading or trailing characters or both removed, based on the option you specify. The following are valid options.
Functions SUBWORD SUBWORD(string,n ) ,length returns the substring of string that starts at the nth word, and is up to length blank-delimited words. The n must be a positive whole number. If you omit length, it defaults to the number of remaining words in string. The returned string never has leading or trailing blanks, but includes all blanks between the selected words.
Functions (described later) was started or reset. The number has no leading zeros or blanks, and the setting of NUMERIC DIGITS does not affect the number. The fractional part always has six digits. Hours returns up to two characters giving the number of hours since midnight in the format: hh (no leading zeros or blanks, except for a result of 0). Long returns time in the format: hh:mm:ss.uuuuuu (uuuuuu is the fraction of seconds, in microseconds).
Functions TRACE TRACE( ) option returns trace actions currently in effect and, optionally, alters the setting. If you specify option, it selects the trace setting. It must be one of the valid prefixes ? or ! or one of the alphabetic character options associated with the TRACE instruction (that is, starting with A, C, E, F, I, L, N, O, R, or S) or both. Unlike the TRACE instruction, the TRACE function alters the trace action even if interactive debug is active.
Functions decimal point. If you specify n, it must be a positive whole number or zero. The number is first rounded according to standard REXX rules, just as though the operation number+0 had been carried out. The number is then truncated to n decimal places (or trailing zeros are added if needed to make up the specified length). The result is never in exponential form. Here are some examples: TRUNC(12.3) TRUNC(127.09782,3) TRUNC(127.1,3) TRUNC(127,2) -> -> -> -> 12 127.097 127.100 127.
Functions /* REXX EXEC - ASSIGN FIND VALUE OF FRED */ FRED = 7 'RLS VARPUT FRED \USERS\userid\' X = VALUE(FRED,,RLS) SAY X /* X now = 7 */ Notes: 1. If the VALUE function refers to an uninitialized REXX variable then the default value of the variable is always returned; the NOVALUE condition is not raised. A reference to RLS variables never raises NOVALUE. 2.
Functions WORDINDEX WORDINDEX(string,n) returns the position of the first character in the nth blank-delimited word in string or returns 0 if fewer than n words are in string. The n must be a positive whole number. Here are some examples: WORDINDEX('Now is the time',3) WORDINDEX('Now is the time',6) -> -> 8 0 WORDLENGTH WORDLENGTH(string,n) returns the length of the nth blank-delimited word in string or returns 0 if fewer than n words are in string. The n must be a positive whole number.
Functions and end. The default value for start is '00'x, and the default value for end is 'FF'x. If start is greater than end, the values wrap from 'FF'x to '00'x. If specified, start and end must be single characters.
Functions X2D(hexstring ) ,n returns the decimal representation of hexstring. The hexstring is a string of hexadecimal characters. If the result cannot be expressed as a whole number, an error results. That is, the result must not have more digits than the current setting of NUMERIC DIGITS. You can optionally include blanks in hexstring (at byte boundaries only, not leading or trailing) to aid readability; they are ignored. If hexstring is null, the function returns 0.
Functions If you specify data, after the old value has been retrieved storage starting at address is overwritten with data (the length argument has no effect on this). Note: The STORAGE function can operate on storage above the 16MB line. Warning: The STORAGE function, which allows a REXX user to display and/or modify the virtual storage of the CICS region, can only be successfully invoked from an authorized exec or by an authorized user.
Functions 202 CICS TS for VSE/ESA: REXX Guide
Chapter 15. Parsing General Description The parsing instructions are ARG, PARSE, and PULL (see section “ARG” on page 134, section “PARSE” on page 152, and section “PULL” on page 158). The data to parse is a source string. Parsing splits up the data in a source string and assigns pieces of it into the variables named in a template. A template is a model specifying how to split the source string. The simplest kind of template consists of only a list of variable names.
Parsing The PARSE VAR instruction is similar to PARSE VALUE except that the source string to parse is always a variable. In PARSE VAR, the name of the variable containing the source string follows the keywords PARSE VAR. In the next example, the variable stars contains the source string. The template is star1 star2 star3.
Parsing /* Alternative to period as placeholder stars='Arcturus Betelgeuse Sirius Rigil' parse var stars drop junk brightest rest */ /* brightest='Sirius' */ A placeholder saves the overhead of unneeded variables. Templates Containing String Patterns A string pattern matches characters in the source string to indicate where to split it. A string pattern can be a: Literal string pattern One or more characters within quotation marks.
Parsing Templates Containing Positional (Numeric) Patterns A positional pattern is a number that identifies the character position at which to split data in the source string. The number must be a whole number. An absolute positional pattern is v A number with no plus (+) or minus (-) sign preceding it or with an equal sign (=) preceding it v A variable in parentheses with an equal sign before the left parenthesis. (See page 209 for details on variable positional patterns.
Parsing A relative positional pattern is a number with a plus (+) or minus (-) sign preceding it. (It can also be a variable within parentheses, with a plus (+) or minus (-) sign preceding the left parenthesis; for details see section “Parsing with Variable Patterns” on page 209.) The number specifies the relative character position at which to split the source string.
Parsing │ 2 │ │ 2 │ └──┬──┘ │ │var1 4 │ │ 1 │ │var2 2│ │ 4 var3 5│ │11 var4 │ │var1 +2 │ │ ─3 │ │var2 +1│ │+2 var3 +1│ │+6 var4 │ └───┬────┘ └──┬───┘ └───┬───┘ └────┬─────┘ └───┬────┘ │ │ │ │ │ Start at 2. Non─ Go to 1. inclusive (4─3=1) stopping point is 4 (2+2=4). Non─ Go to 4 Go to 11 inclusive (2+2=4). (5+6=11). stopping Non─inclusive point is stopping point 2 (1+1=2). is 5 (4+1=5).
Parsing v 'R E' v ' X' v ' X' The variable var1 receives 'R'; var2 receives 'E'. Both var3 and var4 receive ' X' (with a blank before the X) because each is the only variable in its section of the template. (For details on treatment of blanks, see page 204.) Parsing with Variable Patterns You may want to specify a pattern by using the value of a variable instead of a fixed string or number. You do this by placing the name of the variable in parentheses. This is a variable reference.
Parsing Converts alphabetic characters to uppercase before parsing Maintains alphabetic characters in case entered ARG PARSE ARG PARSE UPPER ARG PARSE UPPER EXTERNAL PARSE EXTERNAL PARSE UPPER NUMERIC PARSE NUMERIC PULL PARSE PULL PARSE UPPER PULL PARSE UPPER SOURCE PARSE SOURCE PARSE UPPER VALUE PARSE VALUE PARSE UPPER VAR PARSE VAR PARSE UPPER VERSION PARSE VERSION The ARG instruction is simply a short form of PARSE UPPER ARG.
Parsing When total=7 then new='purple' When total=9 then new='orange' When total=10 then new='green' Otherwise new=var1 END Say new; exit /* entered duplicates */ /* Displays: "purple" */ Err: say 'Input error--color is not "red" or "blue" or "yellow"'; exit ARG converts alphabetic characters to uppercase before parsing. An example of ARG with the arguments in the CALL to a subroutine is in section “Parsing Multiple Strings.
Parsing This instruction consists of the keywords PARSE ARG and three comma-separated templates. (For an ARG instruction, the source strings to parse come from arguments you specify when you call a program or CALL a subroutine or function.) Each comma is an instruction to the parser to move on to the next string.
Parsing Parsing with DBCS Characters Parsing with DBCS characters generally follows the same rules as parsing with SBCS characters. Literal strings and symbols can contain DBCS characters, but numbers must be in SBCS characters. See “PARSE” on page 398 for examples of DBCS parsing. Details of Steps in Parsing The three figures that follow are to help you understand the concept of parsing. Please note that the figures do not include error cases.
Parsing ┌────────────────────────────────────────┐ │ ┌────────────────────────────────┐ │ │START │ │ │Token is first one in template. │ │ │Length=length(source string) │ │ │Match start=1. Match end=1. │ │ └─────────┬──────────────────────┘ │ ┌────────── │ │ │ │ │ ┌───────────────────┐yes ┌────────────────────┐ │ │ │End of template? ├─── │Parsing complete. │ │ │ └─────────┬─────────┘ └────────────────────┘ │ │ no │ │ ┌───────────────────┐ │ │ │CALL Find Next │ │ │ │ Pattern.
Parsing ┌────────────────────────────────────────────────┐ │ ┌─────────────┐ ┌────────────────────────────────┐ │ │Start: │yes │String start=match end. │ │ │End of ├─── │Match start=length + 1. │ │ │template? │ │Match end=length + 1. Return. │ │ └─────┬───────┘ └────────────────────────────────┘ │ no │ ┌─────────────┐ ┌────────────────────────────────┐ │ │Token period │yes │ │ │ │or variable? ├─── │Step to next token.
┌─────────────────────────┐ ┌────────────────────────┐ │Start: Match end <= │no │ │ │ string start? ├─── │String end=match start. │ └───────────┬─────────────┘ └────────────────────────┘ yes ┌─────────────────────────┐ │String end=length + 1. │ └───────────┬─────────────┘ ┌──────────────────────────────────────────────────────────────────────┐ │Substring=substr(source string,string start,(string end─string start))│ │Token=previous pattern.
Chapter 16. Numbers and Arithmetic REXX defines the usual arithmetic operations (addition, subtraction, multiplication, and division) in as natural a way as possible. What this really means is that the rules followed are those that are conventionally taught in schools and colleges.
Numbers and Arithmetic Definition A precise definition of the arithmetic facilities of the REXX language is given here. Numbers A number in REXX is a character string that includes one or more decimal digits, with an optional decimal point. (See section “Exponential Notation” on page 222 for an extension of this definition.) The decimal point may be embedded in the number, or may be a prefix or suffix.
Numbers and Arithmetic an operation, when a number is rounded to the required precision.) The operation is then carried out under up to double that precision, as described under the individual operations that follow. When the operation is completed, the result is rounded if necessary to the precision specified by the NUMERIC DIGITS instruction. Rounding is done in the traditional manner.
Numbers and Arithmetic The result is then rounded, counting from the first significant digit of the result, to the current setting of NUMERIC DIGITS. Division For the division: yyy / xxxxx the following steps are taken: First the number yyy is extended with zeros on the right until it is larger than the number xxxxx (with note being taken of the change in the power of ten that this implies). Thus, in this example, yyy might become yyy00. Traditional long division then takes place.
Numbers and Arithmetic all bits have now been inspected, the initial calculation is complete; otherwise the accumulator is squared and the next bit is inspected for multiplication. When the initial calculation is complete, the temporary result is divided into 1 if the power was negative. The multiplications and division are done under the arithmetic operation rules, using a precision of DIGITS + L + 1 digits.
Numbers and Arithmetic Numeric Comparisons The comparison operators are listed in section “Comparison” on page 117. You can use any of these for comparing numeric strings. However, you should not use ==, \==, ¬==, >>, \>>, ¬>>, <<, \<<, and ¬<< for comparing numbers because leading and trailing blanks and leading zeros are significant with these operators. A comparison of numeric values is effected by subtracting the two numbers (calculating the difference) and then comparing the result with 0.
Numbers and Arithmetic For both large and small numbers some form of exponential notation is useful, both to make long numbers more readable, and to make execution possible in extreme cases. In addition, exponential notation is used whenever the “simple” form would give misleading information. For example: numeric digits 5 say 54321*54321 would display 2950800000 in long form. This is clearly misleading, and so the result is expressed as 2.9508E+9 instead.
Numbers and Arithmetic /* after the instruction */ Numeric form scientific 123.45 * 1e11 -> 1.2345E+13 /* after the instruction */ Numeric form engineering 123.45 * 1e11 -> 12.345E+12 Numeric Information To determine the current settings of the NUMERIC options, use the built-in functions DIGITS, FORM, and FUZZ. These functions return the current settings of NUMERIC DIGITS, NUMERIC FORM, and NUMERIC FUZZ, respectively.
Chapter 17. Conditions and Condition Traps A condition is a specified event or state that CALL ON or SIGNAL ON can trap. A condition trap can modify the flow of execution in a REXX program. Condition traps are turned on or off using the ON or OFF subkeywords of the SIGNAL and CALL instructions (see section “CALL” on page 135 and section “SIGNAL” on page 164). CALL SIGNAL OFF condition ON condition ; NAME trapname condition and trapname are single symbols that are taken as constants.
Conditions and Condition Traps /* The following does not raise NOVALUE. */ signal on novalue a.=0 say a.z say 'NOVALUE is not raised.' exit novalue: say 'NOVALUE is raised.' You can specify this condition only for SIGNAL ON. SYNTAX raised if any language processing error is detected while the program is running. This includes all kinds of processing errors, including true syntax errors and “run-time” errors, such as attempting an arithmetic operation on nonnumeric terms.
Conditions and Condition Traps Because these conditions (ERROR, FAILURE, and HALT) can arise during execution of an INTERPRET instruction, execution of the INTERPRET may be interrupted and later resumed if CALL ON was used. As the condition is raised, and before the CALL is made, the condition trap is put into a delayed state. This state persists until the RETURN from the CALL, or until an explicit CALL (or SIGNAL) ON (or OFF) is made for the condition.
Conditions and Condition Traps Condition Information When any condition is trapped and causes a SIGNAL or CALL, this becomes the current trapped condition, and certain condition information associated with it is recorded. You can inspect this information by using the CONDITION built-in function (see page 178).
Conditions and Condition Traps code following the SYNTAX label may PARSE SOURCE to find the source of the data, then call an editor to edit the source file positioned at the line in error. Note that in this case you may have to run the program again before any changes made in the editor can take effect.
230 CICS TS for VSE/ESA: REXX Guide
Chapter 18. REXX/CICS Text Editor REXX/CICS provides a general purpose CICS-based text editor, patterned after VM/CMS XEDIT. The editor is provided so that execs and data can be created, updated, and viewed from within the CICS environment. The REXX/CICS editor includes several prefix commands (for example: C, CC, M, MM, B, A, F, P) in common with the XEDIT editor. To use the editor, enter EDIT.
Text Editor Screen Format When you call the editor without a profile, the default screen definition is displayed as shown in the following figure.
Text Editor line just below it for input. You can also append a number to the end of the prefix command. This acts as a replication factor. If the number “5” is appended to the “I”, five lines are opened for input instead of one.
Text Editor Example: /* Macro to alter the setting of the REXX/CICS editor */ ADDRESS EDITSVR 'SET NUMBERS OFF' 'SET CURLINE 10' 'SET MSGLINE 2' 'SET CMDLINE TOP' 'SET CASE MIXED IGNORE' This example addresses the editor command environment and alters the editor settings.
Text Editor Notes: 1 If arguments is not specified, any previously defined arguments are deleted. ARGS stores the default parameters to be passed to the program being edited when invoked with the text editor EXEC command. Operands arguments specifies the parameter string to be passed. If you do not specify arguments, any previously defined arguments are deleted.
Text Editor Return Codes 0 Normal return Example 'BOTTOM' This example scrolls to the bottom of the file. CANCEL CANCEL CANCEL ends the current edit session without saving the changes. Return Codes 0 210 Normal return Request failed Example 'CANCEL' This example quits the current editor session unconditionally, without saving any file changes. Notes 1. CANCEL lets you exit the editor without saving changes, and without any warning messages that changes have been made. 2.
Text Editor Return Codes 0 202 Normal request Invalid operand Example 'CASE MIXED RESPECT' This example sets the case to MIXED and the sensitivity to RESPECT. For more information on sensitivity, see the FIND command, section “FIND” on page 242. CHANGE CHANGE /string1/string2/ ALL CHANGE changes a string in the file. Operands string1 specifies the string being replaced. string2 specifies the string that replaces string1.
Text Editor BOTTOM displays the command line on the bottom line of the screen. Return Codes 0 202 Normal return Invalid operand Example 'CMDLINE TOP' This example places the command line on the second line of the screen. CTLCHAR CTLCHAR character OFF ESCAPE PROTECT NOPROTECT OFF CTLCHAR sets a control character's function. Operands character specifies a control character to use.
Text Editor Operands number specifies the screen line number. Return Codes 0 202 Normal return Invalid operand Example 'CURLINE 3' This example sets the current display line to screen line 3. Note The current line is displayed at the screen line number specified in this command. However, the current line cannot be displayed on line 1 because line 1 is reserved for the title line. DISPLAY DISPLAY DISPLAY shows the current edit screen.
Text Editor Example 'DOWN 5' This example scrolls forward through the file five lines. EDIT NONAME EDIT fileid lib.sublib(mem.type) LIB ( MACRO macroname EDIT opens a new edit session. Operands fileid specifies the file ID of the file to be created or edited. lib.sublib(mem.type) specifies a VSE Librarian sublibrary and member to be edited. LIB is a keyword that follows a VSE Librarian sublibrary member name when a sublibrary member is being edited.
Text Editor 3. The default user profile macro that the editor tries to call is CICEPROF. The CICEPROF macro creates an ISPF/PDF like environment. A second profile macro, named CICXPROF, is provided. CICXPROF creates a VM/CMS XEDIT like environment. 4. If a file ID or VSE Librarian sublibrary member name is not specified, an RFS file with the special name, NONAME, is created.
Text Editor Operands fileid specifies the file ID of the file. If you do not specify fileid, the file is saved as the default file ID. Return Codes 0 202 204 207 210 Normal return Invalid operand Not authorized Insufficient space in file pool Request failed Example 'FILE' This example saves the current file being edited, using the current file ID specification for the edit session. The current file ID is initially taken from the file ID specified on the edit command, when an edit session is created.
Text Editor 2. The search begins at the current line and continues downward until BOTTOM OF DATA is reached, or a match is made. If BOTTOM OF DATA is reached without a match, then the current line remains where it was before the FIND was processed, rather than making BOTTOM OF DATA the current line. FORWARD 1 FORward n * FORWARD scrolls forward toward the end of the file for a specified number of screen displays. Operands n specifies the number of screen displays you want to scroll forward.
Text Editor GETLIB lib.sublib(mem.type) GETLIB imports a member from a VSE Librarian sublibrary into the current edit session. The file is inserted after the current line. Operands lib.sublib(mem.type) specifies a VSE Librarian sublibrary and member name. Return Codes 0 203 204 210 Normal return File not found Not authorized Request failed Example 'GETLIB MYSLIB.PROJ1(MEM1.PROC)' This example gets member MEM1.PROC from sublibrary MYSLIB.
Text Editor 210 Request failed Example 'JOIN' This example joins the line that the cursor is on with the line immediately following it. LEFT 1 LEFT number LEFT scrolls left in the file. Operands number specifies the number of characters to scroll. If you do not specify number, the screen scrolls left one character in the file. If you specify 0 for number, the file scrolls to the far left side.
Text Editor Operands prefix specifies any standard prefix (such a C, CC, M, MM, B, A) that is entered during an edit session. Return Codes 0 202 Normal return Invalid operand Example 'LPREFIX D' This example causes the deletion of the current file line. Note LPREFIX is provided to let you use the prefix commands from within edit macros. MACRO MACRO fileid MACRO calls a macro. Operands fileid specifies the file ID of the macro you want to run.
Text Editor Operands number displays the message line on the corresponding screen line. OFF does not display the message line. INFO displays messages in the header line. Return Codes 0 202 Normal return Invalid operand Example 'MSGLINE 2' This example places the message line on screen line 2. NULLS NULLS ON OFF NULLS controls whether the fields on the screen will be written with trailing blanks or trailing nulls.
Text Editor Return Codes 0 202 Normal return Invalid operand Example 'NUMBERS ON' This example displays sequential numbers in the prefix area. Note Line number sequencing is not done on the data within the edit session, but are pseudo line numbers associated with the file lines during the edit session only. PFKEY (1) PFkey number text Notes: 1 If text is not specified, the PF key is processed. PFKEY sets or processes a program function (PF) key.
Text Editor BOTTOM displays the PF key line on the bottom line of the screen. number specifies the screen line number. OFF removes the PF key from the display screen. Return Codes 0 202 Normal return Invalid operand Example 'PFKLINE BOTTOM' This example places the PF key line on the bottom line of the screen. QQUIT QQuit QQUIT ends the current edit session without saving changes.
Text Editor CMDLINE displays the current setting of the command line. For more information see the Text Editor command, section “CMDLINE” on page 237. COLUMN displays the starting column in the file that is displayed on the screen. DIR displays the directory that is associated with the file. FILEID displays the name of the file being edited. MSGLINE displays the current setting of the message line. For more information see the Text Editor command, section “MSGLINE” on page 246.
Text Editor Note When the current file has been changed, the editor does not let you exit until either a save is done or you enter the QQUIT command. RESERVED REServed line HIGH NOHIGH OFF text RESERVED reserves a line on the screen for your output. Operands line specifies the line that is reserved and the text is displayed. HIGH is a keyword specifying that the text is highlighted. NOHIGH is a keyword specifying that the text is the usual intensity.
Text Editor 1 RIght number RIGHT scrolls right in the file. Operands number specifies the number of characters to scroll. If you do not specify number, the screen scrolls to the right one character in the file. If you specify 0 for number, the file scrolls to the far right. Return Codes 0 202 Normal return Invalid operand Example 'RIGHT 20' This example scrolls 20 characters to the right in the file.
Text Editor A SORT 1 * num D fromcol tocol SORT sorts the lines from the current line on down. Operands * specifies that all the lines from the current line to the end of the file are sorted. num specifies that the lines from the current line for the value of num are sorted. A specifies that the lines are sorted in ascending order. (This is the default.) D specifies that the lines are sorted in descending order. fromcol specifies that the lines are sorted on data beginning in this column.
Text Editor STRIP STRIP strips the trailing blanks off all file lines. Return Codes 0 Normal return Example 'STRIP' This example strips all trailing blanks of each file line. SYNONYM SYNONYM syn command SYNONYM assigns a command action to any other valid command. Operands syn specifies any valid command that executes the command action for which it is a synonym. command specifies any valid command.
Text Editor Operands column specifies the last column you want to keep. Return Codes 0 202 Normal return Invalid operand Example 'TRUNC 72' This example truncates all lines in the file to a length of 72 characters. Note This command is useful when you are working with data sets that have sequence numbers that require removing. The editor does not currently have support for placing or maintaining sequence numbers in a file.
256 CICS TS for VSE/ESA: REXX Guide
Chapter 19. REXX/CICS File System The REXX File System (RFS) is provided for the storage of text files and execs created with the REXX/CICS editor, and by execs using RFS commands and data imported from outside of the REXX File System. RFS was modeled after the Advanced Interactive Executive (AIX) and OS/2 file systems. The concept of directories is the main idea taken from these environments. Partitioning each directory into several subdirectories will give a hierarchical organization.
File System Example: POOL1: File Pool Root Directory TEST1.EXEC File USERS\ Subdirectory USER1\ Subdirectory TEST2.EXEC File DOCS\ Subdirectory TEST3.DOCUMENT File USER2\ Subdirectory LETTER.DOCUMENT File PROJECT1\ Subdirectory PROD1.EXEC File DATA\ Subdirectory PROD1.DATA File \ WORK:\ TEST1.DATA CHARTS\ CHART1.DATA CHART2.DATA File Pool and Root Directory File Subdirectory File File This example shows two file pools (POOL1 and WORK). File pool POOL1 contains a file (TEST1.
File System The exec name is fully qualified, using the directory ID of each directory in the search before the search of each respective directory is performed. The fully qualified names are as follows: 'POOL1:\USERS\USER1\EXECS\TEST2.EXEC' 'POOL1:\TEST2.EXEC' 'POOL1:\USERS\USER1\TEST2.EXEC' When the REXX/CICS command EXEC is invoked, all three directories above are searched resulting in REXX/CICS finding the exec in the POOL1:\USERS\USER1 directory. If TEST2.
File System AUTH authorizes access to RFS directories. Operands dirid specifies a REXX File System directory identifier. This is partially or fully qualified. See the CD command, “CD” on page 321, for more information. PRIVATE specifies that only the owner of the directory has read/write access to the files. This is the default. PUBLICR specifies that any user has read-only access to the files in the directory. PUBLICW specifies that any user has read/write access to the files in the directory.
File System Return Codes See the RFS command, section “RFS” on page 363. Example 'CKFILE POOL1:\USERS\USER1\TEST.EXEC' This example checks for a file called TEST.EXEC in the existing directory POOL1:\USERS\USER1. COPY RFS COPY fileid1 fileid2 COPY copies a file. Operands fileid1 specifies the source file identifier, it may be a fully or partially qualified directory and file identifier.
File System DISKR reads records from an RFS file. Operands fileid specifies the file identifier. stem. specifies the name of a stem. (A stem must end in a period.) See section “Stems” on page 123 for more information. The default stem is DATA.. Return Codes See the RFS command, section “RFS” on page 363. Example 'RFS DISKR POOL1:\USERS\USER1\TEST.DATA DATA.' This example stores the entire contents of the RFS file POOL1:\USERS\USER1\TEST.DATA in the DATA. REXX compound variable. Note DATA.
File System GETDIR returns a list of the contents of the current or specified directory into the specified REXX array. Operands stem. specifies the name of a stem. (A stem must end in a period.) See section “Stems” on page 123 for more information. dirid specifies a REXX File System directory level identifier. This is partially or fully qualified. See the CD command, section “CD” on page 321, for more information. Return Codes See the RFS command, section “RFS” on page 363. Example 'RFS GETDIR DIRDOC.
File System Example 'RFS RDIR POOL1:\USERS\USER1\DOCS' This example deletes a directory called DOCS in the existing directory POOL1:\USERS\USER1. RENAME RFS RENAME fileid1 fileid2 RENAME renames an RFS file to a new name. Operands fileid1 specifies the source file identifier, it may be a fully or partially qualified directory and file identifier. fileid2 specifies the source target file identifier, it may be a fully or partially qualified directory and file identifier.
File System USER=USER1 - DIRECTORY=\USERS\USER1 CMD FILENAME FILETYPE ATTRIBUTES RECORDS SIZE TEST1 EXEC FILE 11 1 TEST2 EXEC FILE 5 1 DATE TIME 1994/03/27 10:30:29 1994/03/27 10:31:04 COMMAND ===> F1=HELP F2=REFRESH F3=END F7=UP 18 F8=DOWN 18 F11=EDIT F12=CANCEL Your user ID is displayed in the upper left hand corner. The current directory is displayed beside your user ID. The rest of the screen looks very similar to a REXX/CICS editor session.
File System CD When you type CD from the command line use the following syntax: CD dirid CD changes the current directory. Operands dirid specifies a REXX File System directory level identifier. This is partially or fully qualified. See the CD command, section “CD” on page 321, for more information. Example 'CD TEMP' This example changes the current directory to TEMP and updates the FLST display.
File System DELETE When you type DELETE on the FLST command column use the following syntax: DELETE DELETE deletes a file. When you type DELETE from the command line use the following syntax: DELETE fileid Operands fileid specifies the file ID of the file the command acts on. Example 'DELETE TEST1.EXEC' This example, executed from the command line, deletes file TEST1.EXEC.
File System Operands parameter specifies the parameters passed to the exec as arguments. Example 'EXEC / PARMS' This example, executed on the command column next to TEST3.EXEC, executes exec TEST3.EXEC and passes PARMS as the argument. When you type EXEC from the command line use the following syntax: EXEC fileid parameter Operands fileid specifies the file ID of the file the command acts on. parameter specifies the parameters passed to the exec as arguments.
File System Note See Chapter 19, “REXX/CICS File System,” on page 257 for more information about the REXX File System. MACRO When you type MACRO from the command line use the following syntax: MACRO fileid MACRO calls a macro. Operands fileid specifies the file ID of the macro you want to run. If this file ID includes a file type suffix, then an attempt is made to call an exec with that suffix. Otherwise, an attempt is made to call an exec whose suffix is EXEC.
File System Note If you specify text, the PF key is set with the text. If you do not specify text, the PF key is processed. REFRESH When you type REFRESH on the FLST command column use the following syntax: REFRESH REFRESH refreshes the file list. Example 'REFRESH' This example refreshes the file list for the member of the current working directory. RENAME When you type RENAME on the FLST command column use the following syntax: RENAME / fileid RENAME renames a file.
File System SORT When you type SORT from the command line use the following syntax: DT SORT FN FT AT RC SZ SORT sorts the file list. Operands DT specifies sorting the files by date/time. (This is the default.) FN specifies sorting the files by file name. FT specifies sorting the files by file type. AT specifies sorting the files by attribute. RC specifies sorting the file by number of records. SZ specifies sorting the files by size.
File System Example 'SYNONYM DISCARD RFS DELETE' This example makes DISCARD equivalent to the RFS command DELETE. UP When you type UP from the command line use the following syntax: UP n UP scrolls up one or more lines. Operands n specifies the number of lines to be scrolled up. Example 'UP 5' This example scrolls backward through the list five lines. FLST Return Codes FLST uses the standard return codes for the REXX/CICS File System, except where it is specified differently.
Chapter 20. REXX/CICS List System REXX/CICS provides a facility for maintaining tables or lists of data in virtual storage. This facility is called the REXX List System (RLS). This system provides management of lists of temporary system and user information. The externals for accessing the RLS are the RLS and CLD commands, instead of RFS and CD commands used with the REXX File System. Also, the RLS is for data only, not for execs. Directories and Lists RLS has one root directory.
List System The following example shows RLS directories and lists. Example: \ TEST1.DATA USERS\ USER1\ TEST2.DATA DOCS\ TEST3.DOCUMENT USER2\ LETTER.DOCUMENT PROJECT1\ PROD1.INFO DATA\ PROD1.DATA \ TEST1.DATA CHARTS\ CHART1.DATA CHART2.DATA Root Directory File Subdirectory Subdirectory File Subdirectory File Subdirectory File Subdirectory File Subdirectory File Root Directory File Subdirectory File File This example shows a list directory structure. The root directory contains a file (TEST1.
List System RLS commands Under the RLS command environment you issue commands to interface with RLS. If you set the command environment to RLS, you should not specify RLS in front of RLS commands. Example: 'RLS READ \USERS\USER1\TEST.DATA DATA.' This example reads the contents of the RLS list \USERS\USER1\TEST.DATA into the DATA. REXX compound variable. The syntax for the RLS commands follow. CKDIR RLS CKDIR dirid CKDIR checks for an existing RLS directory level.
List System *QUEUE* RLS LPULL varname queid LPULL pulls a record from the top of the RLS queue. Operands varname specifies a simple REXX variable name. It does not end in a period, distinguishing a variable name from a stem name. *QUEUE* is a keyword specifying the special default name. queid specifies the identifier for a special type of RLS list accessed by LPULL, LPUSH, or LQUEUE. Return Codes See the RLS command, section “RLS” on page 366.
List System LQUEUE *QUEUE* RLS LQUEUE varname queid LQUEUE adds a record to the end of the RLS queue (FIFO). Operands varname specifies a simple REXX variable name. It does not end in a period, distinguishing a variable name from a stem name. *QUEUE* is a keyword specifying the special default name. queid specifies the identifier for a special type of RLS list accessed by LPULL, LPUSH, or LQUEUE. Return Codes See to the RLS command, section “RLS” on page 366.
List System Operands listname specifies the list identifier. stem. specifies the name of a stem. (A stem must end in a period.) See section “Stems” on page 123 for more information. The default stem is DATA.. UPD is a keyword that enqueues on a file for update. Return Codes See the RLS command, section “RLS” on page 366. Example 'RLS READ \USERS\USER1\TEST.DATA DATA.' This example stores the entire contents of the RLS list \USERS\USER1\TEST.DATA in the DATA. REXX compound variable. Note DATA.
List System Operands varname specifies a simple REXX variable name. It does not end in a period, distinguishing a variable name from a stem name. dirid specifies a REXX List System directory level identifier. This is partially or fully qualified. See the CLD command, section “CLD” on page 325, for more information. Return Codes See the RLS command, section “RLS” on page 366.
List System stem. specifies the name of a stem. (A stem must end in a period.) See section “Stems” on page 123 for more information. The default stem is DATA.. Return Codes See the RLS command, section “RLS” on page 366. Example 'RLS WRITE \USERS\USER1\TEST.DATA DATA.' This example stores the entire contents of the REXX compound variable DATA. into the RLS list \USERS\USER1\TEST.DATA. Note Set DATA.0 to the number of records to be written to the list.
Chapter 21. REXX/CICS Command Definition The REXX/CICS Command Definition Facility provides a means of easily defining (or redefining) REXX commands and environments. Background One of the greatest strengths of REXX is its extendibility. You can write your own external functions, subroutines, or commands to extend the capabilities of the REXX language. Because of this, one of the natural uses for REXX is as an Application Integration platform.
Command Definition authorized user to use DEFSCMD to change command definitions that affect other REXX/CICS users. See section “DEFCMD” on page 332 for more information on the DEFCMD command and section “DEFSCMD” on page 335 for more information on the DEFSCMD command. Command Arguments Passed to REXX Programs When a REXX/CICS command is written in REXX and that command is used, the REXX program (defined by DEFCMD or DEFSCMD) is either invoked or awakened (from a WAITREQ induced "sleep").
Command Definition Entry Specifications when DEFCMD CICSLINK is specified: When the code for the command program gets control by an EXEC CICS LINK, the CICS Commarea contains the CICPARMS control block. Before the program returns to the caller, it should place the return code it wants reflected into the CICPARMS RETCODE field. CICPARMS Control Block The following table shows the CICPARMS control block for mapping passed parameters to assembler routines. Table 3.
Command Definition Non-REXX Language Interfaces REXX/CICS makes it possible to transparently convert a REXX process to a non-REXX process. To do this requires that non-REXX command routines should be able to access REXX variables in the REXX exec that issued the command to be processed. The routine used to accomplish this is called CICGETV and must be linkedited with your command routine, and called as is described below.
Chapter 22. REXX/CICS DB2 Interface The REXX/CICS DB2 Interface provides a means of executing SQL from a REXX exec. The SQL are prepared and executed dynamically. The REXX/CICS DB2 interface provides the results of the SQL in REXX predefined variables. The REXX/CICS DB2 interface supports DB2 V7.1 and above. This chapter explains how to use the interface to DB2 from REXX/CICS. If you need more information about SQL, refer to the DB2 SQL Reference.
DB2 Interface ADDRESS EXECSQL "statement" "statement" . . . SQL can exist on more than one line. Each part of the statement is enclosed in quotes and a comma delimits additional statement text as follows: ADDRESS EXECSQL "SQL text", "additional text", . . . "final text" The following rules apply to embedded SQL: v You can pass the following SQL directly to the EXECSQL command environment: ALTER CREATE COMMENT ON DELETE DROP EXPLAIN GRANT INSERT LABEL ON LOCK REVOKE SELECT SET CURRENT SQLID UPDATE.
DB2 Interface v Host variables are not allowed within the SQL. Instead, you can use REXX variables to pass input data to the EXECSQL environment. The REXX variables are not embedded within quotes. The output from the EXECSQL environment is provided in REXX predefined variables (see section “Receiving the Results”). v When you code a SQL SELECT statement, you cannot use the INTO clause. Instead, the REXX/CICS DB2 returns the requested items in compound variables with stem names equal to the DB2 column names.
DB2 Interface SQLCOLn.1 Some SELECT functions such as CURRENT SQLID, MAX, and AVG are not associated with a particular DB2 column. To view the results you must reference column name SQLCOLn.1. The n begins with, and is incremented by one, for each function included in the SELECT statement. All columns represented by SQLCOLn appear in the SQL_COLNAME compound variable.
DB2 Interface Exit rc end /*---------------------------------------*/ /* Display the members of the department */ /*---------------------------------------*/ Say 'Here are the members of Department' dept Do n = 1 to lastname.0 Say lastname.n phoneno.n End Exit Chapter 22.
DB2 Interface 290 CICS TS for VSE/ESA: REXX Guide
Chapter 23. REXX/CICS High-level Client/Server Support Client/Server computing has become very popular in the Information Processing industry. Some of the advantages of client/server computing are: v The ability to effectively integrate the strengths of mainframes, mini-computers, and new cost-effective workstations, in a transparent fashion. v The ability to incrementally scale the size of computer's systems, up or down (right-sizing).
High-level Client/Server Support v Because REXX/CICS allows REXX clients and servers to be recoded in non-REXX languages, performance intensive parts of an application system can be selectively rewritten, if needed. The FLST and EDIT commands that REXX/CICS provides are examples of client/server environments.
High-level Client/Server Support REXX/CICS Server Exec Example /* EXAMPLE REXX/CICS SERVER1 EXEC */ TRACE 'O' /* turn off source tracing */ /*----------------------------------------*/ /* Loop waiting on requests from clients */ /*----------------------------------------*/ Do Forever 'WAITREQ' parse var request cmd varname Select When request = 'COMMAND1' then CALL command1 When request = 'COMMAND2' then CALL command2 When request = 'STOP' then CALL stop_server Otherwise End /* Select */ End /* Do Forever
High-level Client/Server Support 294 CICS TS for VSE/ESA: REXX Guide
Chapter 24. REXX/CICS Panel Facility Facility The REXX panel facility provides the REXX programmer with simple tools and commands for panel definition and for panel input/output to 3270 type terminals. The panel facility allows easy definition of panels using any editor. The requirement is that the panel source definition file should be in the REXX File System (RFS) before it is further processed.
Panel Facility mail_city = 'DALLAS'; /* prefill the most likely response for city/state */ mail_state = 'TX'; mail_zip = ''; do forever; 'panel send applican cursor(lname)'; if rc > 0 then call error_routine; 'panel receive applican'; /* pseudo-conversational this would be separate */ if pan.aid = 'PF3' | pan.aid = 'PF12' then leave; if pan.aid = 'ENTER' & pan.rea = 124 then iterate; if pan.aid = 'CLEAR' | substr(pan.
Panel Facility characters are re-activated. Certain keyword combinations are incompatible and are not allowed while others which may seem meaningless are allowed. For example, INVISIBLE and color. This may be useful when the field attribute is changed dynamically within a REXX program (the invisible field can be made visible which makes color meaningful). The characteristics of the .DEFINE verb follow. It must start on the first column, followed by a space, and capitalized.
Panel Facility ! & Defcolor unprotect bright Variable identifier Operands char specifies the control character being defined. VAriable defines a REXX variable identifier control character. Variable identifier control characters are used to associate Panel Facility control characters with REXX variable names. More than one variable control character can be defined at one time. Following the VARIABLE keyword may be a list of variable names (variable) or a single stem name (stem.).
Panel Facility Notes: 1. When you do not specify a default color, the color is based on the field type and intensity values: protect/normal displays blue, protect/bright displays white, unprotect/normal displays green, and unprotect/bright displays red. 2. If any field on a panel has explicitly specified a color (including DEFCOLOR), all bright fields with DEFCOLOR or no color specified are displayed white and all normal fields with DEFCOLOR or no color specified are displayed green.
Panel Facility The panel layout is close to what you see, with the exception of the control characters and the imbedded variables which are not shown when the panel is displayed. A field typed on the third line after the .PANEL starting at column ten is positioned on the terminal screen third line, column ten. The characteristics of the .PANEL verb follow. v It must start in the first column, followed by a space, and capitalized. v It must have a panel name on the same line as .
Panel Facility .PANEL panel_name protect_cc skip_cc variable_pair text variable_cc unprotect_cc field_length .PANEL variable_cc variable_pair Operands panel_name specifies the panel being defined. It must be one to eight characters in length and follow the rules for REXX File System file names. (See Chapter 19, “REXX/CICS File System,” on page 257, for more information.) Note: The panel_name must be the same as the RFS file name. The complete RFS file name should be panel_name.PANSRC.
Panel Facility The characteristics of the PANEL command follow. v All the arguments or keywords are not meaningful or valid for all commands. v The last panel command in a REXX exec is the END command. This releases any storage held by previous panel commands. This command needs no other operands. v Only the fields with associated variables can have their attributes changed dynamically. v A panel object file is created for the panel that is being displayed if one does not exist.
Panel Facility NORmal BRight INVisible NOJustify GReen RED BLUe TUrquoise WHite YEllow PInk DEfcolor BLInk REVerse UNDerline NULls PAd LEft RIght ( ) NUMeric CUrsor BLAnks char MDT Operands Send is the panel command that sends a panel. Receive is the panel command that receives a panel. Converse is the panel command that sends a panel and waits for operator input. Test is the panel command that displays a panel.
Panel Facility the field. The field list must be enclosed with parenthesis. Only the attributes stated are changed and the other attributes default to what was statically defined. A field defined originally as RED and UNDERLINE remains underlined if only blue is stated dynamically. ALarm (specified for SEND and CONVERSE only) sounds the bell when displaying panel. (The default is no alarm). NOErase (specified for SEND and CONVERSE only) do not erase the screen before displaying this one.
Panel Facility Notes: 1. When you do not specify a default color, the color is based on the field type and intensity values: protect/normal displays blue, protect/bright displays white, unprotect/normal displays green, and unprotect/bright displays red. 2. If any field on a panel has explicitly specified a color (including DEFCOLOR), all bright fields with DEFCOLOR or no color specified are displayed white and all normal fields with DEFCOLOR or no color specified are displayed green.
Panel Facility OPID MSRE STRF TRIG PA1 PA2 PA3 PF1 PF2 PF3 PF4 PF5 PF6 PF7 PF8 PF9 PF10 PF11 PF12 PF13 PF14 PF15 PF16 PF17 PF18 PF19 PF20 PF21 PF22 PF23 PF24 OPERATOR ID MAGNETIC READER STRUCTURE FIELD TRIGGER PAN.CURS Position of cursor in last panel input. This is in the form of row column separated by a blank. For example, '10 5' would be row 10 and column 5. The row and column values are absolute to the start of the screen and are unaffected by the POSITION() keyword. PAN.
Panel Facility Return Codes 4 Warning. Panel facility continues processing. Processing stops for other return code values. 8 Programmer error 10 Programmer error, PAN.REA contains more information to help determine the cause of the error. See section “State Codes and Input Codes” on page 308 for more information. 12 CICS command error; the CICS EIBRESP is returned in the panel reason code.
Panel Facility 117 Variable value was too long and was truncated to fit output field 118 Text field was truncated. Check to see if explicit length did not force a subsequent field to overlay another field. 119 Bad or missing panel command. It should be SEND, RECEIVE, CONVERSE, TEST, or END. 122 A modified field was received but it had no corresponding input field definition. 124 Empty received buffer. Clear, ENTER, and the PA keys will cause this.
Panel Facility 06 07 08 09 10 11 12 Numeric extended highlight (blink/reverse/underline) MDT Cursor Pad() Variable Drop State codes State codes for 20xx location codes: 01 panel commands (send/receive/converse/...) 02 File() 03 Cursor() 04 Position() 05 Alarm 06 Noerase 07 Keyboard lock (lockkb/freekb) 08 Clrinput 09 Attribute 10 field type (protect/skip/unprotect) 11 color (red/blue/green/...
Panel Facility State Codes State codes for 12xx location codes: 01 panel name 02 protect/skip field 03 unprotect field 04 text within a protect/skip field 05 (not implemented yet) 06 explicit input field length number 07 unprotect variable 08 protect/skip variable Input codes Input codes for 12xx location codes: 01 Plain displayable text 02 Explicit length number 03 Protect field control character 04 Unprotect field control character 05 Variable control character 07 End of panel 08 Invalid or unknown inpu
Panel Facility Example 2 .DEFINE > prot green .DEFINE < unprot underline white .DEFINE + var service. .DEFINE % skip turq .PANEL service > Panel service &disp_date &companyname % &salutation % Tab the cursor to the type of service wanted and press the ENTER key. <+> Itemized tax preparation <+> Non-itemized tax preparation <+> Query return status <+> Show calendar <+> Exit Example 3 .DEFINE # protect bright .DEFINE + protect A panel to display a static message without erasing previous panel.
Panel Facility Example 4 .DEFINE ) protect bright .DEFINE + drop .DEFINE & var msg. A panel to display output dynamic messages. .PANEL msgbox2 )+-------------------------------------------+# )| |# )| & |# )| & |# )| |# )+-------------------------------------------+# Example 5 .DEFINE .DEFINE .DEFINE .DEFINE .DEFINE .DEFINE .PANEL > Panel > skip blue skip green right var center_days. var right_days. VAR left_days.
Panel Facility 'PANEL SEND SIGNON' CLR_INP_FIELDS PATH_NAME , 'CURSOR(' CURS_NAME ')' ATTR_STRING IF RC > 4 THEN /* more than a warning */ SIGNAL ERROR /* clean up and exit */ 'PANEL RECEIVE SIGNON ' IF RC > 4 THEN SIGNAL ERROR /* clean up and exit */ ITERATE /* redisplay panel */ CLR_INP_FIELDS = '' /* display input fields with variable values */ IF &lnot;SEARCH(ACCOUNT_NUM) THEN /* search for account number */ DO; MESSAGE = ' Account Number not found, Please re-ENTER Number' CURS_NAME = 'ACCOUNT_NUM' /*
Panel Facility END; /* select */ END; /* do forever */ EXIT IF SYMBOL('ACCOUNT.
Panel Facility NUM_OF_DAYS.2 = 29; ELSE NUM_OF_DAYS.2 = 28; FIRST_WEEKDAY = (TOT_DAYS+1) // 7; FIRST_WEEKDAY_SAVE = FIRST_WEEKDAY; DISP_CENTER_MON = MONTH_NAME.MONTH; /* center display month name */ CENTER_DAYS. = ''; /* null out all unused month days */ /* starting at the first weekday of the month fill in center month */ DO I = FIRST_WEEKDAY+1 TO NUM_OF_DAYS.MONTH + FIRST_WEEKDAY ; CENTER_DAYS.
Panel Facility LEFT_MONTH = 12; ELSE LEFT_MONTH = MONTH - 1; FIRST_WEEKDAY = (TOT_DAYS - NUM_OF_DAYS.LEFT_MONTH +1) // 7; DISP_LEFT_MON = MONTH_NAME.LEFT_MONTH; LEFT_DAYS. = ''; DO I = FIRST_WEEKDAY+1 TO NUM_OF_DAYS.LEFT_MONTH + FIRST_WEEKDAY ; LEFT_DAYS.I = I - FIRST_WEEKDAY; END; END; /* if pan.aid = 'pf7' */ ELSE DO; TOT_DAYS = TOT_DAYS + NUM_OF_DAYS.
Panel Facility (SUBSTR(DATE_SAVE,7,2)+FIRST_WEEKDAY_SAVE); ATTR_STRING = 'ATTRIB(' CUR_DAY_FIELD 'RED )' ; END; END; /* select */ 'PANEL RECEIVE CALENDAR' END; /* do forever loop */ ERROR: SAY 'RETURN CODE ' RC SAY 'REA CODE ' PAN.REA SAY 'LOC CODE ' PAN.LOC EXIT; EXIT_ROUTINE: 'PANEL END'; SENDE; EXIT; each definition needs to be in a separate RFS file. ****************************************************** Chapter 24.
318 CICS TS for VSE/ESA: REXX Guide
Chapter 25. REXX/CICS Commands This chapter provides you with detailed reference information for all REXX/CICS commands. Return code information for all commands is returned after command execution in the special REXX variable RC. You can use all the commands in this chapter with the command environment name REXXCICS. This is also the default. However, depending on how you define the command, you can use a more specific environment name (such as CICS) instead.
Commands AUTHUSER Note: This is an authorized command. ; AUTHUSER userid AUTHUSER authorizes a list of user IDs. Operands userid is a CICS signon user ID that becomes REXX/CICS authorized. Return Codes 0 2602 2621 2642 Normal return Invalid operand or operand missing Specified user ID invalid length Error storing user ID Example 'AUTHUSER USER2 SYSPGMR' This example makes USER2 and SYSPGMR REXX/CICS authorized users. Notes 1.
Commands CD CD dirid CD changes the RFS file system directory. Operands dirid specifies a partial or full REXX File System directory that becomes the new current working directory for you. If dirid is not specified, the current working directory is retrieved and placed in the REXX special variable RESULT, instead of changing the current working directory. A full directory ID is in the form: poolid:\dirid1\...
Commands for execs.
Commands CEDA CEDA RDO_Command Executes a CEDA command for resource definition online (RDO). Operands RDO_Command specifies a command string passed as input to the CEDA transaction program. Return Codes n 0 -101 specifies the return code passed back by CICS if an error is detected Normal return Invalid command Any warning or error messages are placed in the variable CEDATOUT. The results of the execution, if any, are placed in the variable CEDAEOUT.
Commands CEMT CEMT master_term_cmd CEMT executes a CICS master terminal command from REXX. Operands master_term_cmd specifies a command string passed as input to the CEMT transaction program. Return Codes n 0 -101 specifies the return code passed back by CICS if an error is detected Normal return Invalid command Any warning or error messages are placed in the variable CEMTTOUT. The results of the execution, if any, are placed in the variable CEMTEOUT.
Commands CLD CLD dirid CLD changes your current RLS list directory. Operands dirid specifies a partial or full REXX List System directory that becomes the new current working directory for you. If dirid is not specified, the current working directory is retrieved and placed into the REXX variable RESULT, instead of changing the current working directory. A full directory ID starts with a slash and is in the form: \dirid1\...
Commands CONVTMAP CONVTMAP lib.sublib(mem.type) rfs_fileid CONVTMAP reads a VSE Librarian sublibrary member and converts a DSECT (created by a previously assembled BMS map) into a structure, and stores the result in a REXX File System file. The BMS map used as input to CONVTMAP must be in assembler language format. The resulting output file is formatted as a REXX file structure. Operands lib.sublib(mem.type) specifies a VSE Librarian sublibrary member.
Commands COPYR2S Note: This is an authorized command. COPYR2S source_vname * stor_anchor offset length struct_vname fieldname struct_name fieldname COPYR2S copies REXX variable contents to GETMAINed storage. Operands source_vname specifies the REXX variable containing the value copied to the previously GETMAINed area. Note: This value should be in quotes so that substitution does not occur. * specifies that all the REXX variables are copied.
Commands Return Codes 0 2002 2021 2022 2023 2025 2026 2027 2028 2029 Normal return Invalid operand Invalid structure definition Invalid variable structure definition Field name not found Failure processing GETVAR request Invalid numeric input RFS read error Invalid offset Invalid length value Examples /* Needed if entering example from the REXXTRY utility */ 'PSEUDO OFF' 'CICS GETMAIN SET(WORKANC) LENGTH(200)'/* get 200 bytes of working storage */ VAR1 = '00000000'x /* set a REXX variable with 4 bytes of
Commands COPYS2R Note: This is an authorized command. COPYS2R stor_anchor vname * offset length struct_vname fieldname struct_name fieldname COPYS2R copies data from GETMAINed storage to a REXX variable. Operands stor_anchor specifies the REXX variable containing the anchor for the target storage area that was GETMAINed earlier. This anchor consists of four bytes, containing the address of the earlier GETMAINed storage. specifies that all the REXX variables are copied.
Commands Return Codes 0 2102 2121 2122 2123 2125 2126 2127 2128 2129 Normal return Invalid operand Invalid structure definition Invalid variable structure definition Field name not found Failure processing GETVAR request Invalid numeric input RFS read error Invalid offset Invalid length value Example var1 = '' /* set REXX variable VAR1 to null */ struct1 = 'flda 4 fldb 2 fldc 3 fldd 8 flde 5' 'COPYS2R WORKANC VAR1 STRUCT1 FLDC' This example copies three bytes of data from positions 7 through 9 of the ea
Commands C2S C2S client_rexx_varname server_rexx_varname C2S copies a client REXX variable to a server REXX variable. Operands client_rexx_varname specifies the client REXX variable to copy from. server_rexx_varname is an optional name that specifies the server REXX variable to copy into. If it is not specified, it defaults to the same as the client_rexx_varname.
Commands DEFCMD DEFCMD etarget ecmdnm etarget * itarget icmdnm itarget * = = pgmname CICS_loadmod execname ( CLEAR ( CICSLINK CICSLOAD REXX AUTH DEFCMD defines (or redefines) REXX user commands. Operands etarget is the 1 to 8 character name of the external target environment you used in a REXX exec issuing this command. This is the external environment name that you directed the command string to.
Commands CICSLOAD is a keyword indicating that the processing agent is a CICS program that is loaded by an EXEC CICSLOAD. REXX is a keyword indicating that the processing agent for this REXX command is a REXX exec that operates as a command server. AUTH Note: This is an authorized option. is a keyword indicating that this is an authorized REXX/CICS command.
Commands from the REXX user (programmer), a command can be quickly written in REXX and later transparently rewritten in another language, if it becomes performance critical.
Commands DEFSCMD Note: This is an authorized command. DEFSCMD etarget ecmdnm etarget * * * itarget icmdnm itarget * = = pgmname CICS_loadmod execname ( CLEAR ( CICSLINK CICSLOAD REXX AUTH DEFSCMD defines (or redefines) REXX system commands. Operands etarget is the name of the external target environment you used in a REXX exec issuing this command. This is the external environment name that you directed the command string to.
Commands CICSLINK is a keyword indicating that the processing agent for the defined REXX command is a standard CICS program that is called by an EXEC CICS LINK. CICSLOAD is a keyword indicating that the processing agent is a CICS program that is loaded by an EXEC CICSLOAD. REXX is a keyword indicating that the processing agent for this REXX command is a REXX exec that operates as a command server. AUTH is a keyword indicating that this is an authorized REXX/CICS command.
Commands 5. REXX commands can be written in REXX. These REXX commands in turn call other REXX commands which are written in REXX, in a building block fashion. Since DEFSCMD hides the implementation detail from the REXX user (programmer), a command can be quickly written in REXX and later transparently rewritten in another language, if it becomes performance critical. Chapter 25.
Commands DEFTRNID Note: This is an authorized command. DEFTRNID trnid execname CLEAR DEFTRNID is a region-wide authorized command that can be used to define the name of an exec to be invoked for a particular CICS transaction identifier. Operands trnid specifies a one to four character CICS transaction ID. execname specifies a 1 to 17 character REXX/CICS exec name, in the form: filename.filetype if it is in the REXX File System.
Commands DIR DIR dirid ( stem. DIR displays the current directory contents or optionally returns the directory contents in a REXX compound variable. Operands dirid specifies the partial or full REXX File System directory that is displayed. If you omit this, then the current directory is displayed. stem. specifies the name of a stem. (A stem must end in a period.) Stem.0 contains the number of elements in the entry. (Refer to section “Stems” on page 123 for more information.
Commands EDIT NONAME EDIT fileid lib.sublib(mem.type) LIB ( MACRO macroname EDIT opens a new edit session. Operands NONAME a file ID is not specified. This is the default. fileid specifies the file ID of the file to be created or edited. lib.sublib(mem.type) specifies a VSE Librarian sublibrary and member to be edited. LIB is a keyword that follows a VSE Librarian sublibrary member name when a sublibrary member is being edited.
Commands EXEC EXEC execid args EXEC calls a REXX exec at a lower level (as a nested exec). All variables for this new exec are kept separate from the higher level exec, which is suspended until the nested exec ends. Operands execid specifies the 1 to 17 character identifier of the exec. args specifies the argument string being passed to the called exec.
Commands EXECDROP Note: This is an authorized command. MEM EXECDROP AUTHClib AUTHElib PROClib name member ( RFS LIB EXECDROP removes an EXECLOADed exec from virtual storage. Operands AUTHClib indicates that member was loaded from an authorized command sublibrary. AUTHElib indicates that member was loaded from an authorized exec sublibrary. LIB indicates that a VSE Librarian sublibrary and member has been specified.
Commands Note If a partial directory ID is given, it is temporarily appended to the end of the current working directory value to get a fully qualified directory ID. Chapter 25.
Commands EXECIO EXECIO lines * READ tsqname WRITE tsqname stem. varname recno EXECIO performs file input/output to a CICS temporary storage queue. Operands lines specifies the number of lines to read or write. An asterisk (*) is a special case that is specified for READ operations only, and indicates that the file is read from the target line (or line 1 if no target line is specified) to the end of the file. READ reads one or more records from a CICS temporary storage queue (TSQ).
Commands 2. If a stem is specified for a READ operation (and a stem should be specified if more than one record is read), the actual number of records read is placed into stem.0. 3. Use the CICS-supplied CEBR transaction to browse temporary storage queues. For example, enter: CEBR QUEUE1 to look at the queue created above. 4. CEBR provides PUT and GET functions that you can use to copy between external files and CICS temporary storage queues. Chapter 25.
Commands EXECLOAD Note: This is an authorized command. MEM EXECLOAD AUTHClib AUTHElib PROClib name member ( RFS LIB EXECLOAD loads an exec into virtual storage. Operands AUTHClib indicates that member must be loaded from an authorized command sublibrary. AUTHElib indicates that member must be loaded from an authorized exec sublibrary. LIB indicates that a VSE Librarian sublibrary and member has been specified. MEM indicates that a member name has been specified.
Commands Example 'EXECLOAD POOL1:\USERS\USER2\TEST.EXEC (RFS' This example loads the exec TEST.EXEC from RFS into storage. Subsequent calls of TEXT.EXEC will use the loaded copy. Notes 1. If an exec is loaded into virtual storage, it is automatically shared by all users. 2. If an EXECLOAD is performed to replace an in-storage exec with a newer copy, a shadow of previous copies is kept in virtual storage until all active execs based on these copies end. This is accomplished by a use count. Chapter 25.
Commands EXECMAP EXECMAP EXECMAP returns the sublibraries and members, the number of users, the descriptor table start (in hex), and the amount of storage required of the execs that have been loaded using EXECLOAD. Return Codes 0 1623 Normal return EXECLOAD directory not found Example 'EXECMAP' If the exec POOL1:\USERS\USER1\TEST.EXEC had been EXECLOADed then this display would result. EXEC name TEST.
Commands EXPORT EXPORT rfs_fileid lib.sublib(mem.type) EXPORT exports an RFS file to a VSE Librarian sublibrary member. Operands rfs_fileid specifies a fully qualified REXX File System file ID. lib.sublib(mem.type) specifies a VSE Librarian sublibrary and member.
Commands FILEPOOL Note: This is an authorized command. FILEPOOL DEFINE poolid dirid fileid ( USER FORMAT poolid ADD poolid fileid FILEPOOL performs RFS file pool administration activities. Operands DEFINE defines a new RFS file pool. poolid specifies the name of the target file pool. dirid specifies the CICS file identifier of the file pool directory. fileid specifies the CICS file identifier of the VSAM file for the file pool.
Commands Example 'FILEPOOL DEFINE POOL1 REXXDIR1 REXXLIB1 (USER' This example defines file pool POOL1 and tells RFS the CICS file definition to use is REXXLIB1. It also indicates to the FILEPOOL FORMAT command to issue an RFS MKDIR to build the \USERS directory. Note This is an authorized command, performed by a REXX/CICS administrator or systems programmer. Chapter 25.
Commands FLST FLST dirid FLST calls the file list utility to work with the files. Operands dirid specifies an optional full or partial directory ID that a file list is displayed. If you do not specify dirid, it defaults to the current working directory. Return Codes FLST returns the return code given by RFS. Example 'FLST' This example displays the file list for the member of the current working directory. Notes 1. The default user profile macro that the FLST tries to call is EXEC ID FLSTPROF.
Commands GETVERS GETVERS GETVERS retrieves the current REXX/CICS, program name, version, and compile time information, and places it into the REXX variable VERSION. The returned information is in the form: VxRyMmmmm mm/dd/yy hh.mm, where: x specifies the REXX/CICS Version number. y specifies the REXX/CICS Release number. mm/dd/yy specifies the compile date for the REXX/CICS base program. hh.mm specifies the compile time for the REXX/CICS base program.
Commands HELP HELP search_term HELP browses or searches this book (the IBM REXX Development System for CICS/ TS for VSE/ESA) online. Operands search_term specifies the string you want located.
Commands IMPORT IMPORT lib.sublib(mem.type) rfs_fileid IMPORT imports a VSE Librarian sublibrary member to an RFS file. Operands lib.sublib(mem.type) specifies a VSE Librarian sublibrary and member. rfs_fileid specifies a fully qualified REXX File System file ID.
Commands LISTCMD LISTCMD envname cmdname LISTCMD lists REXX command definition information (previously specified by DEFCMD). Operands envname specifies the name of the command environment defined using DEFCMD or DEFSCMD. cmdname specifies the name of a command specified in DEFCMD or DEFSCMD. Return Codes 0 821 822 Normal return Invalid environment name Invalid command name Example 'LISTCMD EDITSVR MYCMD' This example returns the information defined in DEFCMD for the subcommand MYCMD.
Commands LISTCLIB LISTCLIB stem. LISTCLIB displays the names of the authorized command libraries to the terminal or to a specified stem array, if a stem has been specified. The libraries are displayed in their search order. Operands stem. specifies the name of a stem. (A stem must end in a period.) The information returned is the name of each VSE Librarian sublibrary specified on the last SETSYS AUTHCLIB command.
Commands LISTELIB LISTELIB stem. LISTELIB displays the names of the authorized exec libraries to the terminal or to a specified stem array, if a stem has been specified. The libraries are displayed in their search order. Operands stem. specifies the name of a stem. (A stem must end in a period.) The information returned is the name of each VSE Librarian sublibrary specified on the last SETSYS AUTHELIB command.
Commands LISTPOOL LISTPOOL stem. LISTPOOL displays RFS file pool information to the terminal or to a specified stem array, if a stem has been specified. Operands stem. specifies the name of a stem. (A stem must end in a period.) Refer to section “Stems” on page 123 for more information. Three columns of information are returned: v the pool ID v the DLBL of the first file in the file pool v whether or not it contains a user's directory.
Commands LISTTRNID Note: This is an authorized command. LISTTRNID LISTTRNID lists the current transaction ID definitions created by the DEFTRNID command. Return Codes 0 2325 Normal return Error retrieving trantable information Example 'LISTTRNID' The CICSTART exec defines the default transactions and their EXEC names. The resulting display is: TRNID EXEC name REXX CICRXTRY EDIT CICEDIT FLST CICFLST End of Transaction table list.
Commands PATH ; PATH dirid lib.sublib PATH defines the search path for REXX execs. Operands dirid specifies one or more fully qualified REXX File System directories that are searched when you are attempting to locate an exec to be executed. A full RFS directory ID starts with a pool ID and is in the form: POOL1:\dirid1\...\diridn When more than one directory ID is specified, a blank is used to separate them. lib.sublib specifies one or more VSE Librarian sublibraries.
Commands PSEUDO PSEUDO ON OFF PSEUDO turns the pseudo-conversational mode on or off. Operands ON enables automatic pseudo-conversational support so that when the next REXX PULL instruction or REXX/CICS WAITREAD command is encountered in the current exec, instead of a conversational terminal read occurring immediately, an EXEC CICS RETURN TRANSID is used to suspend the exec until terminal input occurs, and then the terminal read occurs.
Commands RFS PRIVATE RFS AUTH dirid PUBLICR PUBLICW SECURED CKDIR dirid CKFILE fileid COPY fileid1 fileid2 DELETE fileid DATA. DISKR fileid stem. DATA. DISKW fileid stem. GETDIR stem. dirid MKDIR dirid RDIR dirid RENAME fileid1 fileid2 RFS performs file input/output to the REXX File System. Operands AUTH is a command that authorizes access to RFS directories. The specified access applies to all files in this directory. dirid specifies a REXX File System directory identifier.
Commands fileid2 specifies the target file identifier, it may be a fully or partially qualified directory and file identifier. DELETE is a command that deletes an RFS file. fileid specifies the source file identifier, it may be fully or partially qualified. DISKR is a command that reads records from an RFS file. stem specifies the name of a stem. (A stem must end in a period.) Refer to section “Stems” on page 123 for more information. The default stem is DATA.
Commands Note File access security checking is performed at the directory level, rather than the file level. If a specified file ID is not a fully qualified ID, the current directory or PATH directories are used in an attempt to resolve the partial name into a fully qualified name; in this case no further checking is necessary. If a fully qualified file ID is used, the directory it resides in is checked for proper access authorization, at file open time. Chapter 25.
Commands RLS RLS CKDIR dirid DELETE listname *QUEUE* LPULL varname queid *QUEUE* LPUSH varname queid *QUEUE* LQUEUE varname queid MKDIR dirid READ listname DATA. stem. VARDROP varname dirid VARGET varname dirid VARPUT varname dirid DATA. WRITE listname ( UPD stem. RLS performs list input/output to the REXX List System. Operands CKDIR is a command that checks for an existing RLS directory level. dirid specifies a REXX List System directory level identifier.
Commands MKDIR is a command that creates a new RLS directory level. READ is a command that reads records from an RLS list into a stem. listname specifies the list identifier. stem. specifies the name of a stem. (A stem must end in a period.) Refer to section “Stems” on page 123 for more information. The default stem is DATA.. UPD enqueues on a list for update. VARDROP is a keyword indicating that an RLS variable is deleted.
Commands SCRNINFO SCRNINFO SCRNINFO returns a two-digit decimal screen height (in lines) in the variable SCRNHT, and returns a three-digit decimal screen width (in columns) in the variable SCRNWD. Return Codes n 0 -499 specifies the return code passed back by CICS if an error is detected Normal return Internal error Example 'SCRNINFO' Notes 1. The screen information that is returned is obtained by doing an EXEC CICS ASSIGN SCRNHT(scrnht) SCRNWD(scrnwd). 2.
Commands SET (1) SET ENG LANG CANFR FRANC GER ESPAN UCENG HANZI KANJI 1024 MAXVSTOR kilobytes RETRieve pfkeynn TERM TERMOUT NOTERM CANCEL CEBRxxxx tsq_name Notes: 1 If no parameters are passed to the SET command, then SET creates a stem variable (SET.) that contains all of the processing options for the user that was created by the SET or SETSYS commands. SET sets the REXX/CICS processing options for the current user.
Commands RETRieve allows a PF key being set to retrieve the last line entered. pfkeynn specifies the PF key number. TERMOUT sends terminal line-mode output to a CICS temporary storage queue (for example: SAY and TRACE output) even when a terminal is attached. TERM specifies that linemode output will be sent to the terminal. NOTERM specifies that terminal line-mode output is not displayed on the terminal. CANCEL specifies that linemode output will not be sent to a CICS temporary storage queue.
Commands SETSYS Note: This is an authorized command. SETSYS LANG ENG CANFR FRANC GER ESPAN UCENG HANZI KANJI 1024 MAXVSTOR kilobytes RETRieve pfkeynn ON PSEUDO OFF AUTHClib lib.sublib AUTHElib lib.sublib SETSYS sets the REXX/CICS processing options for the system.
Commands pfkeynn specifies the PF key number. PSEUDO establishes the default region-wide REXX/CICS automatic pseudo-conversational setting. For more information on the PSEUDO command, see section “PSEUDO” on page 362. ON specifies that the automatic pseudo-conversational setting is on. This is the default. OFF specifies that the automatic pseudo-conversational setting is off. AUTHCLIB establishes the VSE Librarian sublibraries containing the REXX/CICS authorized commands. lib.
Commands S2C S2C server_rexx_varname client_rexx_varname S2C copies a server REXX variable to a client REXX variable. Operands server_rexx_varname is the name of the server REXX variable copying from. client_rexx_varname is the optional name of the client REXX variable copying into. If you do not specify, it defaults to the same as the server_rexx_varname.
Commands TERMID TERMID TERMID returns the four-character CICS terminal ID from the CICS field EIBTRMID in the variable TERMID. Return Codes 0 2921 2928 Normal return Error in obtaining terminal ID Error setting TERMID value Example 'TERMID' This example places the CICS terminal ID from the CICS field EIBTRMID in the variable TERMID.
Commands WAITREAD WAITREAD WAITREAD performs full screen terminal input and places the results into the compound variable with: WAITREAD.0 containing the number of elements returned. WAITREAD.1 containing the AID description. WAITREAD.2 containing the cursor position. WAITREAD.3 through WAITREAD.n remaining 3270 fields that have been modified.
Commands WAITREQ WAITREQ WAITREQ is used only in REXX servers causing the server to wait for a request. After a request is received, it is placed into REXX variable REQUEST. Return Codes 0 3121 3122 3123 3199 Normal return WAITREQ not enabled Exec not a server Error saving request variable Internal error Note: The return code reflected to the client program is the value of the REXX server variable at entry to the WAITREQ command or at exit of the server exec.
Part 3. Appendixes © Copyright IBM Corp.
378 CICS TS for VSE/ESA: REXX Guide
Appendix A. Error Numbers and Messages External interfaces to the language processor can generate three of the error messages either before the language processor gains control or after control has left the language processor. Therefore, SIGNAL ON SYNTAX cannot trap these errors. The error numbers involved are: 3 and 5 (if the initial requirements for storage could not be met) and 26 (if on exit the returned string could not be converted to form a valid return code).
Error Numbers and Messages System action: Execution is terminated at the point of the error. User response: Redefine storage and reissue the command. The following are the REXX error messages: CICREX218E Error 46 Invalid variable reference Explanation: Within an ARG, DROP, PARSE, PULL, or PROCEDURE instruction, the syntax of a variable reference (a variable whose value is to be used, indicated by its name being enclosed in parentheses) is incorrect.
Error Numbers and Messages When a1=b1 then Say 'A1 equals B1' exit Otherwise nop end When a1=b1 then DO Say 'A1 equals B1' exit end Otherwise nop end System action: Execution stops. User response: Make the necessary corrections. CICREX455E Error 8 running fn ft, line nn: Unexpected THEN or ELSE Explanation: The language processor has found a THEN or an ELSE that does not match a corresponding IF clause.
Error Numbers and Messages A-Z a-z 0-9 @ # £ $ . ? ! _ (Alphamerics) (Name Characters) & * ( ) - + = \ ¬ ' " ; : < , > / | (Special Characters) If surrounded by X'0E' (shift-out) and X'0F' (shift-in), and if ETMODE is on, the following are also valid characters: X'41' - X'FE' (DBCS Characters) Some causes of this error are: 1. Using accented and other language-specific characters in symbols. 2. Using DBCS characters without ETMODE in effect. System action: Execution stops.
Error Numbers and Messages passed back from an EXIT or RETURN instruction (when a REXX program is called as a command) is not a whole number or will not fit in a general register. This error may be due to mistyping the name of a symbol so that it is not the name of a variable in the expression on any of these statements. This might be true, for example, if you entered “EXIT CR” instead of “EXIT RC”. System action: Execution stops. User response: Make the necessary corrections.
Error Numbers and Messages Say Enter A, B, or C should be written as: Say 'Enter A, B, or C' System action: Execution stops. User response: Make the necessary corrections. CICREX474E Error 39 running fn ft, line nn: Evaluation stack overflow Explanation: The language processor was not able to evaluate the expression because it is too complex (many nested parentheses, functions, and so forth). System action: Execution stops.
Error Numbers and Messages end with a RETURN statement specifying an expression. User response: Make the necessary corrections. System action: Execution stops. CICREX485E Error 25 running fn ft, line nn: Invalid sub-keyword found User response: Make the necessary corrections. CICREX481E Error 49 running fn ft, line nn: Language processor failure Explanation: The language processor carries out numerous internal self-consistency checks. It issues this message if it encounters a severe error.
Error Numbers and Messages v v v v NUMERIC FUZZ expression OPTIONS expression SIGNAL VALUE expression TRACE VALUE expression. CICREX1106E Error 23 running fn ft, line nn: Invalid SBCS/DBCS mixed string. System action: Execution stops. Explanation: A character string that has unmatched SO-SI pairs (that is, an SO without an SI) or an odd number of bytes between the SO-SI characters was processed with OPTIONS EXMODE in effect. User response: Make the necessary corrections.
Appendix B. Return Codes This appendix is a list of all the REXX/CICS return codes. Panel Facility 4 8 10 12 14 16 Warning. Panel facility continues processing Programmer error Programmer error with state information CICS command error RFS errors; reason code contains the RFS return code Internal system error See Chapter 24, “REXX/CICS Panel Facility,” on page 295, for additional codes (for example: state and reason codes).
Return Codes 207 210 211 223 226 229 230 231 232 236 299 Insufficient space in filepool Request failed Invalid file ID Search argument not found File is currently being edited Number out of range Cursor is not in file area Out of virtual storage Prefix command conflict Not defined Internal error DIR 0 321 322 325 Normal return Cannot access current RFS directory information Invalid stem name Error retrieving RFS directory SET 0 421 422 423 425 426 427 Normal return Invalid SET subcommand Error storing
Return Codes 715 716 723 726 728 729 730 732 733 736 737 738 743 746 747 748 749 750 751 752 753 754 Directory already exists Directory not specified List not found List not specified List is in update mode List is not in update mode User is not signed on Queue empty Named queue not found Stem or variable not specified Stem or variable name too long Stem or variable count invalid Block not found CICGETV error GETMAIN error FREEMAIN error ENQ error DEQ error Dynamic area GETMAIN error Error in saved variabl
Return Codes DEFTRNID 0 1202 1222 1223 1225 1226 1228 1233 Normal return Invalid operand Invalid option Error storing trantable information Error retrieving trantable information Exec name length error Error setting trantable value Transaction not found in table EXECDROP 0 1401 1402 1423 1425 1448 Normal return Invalid command Invalid operand Error storing EXECLOAD information Error retrieving EXECLOAD information No client available EXECLOAD 0 1501 1502 1523 1525 1530 1531 1532 1547 1548 1599 Normal
Return Codes 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 Error storing file pool information File pool ID not specified Error retrieving file pool information Invalid file pool ID Invalid file pool data retrieved File pool not defined RFS could not add library to file pool RFS could not create users directory CICS file indentifier for the file pool must be specified Invalid CICS file indentifier File pool variable corrupted Pool ID already exists CICS file indentifi
Return Codes 2226 Invalid stem variable name LISTTRNID 0 2325 Normal return Error retrieving trantable information C2S 0 2440 2441 2442 2448 Normal return No variable name specified Error retrieving variable Error storing variable No client available PSEUDO 0 2502 2521 Normal return Invalid operand Operand not specified AUTHUSER 0 2602 2621 2642 Normal return Invalid operand or operand missing Specified user ID invalid length Error storing user ID SETSYS 0 2721 2722 2723 2725 2726 2727 2732 2735 2
Return Codes 3021 3099 No terminal is attached Internal error WAITREQ 0 3121 3122 3123 3199 Normal return WAITREQ not enabled Exec not a server Error saving request variable Internal error EXEC n 0 -3 -10 -11 -12 -99 specifies the return code set by the exit of the called exec Normal return Exec not found Exec name not specified Invalid exec name GETMAIN error Internal error CEDA and CEMT n 0 -101 specifies the return code passed back by CICS if an error is detected Normal return Invalid command EXE
Return Codes -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 394 Redundant specification for option Value for option not specified Value specified for option which should not have a value Value specified for option is not numeric Invalid value Value specified is too long Value specified is too short Value not specified Variable table overflow Number of variables exceeds variable table limit Argument must be a variable Variab
Appendix C. Double-Byte Character Set (DBCS) Support A Double-Byte Character Set supports languages that have more characters than can be represented by 8 bits (such as Korean Hangeul and Japanese kanji). REXX has a full range of DBCS functions and handling techniques. These include: v Symbol and string handling capabilities with DBCS characters v An option that allows DBCS characters in symbols, comments, and literal strings. v An option that allows data strings to contain DBCS characters.
DBCS character SBCS character DBCS blank EBCDIC shift-out (X'0E') EBCDIC shift-in (X'0F') -> -> -> -> -> .A .B .C .D a b c d e '. ' < > Note: In EBCDIC, the shift-out (SO) and shift-in (SI) characters distinguish DBCS characters from SBCS characters. Enabling DBCS Data Operations and Symbol Use The OPTIONS instruction controls how REXX regards DBCS data. To enable DBCS operations, use the EXMODE option.
Validation The user must follow certain rules and conditions when using DBCS. DBCS Symbol Validation DBCS symbols are valid only if you comply with the following rules: v The DBCS portion of the symbol must be an even number of bytes in length v DBCS alphanumeric and special symbols are regarded as different to their corresponding SBCS characters.
PARSE In EBCDIC: x1 = '<><.A.B><. . ><.E><.F><>' PARSE VAR x1 w1 w1 -> '<><.A.B><. . ><.E><.F><>' PARSE VAR x1 1 w1 w1 -> '<><.A.B><. . ><.E><.F><>' PARSE VAR x1 w1 . w1 -> '<.A.B>' The leading and trailing SO and SI are unnecessary for word parsing and, thus, they are stripped off. However, one pair is still needed for a valid mixed DBCS string to be returned. PARSE VAR x1 . w2 w2 -> '<. ><.E><.
When the data is split up in shorter lengths, again the DBCS data integrity is kept under OPTIONS EXMODE. In EBCDIC, if the terminal line size is less than 4, the string is treated as SBCS data, because 4 is the minimum for mixed string data. UPPER Under OPTIONS EXMODE, the UPPER instruction translates only SBCS characters in contents of one or more variables to uppercase, but it never translates DBCS characters. If the content of a variable is not valid mixed string data, no uppercasing occurs.
In EBCDIC: '<.A>' '<><><.A>' '<> <.A>' '<.A><><.B>' 'abc' = = = = < '<.A. >' '<.A><><>' '<.A>' '<.A.B>' 'ab<. >' -> -> -> -> -> 1 1 1 1 0 /* /* /* /* /* true true true true false */ */ */ */ */ 5. Word extraction from a string—“Word” means that characters in a string are delimited by an SBCS or a DBCS blank.
DATATYPE DATATYPE('<.A.B>') DATATYPE('<.A.B>','D') DATATYPE('<.A.B>','C') DATATYPE('a<.A.B>b','D') DATATYPE('a<.A.B>b','C') DATATYPE('abcde','C') DATATYPE('<.A.B','C') DATATYPE('<.A.B>','S') -> -> -> -> -> -> -> -> 'CHAR' 1 1 0 1 0 0 1 /* if ETMODE is on */ Note: If string is not a valid mixed string and C or D is specified as type, 0 is returned. FIND FIND('<.A. .B.C> abc','<.B.C> abc') FIND('<.A. .B><.C> abc','<.B.C> abc') FIND('<.A. . .B> abc','<.A> <.
RIGHT('a<>',2) CENTER('<.A.B>',10,'<.E>') CENTER('<.A.B>',11,'<.E>') CENTER('<.A.B>',10,'e') -> -> -> -> ' a' '<.E.E.E.E.A.B.E.E.E.E>' '<.E.E.E.E.A.B.E.E.E.E.E>' 'eeee<.A.B>eeee' Applying the character concatenation for padding and character extraction from a string rules. LENGTH In EBCDIC: LENGTH('<.A.B><.C.D><>') -> 4 Applying the counting characters rule. REVERSE In EBCDIC: REVERSE('<.A.B><.C.D><>') -> '<><.D.C><.B.
Drop A.3 ; <.A.B>=3 SYMBOL('<.A.B>') SYMBOL(<.A.B>) SYMBOL('a.<.A.B>') /* if ETMODE is on */ -> -> -> 'VAR' 'LIT' /* has tested "3" */ 'LIT' /* has tested A.3 */ TRANSLATE In EBCDIC: TRANSLATE('abcd','<.A.B.C>','abc') TRANSLATE('abcd','<><.A.B.C>','abc') TRANSLATE('abcd','<><.A.B.C>','ab<>c') TRANSLATE('a<>bcd','<><.A.B.C>','ab<>c') TRANSLATE('a<>xcd','<><.A.B.C>','ab<>c') -> -> -> -> -> '<.A.B.C>d' '<.A.B.C>d' '<.A.B.C>d' '<.A.B.C>d' '<.A>x<.
WORDPOS In EBCDIC: WORDPOS('<.B.C> abc','<.A. .B.C> abc') WORDPOS('<.A.B>','<.A.B. .A.B><. .B.C. .A.B>',3) -> -> 2 4 Applying the word extraction from a string and character comparison rules. DBCS Processing Functions This section describes the functions that support DBCS mixed strings. These functions handle mixed strings regardless of the OPTIONS mode. Note: When used with DBCS functions, length is always measured in bytes (as opposed to LENGTH(string), which is measured in characters).
DBCENTER DBCENTER(string,length ) , pad ,option returns a string of length length with string centered in it, with pad characters added as necessary to make up length. The default pad character is a blank. If string is longer than length, it is truncated at both ends to fit. If an odd number of characters are truncated or added, the right-hand end loses or gains one more character than the left-hand end. The option controls the counting rule. Y counts SO and SI within mixed strings as one each.
padded with pad characters (or truncated) on the right as needed. The default pad character is a blank. The option controls the counting rule. Y counts SO and SI within mixed strings as one each. N does not count the SO and SI and is the default. Here are some EBCDIC examples: DBLEFT('ab<.A.B>',4) DBLEFT('ab<.A.B>',3) DBLEFT('ab<.A.B>',4,'x','Y') DBLEFT('ab<.A.B>',3,'x','Y') DBLEFT('ab<.A.B>',8,'<.P>') DBLEFT('ab<.A.B>',9,'<.P>') DBLEFT('ab<.A.B>',8,'<.P>','Y') DBLEFT('ab<.A.B>',9,'<.
DBRRIGHT(string,length ) ,option returns the remainder from the DBRIGHT function of string. If length is greater than the length of string, returns a null string. The option controls the counting rule. Y counts SO and SI within mixed strings as one each. N does not count the SO and SI and is the default. Here are some EBCDIC examples: DBRRIGHT('ab<.A.B>',4) DBRRIGHT('ab<.A.B>',3) DBRRIGHT('ab<.A.B>',5) DBRRIGHT('ab<.A.B>',4,'Y') DBRRIGHT('ab<.A.B>',5,'Y') DBRRIGHT('ab<.A.B>',8) DBRRIGHT('ab<.A.
DBVALIDATE DBVALIDATE(string ) ,'C' returns 1 if the string is a valid mixed string or SBCS string. Otherwise, returns 0. Mixed string validation rules are: 1. Only valid DBCS character codes 2. DBCS string is an even number of bytes in length 3. EBCDIC only — Proper SO and SI pairing.
Appendix D. Reserved Keywords and Special Variables You can use keywords as ordinary symbols in many situations where there is no ambiguity. The precise rules are given here. There are three special variables: RC, RESULT, and SIGL. Reserved Keywords The free syntax of REXX implies that some symbols are reserved for the language processor's use in certain contexts. Within particular instructions, some symbols may be reserved to separate the parts of the instruction.
Keywords and Variables RC is set to the return code from any run host command (or subcommand). Following the SIGNAL events, SYNTAX, ERROR, and FAILURE, RC is set to the code appropriate to the event: the syntax error number (see appendix on error messages) or the command return code. RC is unchanged following a NOVALUE or HALT event. Note: Host commands run manually from debug mode do not cause the value of RC to change.
Appendix E. Debug Aids This appendix describes the interactive debugging of problems, interrupting execution, and controlling tracing. Interactive Debugging of Programs The debug facility permits interactively controlled execution of a program. Changing the TRACE action to one with a prefix ? (for example, TRACE ?A or the TRACE built-in function) turns on interactive debug and indicates to the user that interactive debug is active.
Debug Aids Since any instructions may be run in interactive debug, you have considerable control over execution. Some examples: Say expr /* displays the result of evaluating the /* expression. */ */ name=expr /* alters the value of a variable. */ Trace O /* (or Trace with no options) turns off /* interactive debug and all tracing. */ */ Trace ?A /* turns off interactive debug but continues /* tracing all clauses.
Appendix F. REXX/CICS Business Value Discussion CICS Transaction Server for VSE/ESA REXX provides an ideal system to deliver superior, valuable, and appropriate CICS-based business solutions in a more timely and cost-effective manner. Business Solutions The ability to deliver business solutions more quickly is an important advantage in today's competitive marketplace.
Business Value Discussion v CICS Transaction Server for VSE/ESA REXX is useable by business people Quite often, business people who best understand the business and their required solutions have ideas on modifying or enhancing the applications they use. However, without extensive training and experience with a programming language, they may be unable to implement the ideas. One of the greatest strengths of REXX is its simplicity and “naturalness” on the one hand, and its powerful capabilities on the other.
Business Value Discussion v CICS Transaction Server for VSE/ESA REXX supports six languages CICS Transaction Server for VSE/ESA REXX provides REXX messages in six languages, in addition to U.S. English: – Canadian French – French – German – Japanese Kanji – Spanish – Simplified Chinese. Only the REXX messages are translated. The text editor and file list utility are not translated. The translated messages files are included on the product tape and are not separate features.
416 CICS TS for VSE/ESA: REXX Guide
Appendix G. System Definition/Customization/Administration This appendix discusses the system definition, customization, and administration of REXX/CICS. Authorized REXX/CICS Commands/Authorized Command Options Several REXX/CICS commands, or command options, are identified as being authorized. An authorized REXX/CICS command can only be executed if: v The user ID issuing the exec is an authorized REXX/CICS user. Authorized users are defined by the AUTHUSER command.
System Definition/Customization/Administration Setting System Options System options are specified by using the REXX/CICS SETSYS command. It is recommended that system-wide SETSYS commands be placed in the CICSTART exec. Defining and Initializing a REXX File System (RFS) File Pool Use the FILEPOOL DEFINE command to define a RFS file pool. Use the FILEPOOL FORMAT command to initialize the first file in each file pool.
System Definition/Customization/Administration Function IDs A R U Alter Read Update Appendix G.
System Definition/Customization/Administration 420 CICS TS for VSE/ESA: REXX Guide
Appendix H. Security REXX/CICS can be viewed as a more sophisticated version of the CICS-supplied Command Level Interpreter Transaction (CECI). The REXX transaction (used to issue REXX execs), much like the CECI transaction, can be controlled using CICS transaction security. The REXX transaction might be made widely available, or might be limited to a few individuals, depending upon the nature of the CICS region it is running in.
Security authorized. This is the logical place to define authorized users and libraries. The sublibrary containing the CICSTART exec is treated as the initial “authorized command” and “authorized exec” sublibrary. Because access to REXX/CICS libraries can easily be controlled, this is the logical counterpart to controlling access to CICS production program libraries. Any commands that a site feels are sensitive (such as READ, WRITE, and DELETE) could be defined as authorized in the production region.
Security Notes: 1. The AUTH option of the DEFCMD or DEFSCMD is itself an authorized command option. That is, AUTH may only be used if the user issuing it is an authorized user or if it was issued from an exec loaded from an authorized sublibrary. 2. The EXECLOAD and EXECDROP commands are authorized. Therefore, only an authorized user or exec can EXECLOAD an exec from an authorized sublibrary. Appendix H.
Security 424 CICS TS for VSE/ESA: REXX Guide
Appendix I. Performance Considerations Because of the production nature of CICS, emphasis is placed on performance. Many design choices can affect performance. These include: v How REXX environments are defined v How the REXX File System structure is implemented v How security interfaces are implemented v How much virtual storage is given to an exec at invocation. REXX uses sophisticated techniques, such as look-aside tables and tree balancing, for good performance.
426 CICS TS for VSE/ESA: REXX Guide
Appendix J. Basic Mapping Support Example This appendix has a list of steps that you must follow so you can use the CICS basic mapping support (BMS) within the REXX/CICS environment. The steps include: 1. BMS maps must be assembled and linked into a CICS library. This library must be in the LIBDEF in the CICS region startup JCL. 2. If you are going to use the REXX/CICS CONVTMAP command to generate a file structure, the BMS map must be assembled to produce the map DSECT. 3.
BMS Example The map DSECT follows.
BMS Example /* and initialize 'PSEUDO OFF' ZEROES = '00'x 'CICS GETMAIN SET(WORKPTR) LENGTH(90) INITIMG(ZEROES)' */ VAR1 = 'USERID must be 8 characters' /* Copy the REXX variable VAR1 to the GETMAINed storage 'COPYR2S VAR1 WORKPTR 30' */ /* Copy the storage area to REXX variable 'COPYS2R WORKPTR X 0 90' */ 'CICS SEND MAP(PANELG) FREEKB ERASE FROM(X)' 'CICS RECEIVE MAP(PANELG) INTO(Y)' /* Copy Y into the GETMAINED storage area and then copy the data */ /* to REXX variables using the file structure gene
BMS Example REXX/CICS HEADER PANEL1 PLEASE ENTER YOUR USERID: TEST MSG: Please enter 8 character USERID 430 CICS TS for VSE/ESA: REXX Guide PANEL1
Appendix K. Post-Installation Configuration This appendix has a list of the steps to configure the REXX support. Create the RFS Filepools The REXX Filing System uses two or more filepools to store data. These are implemented as sets of VSAM clusters. There is a skeleton sample job called CICVSAM.J in PRD1.BASE to define two filepools for REXX. You should change this job to reflect your own environment as, for example, the dataset names.
PI Configuration COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY COPY CICHPREP.Z:=.PROC R=Y CICIVP1.Z:=.PROC R=Y CICIVP2.Z:=.PROC R=Y CICIVP3.Z:=.PROC R=Y CICLCLIB.Z:=.PROC R=Y CICLELIB.Z:=.PROC R=Y CICLISTC.Z:=.PROC R=Y CICLISTP.Z:=.PROC R=Y CICLISTT.Z:=.PROC R=Y CICOVSIB.Z:=.PROC R=Y CICPATH.Z:=.PROC R=Y CICPSAMP.Z:=.PROC R=Y CICRXTRY.Z:=.PROC R=Y CICSET.Z:=.PROC R=Y CICSETS.Z:=.PROC R=Y CICSPROF.Z:=.PROC R=Y CICSTART.Z:=.PROC R=Y CICTRMID.Z:=.PROC R=Y CICXPROF.
PI Configuration Format the RFS Filepools Ensure that all required configuration tasks have been performed, and if necessary re-start CICS. Sign on with a userid defined as an authorized user in CICSTART.PROC. Enter REXX (which is the default transaction id associated with the CICRXTRY exec). You should see the following line at the top of the screen: Enter a REXX command or EXIT to quit and a READ in the lower right hand corner. The cursor is in the lower left hand corner.
PI Configuration CONNECT S=PRD1.BASE : user.sublib COPY CICR3270.Y : CICR3270.BOOK COPY CICINDEX.N : CICINDEX.PANSRC COPY CICSNDX.N : CICSNDX.PANSRC COPY CICCHAP.N : CICCHAP.PANSRC Start CICS with at least EDSALIM=25M. Approximately 10M of free EDSA is needed to execute this procedure, therefore allow this much extra over your normal configuration. CEMT I DSAS displays the current usage, and can increase EDSALIM as long as partition getvis storage is available.
PI Configuration Sample output: Enter a REXX command or EXIT to quit CALL CICIVP1 ***------------------------------------------------------*** *** This is a test REXX program running under CICS/VSE *** *** It was loaded from PROCLIB-user.
PI Configuration A package for the CICSQL program is loaded into the DB2 database under the SQLDBA user. This is supplied as member CICSQL.A. If you fail to do this, REXX gives return codes such as -805 whenever an "ADDRESS EXECSQL command" is issued. Adapt the following JCL and run DB2 in single user mode, substituting the correct password for user SQLDBA. The default is SQLDBAPW but this is normally changed as part of the DB2 installation process. // JOB RELOAD CICSQL PACKAGE // LIBDEF *,SEARCH=(PRD2.
Bibliography CICS Transaction Server for VSE/ESA Release 1 library Evaluation and planning CICS TS for VSE/ESA Enhancements Guide CICS TS for VSE/ESA Release Guide CICS TS for VSE/ESA Migration Guide CICS TS for VSE/ESA Report Controller Planning Guide GC34-5763 GC33-1645 GC33-1646 GC33-1941 General Master index CICS TS for VSE/ESA Trace Entries CICS TS for VSE/ESA User's Handbook CICS TS for VSE/ESA Glossary (softcopy only) SC33-1648 SX33-6108 SX33-6101 GC33-1649 Administration CICS TS for VSE/ESA Syst
CICS CICS CICS CICS CICS CICS CICS CICS CICS CICS Clients Clients: Administration Universal Clients Version 3 for OS/2: Administration Universal Clients Version 3 for Windows: Administration Universal Clients Version 3 for AIX: Administration Universal Clients Version 3 for Solaris: Administration Family: OO programming in C++ for CICS Clients Family: OO programming in BASIC for CICS Clients Family: Client/Server Programming Transaction Gateway Version 3: Administration SC33-1792 SC34-5450 SC34-5449 SC34-
TCP/IP User's Guide Turbo Dispatcher Guide and Reference Unattended Node Support SC33-6601 SC33-6797 SC33-6712 High-Level Assembler Language (HLASM) General Information Installation and Customization Guide Language Reference Programmer’s Guide GC26-8261 SC26-8263 SC26-8265 SC26-8264 Language Environment for VSE/ESA (LE/VSE) C Run-Time Library Reference C Run-Time Programming Guide Concepts Guide Debug Tool for VSE/ESA Fact Sheet Debug Tool for VSE/ESA Installation and Customization Guide Debug Tool for
Diagnosis Data Areas Messages and Codes Migration Guide Network Implementation Guide Operation Overview Programming Programming for LU6.2 Release Guide Resource Definition Reference LY43-0065 LY43-0104 SC31-6493 GC31-8072 SC31-6494 SC31-6495 GC31-8114 SC31-6496 SC31-6497 GC31-8090 SC31-6498 Books from VSE/ESA 2.
DL/I VSE Application and Database Design Application Programming: CALL and RQDLI Interface Application Programming: High-Level Programming Interface Database Administration Diagnostic Guide General Information Guide for New Users Interactive Resource Definition and Utilities Library Guide and Master Index Licensed Program Specifications Low-level Code and Continuity Check Feature Library Guide and Master Index Messages and Codes Recovery and Restart Guide Reference Summary: CALL Program Interface Reference
442 CICS TS for VSE/ESA: REXX Guide
Notices This information was developed for products and services offered in the U.S.A. IBM® may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used.
444 CICS TS for VSE/ESA: REXX Guide
Trademarks The following terms are trademarks of International Business Machines Corporation in the United States, or other countries, or both: ACF/VTAM AFP AIX AT C/370 CICS CICS OS/2 CICS/ESA CICS/MVS CICS/VSE CICSPlex DB2 Hiperbatch IBM IBMLink IMS MVS/ESA OfficeVision/VM OS/2 RACF System/390 VSE/ESA © Copyright IBM Corp.
446 CICS TS for VSE/ESA: REXX Guide
Index Special characters A ! prefix on TRACE option 168 ? prefix on TRACE option 167 / (division operator) 21, 116, 218 // (remainder operator) 21, 116, 221 /= (not equal operator) 117 /== (strictly not equal operator) 117 .DEFINE verb 296, 297 .
CASE command 236, 242 CATMOUSE EXEC 91 CD command 127, 231, 258, 321, 339 CEDA command 105, 323 CEMT command 105, 324 Century option of DATE function 182 CHANGE command 237 checking arguments with ARG function 176 CICEPROF macro 241 CICGETV routine 284 CICPARMS control block 283 CICREX program 418 CICS 82 return codes 393 CICS commands 81 CICSECX2 security exit 418 CICSLINK option on DEFCMD command 283 CICSLOAD option on DEFCMD command 282 CICSPROF exec 105, 421 CICSTART exec 105, 417, 418 CICXPROF macro 24
error 379, 387 debugging 29 ERROR 225 ERROR condition of SIGNAL and CALL instructions 228 error messages 12 ETMODE 151 European option of DATE function 182 evaluation of expressions 115 example 244 ADDRESS instruction 10 AUTH 260 AUTHUSER command 320 C2S command 331 CD command 321 CEDA command 323 CEMT command 324 CKDIR 260, 275 CLD command 325 CONVTMAP command 326 COPY 261 COPYR2S command 328 COPYS2R command 330 current directory 258, 259 debug aids 412 DEFCMD command 333 DEFSCMD command 336 DELETE 261, 27
F FAILURE condition of SIGNAL and CALL instructions 225, 228 failure, definition 125 feature of REXX 3 FIFO (first-in/first-out) stacking 160 file access security 259 FILE command 241 file list utility (FLST) 264 file name, type, mode of program 153 file pool 257 root directory 257 file system commands 259 file type extension 127 FILEPOOL command 350, 418 FIND command 242 FIND function 185 flowchart 37 FLST command 352 FLSTSVR 82 FOR phrase of DO instruction 138 FOREVER repetitor on DO instruction 138 FORM
LPUSH command 276 LQUEUE command 277 M MACRO command 246 mapping between commands 319 master terminal transaction (CEMT) 3 messages interpreting 12 minutes calculated from midnight 194 mixed DBCS string 181 MKDIR command 257, 263, 273, 277 Month option of DATE function 182 MSGLINE command 246 multi-way call 136, 165 multiple strings 78, 211 N naming variable 19 nested exec 425 nesting of control structures 137 nibbles 112 NOETMODE 151 NOEXMODE 151 Normal option of DATE function 182 not equal operator 117
quotation marks around a literal string in an instruction 6 6 R random number function of RANDOM 190 RDIR command 263 READ command 277 recursive call 136 reference 103 relative numeric pattern in parsing 77 relative positional patterns 207 RENAME command 264 Rename supplied Procedures 431 reordering data with TRANSLATE function 195 repeating a string with COPIES 179 repetitive loops 39 reservation of keywords 409 RESERVED command 251, 265 RESET command 251 resetting command environment 319 resource defini
subkeyword 120 subroutine comparison to a function 57, 70 description 57 protecting variable 62 writing 58 subsidiary list 142, 155 SUBSTR 192 substring 192 suggested readings xix symbols and strings in DBCS 396 SYNONYM command 254 syntax 387 rules of REXX 6 SYNTAX condition of SIGNAL instruction SYSSBA command 201 system libraries 422 systems administrator 421 Usa option of DATE function 182 user's guide 3, 99 USERS directory 257, 273 users, identifying 196 using a period as a placeholder 75 V 226, 228
454 CICS TS for VSE/ESA: REXX Guide
Sending your comments to IBM If you especially like or dislike anything about this book, please use one of the methods listed below to send your comments to IBM. Feel free to comment on what you regard as specific errors or omissions, and on the accuracy, organization, subject matter, or completeness of this book. Please limit your comments to the information in this book and the way in which the information is presented.
456 CICS TS for VSE/ESA: REXX Guide
SC34-5764-01
Spine information: CICS TS for VSE/ESA REXX Guide