background image

CICS Transaction Server for VSE/ESA

REXX Guide

SC34-5764-01

Summary of Contents for SC34-5764-01

Page 1: ...CICS Transaction Server for VSE ESA REXX Guide SC34 5764 01...

Page 2: ......

Page 3: ...CICS Transaction Server for VSE ESA REXX Guide SC34 5764 01...

Page 4: ...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 e...

Page 5: ...acter Set Names 10 Typing in a Program 11 Running a Program 11 Interpreting Error Messages 12 How to Prevent Translation to Uppercase 13 Characters within a program 13 Characters Input to a program 14...

Page 6: ...s 54 Miscellaneous Functions 55 Testing Input with Built In Functions 55 Chapter 6 Writing Subroutines and Functions 57 What are Subroutines and Functions 57 When to Write Subroutines Rather Than Func...

Page 7: ...e 101 Chapter 11 Introduction 103 Who Should Read This Reference 103 How to Use This Reference 103 Overview of Product Features 104 SAA Level 2 REXX Language Support Under REXX CICS 104 Support for th...

Page 8: ...Support of Standard REXX Features 127 SAY and TRACE Statements 127 PULL and PARSE EXTERNAL Statements 127 REXX Stack Support 127 REXX Function Support 127 REXX Command Environment Support 128 Adding R...

Page 9: ...OR 177 BITXOR Bit by Bit Exclusive OR 177 B2X Binary to Hexadecimal 177 CENTER CENTRE 178 COMPARE 178 CONDITION 178 COPIES 179 C2D Character to Decimal 179 C2X Character to Hexadecimal 180 DATATYPE 18...

Page 10: ...200 SYSSBA 201 Chapter 15 Parsing 203 General Description 203 Simple Templates for Parsing into Words 203 Templates Containing String Patterns 205 Templates Containing Positional Numeric Patterns 206...

Page 11: ...ariable RC 228 The Special Variable SIGL 228 Chapter 18 REXX CICS Text Editor 231 Invocation 231 Screen Format 232 Prefix Commands 232 Individual Line Commands 232 Consecutive Block Commands 233 Desti...

Page 12: ...ELETE 261 DISKR 261 DISKW 262 GETDIR 262 MKDIR 263 RDIR 263 RENAME 264 File List Utility 264 Invocation 264 Macros under the REXX CICS File List Utility 265 FLST Commands 265 CANCEL 265 CD 266 COPY 26...

Page 13: ...the Results 287 Using the SQL Communications Area 288 Example Using SQL Statements 288 Chapter 23 REXX CICS High level Client Server Support 291 Overview 291 High level Natural Transparent REXX Clien...

Page 14: ...pter 25 REXX CICS Commands 319 AUTHUSER 320 Operands 320 Return Codes 320 Example 320 Notes 320 CD 321 Operands 321 Return Codes 321 Examples 321 Note 321 CEDA 323 Operands 323 Return Codes 323 Exampl...

Page 15: ...339 Note 339 EDIT 340 Operands 340 Return Codes 340 Example 340 Note 340 EXEC 341 Operands 341 Return Codes 341 Example 341 EXECDROP 342 Operands 342 Return Codes 342 Example 342 Note 343 EXECIO 344 O...

Page 16: ...e 356 LISTCLIB 357 Operands 357 Return Codes 357 Example 357 LISTELIB 358 Operands 358 Return Codes 358 Example 358 LISTPOOL 359 Operands 359 Return Codes 359 Example 359 Note 359 LISTTRNID 360 Return...

Page 17: ...Codes 375 Example 375 Note 375 WAITREQ 376 Return Codes 376 Example 376 Part 3 Appendixes 377 Appendix A Error Numbers and Messages 379 Appendix B Return Codes 387 Panel Facility 387 SQL 387 RFS and...

Page 18: ...tion 404 Function Descriptions 404 DBADJUST 404 DBBRACKET 404 DBCENTER 405 DBCJUSTIFY 405 DBLEFT 405 DBRIGHT 406 DBRLEFT 406 DBRRIGHT 406 DBTODBCS 407 DBTOSBCS 407 DBUNBRACKET 407 DBVALIDATE 408 DBWID...

Page 19: ...Considerations 425 Appendix J Basic Mapping Support Example 427 Appendix K Post Installation Configuration 431 Create the RFS Filepools 431 Install Resource Definitions 431 Update LSRPOOL Definitions...

Page 20: ...Screen Definition Facility II SDF II 441 Notices 443 Trademarks 445 Index 447 Sending your comments to IBM 455 xviii CICS TS for VSE ESA REXX Guide...

Page 21: ...dentified within the code as 1 1 1 If you are not an experienced programmer and are new to REXX you should read the guide part of this book see page 1 The book contains two parts a user s guide and a...

Page 22: ...xx CICS TS for VSE ESA REXX Guide...

Page 23: ...Part 1 User s Guide Copyright IBM Corp 1992 2009 1...

Page 24: ...2 CICS TS for VSE ESA REXX Guide...

Page 25: ...instruction in a particular column You can skip spaces in a line or skip entire lines You can have an instruction span of many lines or have multiple instructions on one line You need not predefine v...

Page 26: ...mands 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...

Page 27: ...ands that the host environment executes such as CICS commands see page 81 One advantage of the REXX language is its similarity to ordinary English This similarity makes it easy to read and write a REX...

Page 28: ...column These instructions are sent to the terminal output device You can type in any column You can type in any column You can type in any column The Format of REXX Instructions The REXX language has...

Page 29: ...cult Ending an instruction A line usually contains one instruction except when it contains a semicolon or ends with a comma The end of the line or a semicolon indicates the end of an instruction If yo...

Page 30: ...sults in six lines of identical output followed by one indented line This is a REXX literal string This is a REXX literal string This is a REXX literal string This is a REXX literal string This is a R...

Page 31: ...necessary because otherwise the language processor would execute the code in the subroutine after the label sub EXIT is not necessary in some programs such as those without subroutines but it is good...

Page 32: ...ogram identifier to satisfy TSO requirements Blank lines Blank lines separate groups of instructions and aid readability The more readable a program is the easier it is to understand and maintain Comm...

Page 33: ...S editor for files that reside in the REXX File System RFS The name of the program is HELLO EXEC for now assume that the file type is exec 1 Sign on to a CICS Transaction Server for VSE ESA terminal b...

Page 34: ...press Enter without typing a response first hello Hello What is your name Hello stranger Then again maybe you did not understand that you had to type in your name Perhaps the program should make your...

Page 35: ...d of the comment on line 7 PULL who Get the person s name How to Prevent Translation to Uppercase The language processor generally translates alphabetic characters to uppercase before processing them...

Page 36: ...put TYRANNOSAURUS To cause the language processor to read input exactly as it is presented use the PARSE PULL instruction instead of the PULL instruction PARSE PULL animal Now if the input is TyRannOs...

Page 37: ...u pass only one number to the program REXX add 42 The language processor assigns the value 42 to number1 the first variable following ARG It assigns the null string to number2 the second variable In t...

Page 38: ...L instruction the ARG instruction changes alphabetic characters to uppercase To prevent translation to uppercase use PARSE ARG as in the following example Exercises Using the ARG Instruction The left...

Page 39: ...ds on how the program is called Using the CALL Instruction or a REXX Function Call When you call a REXX program using either the CALL instruction or a REXX function call you can pass up to 20 argument...

Page 40: ...18 CICS TS for VSE ESA REXX Guide...

Page 41: ...00000 Variables can refer to different values at different times If you assign a different value to big it gets the value of the new assignment until it is changed again big 999999999 Variables can al...

Page 42: ...Y Z X Y 1234 Z Variable Values The value of the variable which is the value the variable name represents might be categorized as follows v A constant which is a number that is expressed as An integer...

Page 43: ...cludes a decimal point Results of arithmetic operations with decimal numbers are limited to a total maximum of nine digits NUMERIC DIGITS default before and after the decimal Examples of decimal numbe...

Page 44: ...xample 7 2 result is 1 Order of Evaluation When you have more than one operator in an arithmetic expression the order of numbers and operators can be critical For example in the following expression w...

Page 45: ...se comparison operators do not return a number value as do arithmetic expressions Comparison expressions return either 1 which represents true or 0 which represents false Comparison operators can comp...

Page 46: ...reference This book uses the backslash character The Strictly Equal and Equal Operators When two expressions are strictly equal everything including the blanks and case when the expressions are charac...

Page 47: ...r 0 is false and 1 is true a 0 b 1 c 0 The first Apples has a space d 1 e 0 f 1 Logical Boolean Operators Logical expressions like comparison expressions return 1 true or 0 false when processed Logica...

Page 48: ...itional instructions and as checkpoints to screen unwanted conditions When you have a series of logical expressions for clarification use one or more sets of parentheses to enclose each expression IF...

Page 49: ...ation operators combine two terms into one The terms can be strings variables expressions or constants Concatenation can be significant in formatting output The operators that indicate how to join two...

Page 50: ...s Power exponential Multiply and divide Add and subtract blank abuttal Concatenation operators and so on Comparison operators Logical AND Inclusive OR and exclusive OR Thus given the following values...

Page 51: ...true false true false ___________ false _________________ true ____________________ true Tracing Expressions with the TRACE Instruction You can use the TRACE instruction to show how the language proc...

Page 52: ...previous example from an I to an R you would see the following results 9 IF a 1 5 y 0 In addition to tracing operations and results the TRACE instruction offers other types of tracing see section TRA...

Page 53: ...ast one expression was true 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...

Page 54: ...Using Variables and Expressions 32 CICS TS for VSE ESA REXX Guide...

Page 55: ...her path The REXX conditional instructions are IF expression THEN ELSE SELECT WHEN expression OTHERWISE END v Looping instructions tell the language processor to repeat a set of instructions A loop ca...

Page 56: ...instructions with a DO and end them with an END IF weather rainy THEN SAY Find a good book ELSE DO PULL playgolf Gets data from input stream If playgolf YES THEN SAY Fore END Without the enclosing DO...

Page 57: ...ncoats 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 l...

Page 58: ...ctions for the following flowchart ANSWER IF a 0 THEN IF c 2 THEN z 1 ELSE NOP ELSE IF z 2 THEN IF c 3 THEN a 1 ELSE a 3 ELSE NOP A 0 A 3 A 1 Z 1 Z 2 C 3 C 2 True False True False True False True Fals...

Page 59: ...EN instruction OTHERWISE instruction s END The language processor scans the WHEN clauses starting at the beginning until it finds a true expression After it finds a true expression it ignores all othe...

Page 60: ...month 2 this can be 28 or 29 ANSWER 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 1...

Page 61: ...Hello You can also use a variable in place of a constant as in the following example which gives you the same results number 5 DO number SAY Hello END A variable that controls the number of times a l...

Page 62: ...when number reached 11 Infinite Loops What happens when the control variable of a loop cannot attain the last number For example in the following program segment count does not increase beyond 1 DO co...

Page 63: ...loop DO count 1 TO 10 IF count 8 THEN ITERATE ELSE SAY Number count END This example results in a list of numbers from 1 to 10 with the exception of number 8 REXX This program processes strings until...

Page 64: ...lts of the repetitive loops are as follows a 1 2 3 Digit is now 4 b 10 8 6 Count is now 4 c Index is now 10 2 The program would be unable to leave the loop because Quit is not equal to QUIT In this ca...

Page 65: ...e first PULL of the following example Exercise Using a DO WHILE Loop Write a program with a DO WHILE loop that uses as input a list of responses about whether passengers on a commuter airline want a w...

Page 66: ...XX This program uses a DO WHILE loop to keep track of window seats in an 8 seat commuter airline window_seats 0 Initialize window seats to 0 passenger 0 Initialize passengers to 0 DO WHILE passenger 8...

Page 67: ...d DO UNTIL loops check for false expressions which means their logical operators are often reversed REXX This program uses a DO UNTIL loop to ask for a password If the password is incorrect three time...

Page 68: ...quantity number SAY Quantity quantity Loop number END Nested DO Loops Like nested IF THEN ELSE instructions DO loops can contain other DO loops A simple example follows REXX This program uses a DO UNT...

Page 69: ...HEN ELSE instruction that includes a LEAVE instruction after the IF instruction DO outer 1 TO 2 DO inner 1 TO 2 IF inner 1 THEN LEAVE inner ELSE SAY HIP END SAY HURRAH END The result is as follows HIP...

Page 70: ...IT can also return a value to the caller of the program If the program was called as a subroutine from another REXX program the value is received in the REXX special variable RESULT If the program was...

Page 71: ...ontrol to a label specified after the CALL keyword When the subroutine ends with the RETURN instruction the instructions following CALL are processed instruction s EXIT sub1 instruction s RETURN instr...

Page 72: ...IGNAL instruction see section SIGNAL on page 164 In the following example if the expression is true then the language processor goes to the label Emergency and skips all instructions in between Emerge...

Page 73: ...the function if any There can be no space between the function name and the left parenthesis function arguments A function call can contain up to 20 arguments separated by commas Arguments can be v Co...

Page 74: ...ersion functions Convert one type of data representation to another type of data representation v Formatting functions Manipulate the characters and spacing in strings supplied in the argument v Strin...

Page 75: ...er that does not match DATATYPE Returns a string indicating the input string is a particular data type such as a number or character SYMBOL Returns VAR LIT or BAD to indicate the state of the symbol v...

Page 76: ...the first character of a specified string found in the input string INSERT Returns a character string after inserting another input string into it from a specified character position LASTPOS Returns t...

Page 77: ...source file or the source line a number specifies TIME Returns the local time in the default 24 hour clock format hh mm ss or in one of various optional formats TRACE Returns the trace actions curren...

Page 78: ...tions LENGTH see page 188 and SUBSTR see page 192 ANSWER REXX This program tests the length of a file name If the name is longer than 8 characters the program truncates extra characters and sends a me...

Page 79: ...ween the function name and the left parentheses The function call is part of an instruction for example an assignment instruction z function argument1 argument2 v Returning a value from a subroutine A...

Page 80: ...y follows the subroutine call The instruction that returns control is the RETURN instruction instruction s EXIT sub1 instruction s RETURN instruction s CALL sub1 A function is a series of instructions...

Page 81: ...nternal function named func1 IMPORTANT NOTE Because internal subroutines and functions generally appear after the main part of the program when you have an internal subroutine or function it is import...

Page 82: ...me variables Therefore you can use commonly shared variables to pass information between caller and internal subroutine or function You can also use arguments to pass information to and from an intern...

Page 83: ...ecause the subroutine returns to the main program with i 6 REXX This program receives a calculated value from an internal subroutine and uses that value in a SAY instruction number1 5 number2 10 CALL...

Page 84: ...ed variables 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...

Page 85: ...Using the PROCEDURE Instruction REXX This program does not use a PROCEDURE instruction to protect the variables within its subroutine number1 10 CALL subroutine SAY number1 number2 Produces 7 5 EXIT s...

Page 86: ...t 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 Example of Function without t...

Page 87: ...with templates see section Parsing Data on page 73 In the following example the main routine sends information to a subroutine that computes the perimeter of a rectangle The subroutine returns a valu...

Page 88: ...2 puts the second argument into width For more information about the ARG function see section ARG on page 134 Receiving Information from a Subroutine or Function Although a subroutine or function can...

Page 89: ...simulated coin toss game The input can be heads tails or null to quit the game First an internal subroutine checks input for validity An external subroutine uses the RANDOM built in function to obtai...

Page 90: ...orrect SELECT WHEN flip HEADS THEN outcome correct WHEN flip TAILS THEN outcome correct WHEN flip THEN EXIT OTHERWISE outcome incorrect PULL flip END END RETURN Figure 42 Possible Solution Internal Su...

Page 91: ...le variable sum 0 initialize sum to zero DO n 1 TO WORDS numlist Repeat for as many times as there are numbers number WORD numlist n Word n goes to number sum sum number Sum increases by number END av...

Page 92: ...TURN instruction to return to the caller Differences between Subroutines and Functions Subroutines Functions Calling Call by using the CALL instruction followed by the subroutine name and optionally u...

Page 93: ...h a period at the end Here are some examples of stems FRED Array employee A tail is similar to a subscript It follows the stem and consists of additional parts of the name that can be constant symbols...

Page 94: ...an array the same way For example to change all employee names to Nobody use the following assignment instruction employee Nobody As a result all compound variables beginning with the stem employee pr...

Page 95: ...ion Parsing with Patterns on page 75 explains patterns Parsing Instructions The REXX parsing instructions are PULL ARG and PARSE PARSE has several variants PULL Instruction Other chapters show PULL as...

Page 96: ...ariables If you do not want uppercase translation use the PARSE ARG instruction instead of ARG REXX program using PARSE ARG PARSE ARG word1 word2 word3 word1 contains Knowledge word2 contains is word3...

Page 97: ...ar1 var2 var3 var1 contains More var2 contains words var3 contains in data Parsing into words generally removes leading and trailing blanks from each word before putting it into a variable However whe...

Page 98: ...he comma is the string separator Number You can use numbers in a template to indicate the column at which to separate data An unsigned integer indicates an absolute column position A signed integer in...

Page 99: ...s is bl part4 contains iss 5 part2 means parsing puts into part2 data starting in column 6 1 5 6 5 part3 means data put into part3 starts with column 11 6 5 11 and so on The use of the minus sign is s...

Page 100: ...String Two String Three EXIT sub2 PARSE ARG word1 word2 word3 string2 string3 word1 contains String word2 contains One word3 contains string2 contains String Two string3 contains String Three The fir...

Page 101: ...PARSE VAR quote 1 v1 11 v2 6 v3 4 v4 a v1 b v2 c v3 d v4 8 first 7 quote Experience is the best teacher 1 2 3 PARSE VAR quote 1 v1 first v2 6 v3 a v1 b v2 c v3 9 quote1 Knowledge is power quote2 Ignor...

Page 102: ...tains 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 v...

Page 103: ...ge 273 When a program issues a command the REXX special variable RC is set to the return code A program can use the return code to determine a course of action within the program Every time a command...

Page 104: ...ions ARG number1 number2 number3 number4 answer number1 number2 number3 number4 RETURN answer Issuing Commands from a program The following sections explain what a host command environment is how comm...

Page 105: ...ion followed by the name of an environment The ADDRESS instruction has two forms one affects only a single command and one affects all commands issued after the instruction v Single command When an AD...

Page 106: ...84 CICS TS for VSE ESA REXX Guide...

Page 107: ...ET TERMOUT command TRACE E When you specify TRACE E in a program the language processor traces any host command that results in a nonzero return code after execution and sends the return code from the...

Page 108: ...option of a TRACE instruction for example TRACE A There can be no blank s between the question mark and the option Interactive debug is not carried over into external routines that are called but is...

Page 109: ...d provide input of another TRACE instruction with before the option to end interactive debug but continue tracing with the specified option v Use TRACE with no options as input If you specify TRACE wi...

Page 110: ...88 CICS TS for VSE ESA REXX Guide...

Page 111: ...rogram that invites the user to play Heads or tails The game can be played as long as the user likes To end the game the user should reply Quit in answer to the question Heads or tails The program is...

Page 112: ...in 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 TA...

Page 113: ...er a number between 0 and 2 to say how far to the right you want to run say Be careful if you enter a number greater than 2 then the mouse will freeze and the cat will move say Parameters that can be...

Page 114: ...hen 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...

Page 115: ...r 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 Co...

Page 116: ...cation complete Stepwise Refinement An Example Granny is going to knit you a warm woolen garment to wear when you go sailing This is what she might do 1 Knit front 2 Knit back 3 Knit left arm 4 Knit r...

Page 117: ...ine v Simpler processing v And therefore simpler code If your pieces really are simpler they will probably have simpler names too For instance v Knit cuff rather than v Make ribbing for cuffs and wais...

Page 118: ...to read Naturally easy to read means different things to different programmers All we can do here is to give examples of different styles and leave you to choose the style you prefer A very good way...

Page 119: ...forever call display pull move if datatype move whole move 0 move 2 then select when mouse move len then nop when cat mouse mouse move cat then mouse cat otherwise mouse mouse move end if mouse hole t...

Page 120: ...whole move 0 move 2 then select when mouse move len then nop hits wall when cat mouse mouse move cat hits cat then mouse cat otherwise moves mouse mouse move end if mouse hole then leave reaches hole...

Page 121: ...t and loses game OTHERWISE mouse mouse move mouse END moves to new location IF mouse hole THEN LEAVE mouse is home safely IF mouse cat THEN LEAVE mouse hits cat ouch Cat s turn jump RANDOM 1 spring de...

Page 122: ...100 CICS TS for VSE ESA REXX Guide...

Page 123: ...Part 2 Reference Copyright IBM Corp 1992 2009 101...

Page 124: ...102 CICS TS for VSE ESA REXX Guide...

Page 125: ...erence This part of the book is a reference rather than a tutorial It assumes you are already familiar with REXX programming concepts The material in this reference is arranged in chapters v Chapter 1...

Page 126: ...environment This is because it provides a fast development cycle source level interactive debug and a native CICS based development environment in one integrated package Note REXX execs can freely in...

Page 127: ...as commands written in Assembler or other languages Also commands can be quickly written in REXX to speed systems development in a building block structure and then can selectively be rewritten in Ass...

Page 128: ...INSERT GRANT INSERT LABEL ON LOCK REVOKE SELECT UPDATE You cannot use the following SQL statements BEGIN DECLARE SECTION CLOSE COMMIT CONNECT DECLARE CURSOR DESCRIBE END DECLARE SECTION EXECUTE EXECUT...

Page 129: ...onal_choice v An arrow returning to the left above the main line indicates an item that can be repeated STATEMENT repeatable_item A repeat arrow above a stack indicates that you can repeat the items i...

Page 130: ...Introduction 108 CICS TS for VSE ESA REXX Guide...

Page 131: ...0 characters You can use compound symbols such as NAME Y Z where Y and Z can be the names of variables or can be constant symbols for constructing arrays and for other purposes REXX programs can resid...

Page 132: ...ge specifies the encodings for each character in a set You should be aware that v Some code pages do not contain all characters that REXX defines as valid for example the logical NOT character v Some...

Page 133: ...e of a function If followed immediately by the symbol X or x it is considered to be a hexadecimal string If followed immediately by the symbol B or b it is considered to be a binary string Description...

Page 134: ...ed by the symbol b or B Neither b nor B can be part of a longer symbol The blanks which may be present only at byte or nibble boundaries and not at the beginning or end of the string are to aid readab...

Page 135: ...al digits defining the power of 10 Whenever a character string is used as a number rounding may occur to a precision specified by the NUMERIC DIGITS instruction default nine digits See pages 217 224 f...

Page 136: ...he A and the and between the and the 3 are removed However one of the blanks between the REPEAT and the A remains as an operator Thus this clause is treated as though written REPEAT A 3 Implied Semico...

Page 137: ...e of that variable is used Otherwise a symbol is treated as a constant string A symbol can also be compound v Function calls see page 171 which are of the form symbol literal_string expression Evaluat...

Page 138: ...terms are syntactically distinct such as a literal string and a symbol or when they are separated only by a comment Examples An example of syntactically distinct terms is if Fred has the value 37 4 th...

Page 139: ...perators also do not attempt to perform a numeric comparison on the two operands For all the other comparison operators if both terms involved are numeric a numeric comparison in which leading zeros a...

Page 140: ...bexpression between the parentheses is evaluated immediately when the term is required v When the sequence term1 operator1 term2 operator2 term3 is encountered and operator2 has a higher precedence th...

Page 141: ...unction xxx XXX 000000 0E0000 1 that is True Note The last example would give a different answer if the operator had been used rather than Because 0E0000 is a valid number in exponential notation a nu...

Page 142: ...AL or function invocation You can use DBCS characters See Appendix C Double Byte Character Set DBCS Support on page 395 for more information Instructions An instruction consists of one or more clauses...

Page 143: ...mbol in an expression even if you have not assigned it a value because a symbol has a defined value at all times A variable you have not assigned a value is uninitialized Its value is the characters o...

Page 144: ...value of a tail can be any character string including the null string and strings containing blanks For example taila tailb stem taila 99 stem tailb stem taila say stem tailb Displays 99 But the follo...

Page 145: ...ables effecting a form of associative memory content addressable Implementation maximum The length of a variable name before and after substitution cannot exceed 250 characters Stems A stem is a symbo...

Page 146: ...a keyword instruction This is not a restriction because you can ensure the clause is processed as a command in several ways such as by putting a null string before the first name or by enclosing the...

Page 147: ...ose on page 166 Here is an example of submitting a command to the default REXX CICS command environment The sequence TSQ1 TSQUEUE1 EXECIO READ TSQ1 MYDATA results in the string EXECIO READ TSQUEUE1 MY...

Page 148: ...xec name is expected as the first blank delimited token in the COMMAREA Note A utility called REXXTRY CICRXTRY exec is provided with REXX CICS that allows the interactive execution of REXX instruction...

Page 149: ...es For more information on the DEFCMD command see section DEFCMD on page 332 Support of Standard REXX Features This section discusses the support of standard REXX features such as SAY and TRACE statem...

Page 150: ...and services issuing user applications from execs REXX interfaces to CICS temporary and transient storage queues pseudo conversational transaction support and DBCS support CICS Mapped I O Support Sup...

Page 151: ...included in SAA Level 2 REXX are available to the REXX CICS user Miscellaneous Features v A TERMID command has been provided to return the four character terminal identifier of a CICS user v A retriev...

Page 152: ...REXX General Concepts 130 CICS TS for VSE ESA REXX Guide...

Page 153: ...Note that any clause that starts with a keyword defined by REXX cannot be a command Therefore arg fred rest is an ARG keyword instruction not a command that starts with a call to the ARG built in fun...

Page 154: ...ors and failures in commands processed in this way are trapped or traced as usual Example ADDRESS CICS READQ TSQ QUEUE QUEUE1 INTO VAR1 CICS If you specify only environment a lasting change of destina...

Page 155: ...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 usi...

Page 156: ...ing them Use the PARSE ARG instruction if you do not want uppercase translation You can use the ARG and PARSE ARG instructions repeatedly on the same source string or strings typically with different...

Page 157: ...ame program as the CALL instruction or function call that calls it If name is a string that is you specify name in quotation marks the search for internal routines is bypassed and only a built in func...

Page 158: ...ion on the PROCEDURE instruction can expose selected variables to a routine Calling an external program as a subroutine is similar to calling an internal routine The external routine however is an imp...

Page 159: ...r commands see section ADDRESS on page 132 are saved and then restored on return v Condition traps CALL ON and SIGNAL ON are saved and then restored on return This means that CALL ON CALL OFF SIGNAL O...

Page 160: ...uding any of the more complex constructs such as IF SELECT and the DO instruction itself v The subkeywords WHILE and UNTIL are reserved within a DO instruction in that they cannot be used as symbols i...

Page 161: ...ilar to the distinction between a command and an assignment if the first token of exprr is a symbol and the second token is or starts with the controlled form of repetitor is expected Controlled Repet...

Page 162: ...cked at the start of each iteration Example Do Y 0 3 to 4 3 by 0 7 for 3 Displays say Y 0 3 end 1 0 1 7 In a controlled loop the name describing the control variable can be specified on the END clause...

Page 163: ...s is exceeded Discontinue execution of DO group if FOR value number of iterations through the loop is exceeded Discontinue execution of DO group if WHILE condition is not met Discontinue execution of...

Page 164: ...parated by blanks except that no parentheses are allowed Variables are dropped in sequence from left to right It is not an error to specify a name more than one time or to DROP a variable that is not...

Page 165: ...ller If the program was called as an external function this is detected as an error either immediately if RETURN was used or on return to the caller if EXIT was used Running off the end of the program...

Page 166: ...rrors and possible confusion when IF constructs are nested as in the following example Example If answer YES Then If name FRED Then say OK Fred Else nop Else say Why not Notes 1 The instruction can be...

Page 167: ...expression during execution if one was not supplied Example data FRED interpret data 4 Builds the string FRED 4 and Processes FRED 4 Thus the variable FRED is set to 4 Example data do 3 say Hello ther...

Page 168: ...uch the second trace flag under line 5 and is then processed Again a literal string is concatenated to the value of a variable NAME and another literal and the final result Hello Kitty is then display...

Page 169: ...rmost and this is the loop that is stepped Any active loops inside the one selected for iteration are ended as though by a LEAVE instruction Example do i 1 to 4 if i 2 then iterate say i end Displays...

Page 170: ...the innermost and that loop and any active loops inside it is then ended Control then passes to the clause following the END that matches the DO clause of the selected loop Example do i 1 to 5 say i...

Page 171: ...erwise say A C end 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 af...

Page 172: ...ult is SCIENTIFIC The subkeywords SCIENTIFIC or ENGINEERING set the FORM directly or it is taken from the result of evaluating the expression expression2 that follows VALUE The result in this case mus...

Page 173: ...cifies that any data in strings is handled on a byte basis The integrity of DBCS characters if any may be lost NOEXMODE is the default Notes 1 Because of the language processor s scanning procedures y...

Page 174: ...you specify the UPPER option the data to be parsed is first translated to uppercase that is lowercase a z to uppercase A Z Otherwise no uppercase translation takes place during the parsing The followi...

Page 175: ...ters CICS 2 The string COMMAND FUNCTION or SUBROUTINE depending on whether the program was invoked as some kind of host command from a function call in an expression by a CALL instruction or as a serv...

Page 176: ...guage 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 proc...

Page 177: ...nce the values of existing variables are accessible and any changes are persistent even on RETURN from the routine If name is not enclosed in parentheses it identifies a variable you want to expose an...

Page 178: ...ay a j k m Displays j k m 1 6 9 return You can use subsidiary lists to more easily expose a number of variables at one time or with the VALUE built in function to manipulate dynamically named variable...

Page 179: ...r C A 1 7 This sets A 1 in the caller s environment even if it did not previously exist return Variables may be exposed through several generations of routines if desired by ensuring that they are inc...

Page 180: ...desire uppercase translation Notes 1 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 emp...

Page 181: ...program stack If the program stack is empty a terminal read occurs The program stack for you is in an RLS queue named SYSTEM rexxtnum PROGSTACK where rexxtrnum is an internal REXX task number For info...

Page 182: ...rogram stack The language processor reads a line from the program stack If the program stack is empty a terminal read occurs The program stack for you is in an RLS queue named SYSTEM rexxtnum PROGSTAC...

Page 183: ...ecomes uninitialized The various settings saved at the time of the CALL tracing addresses and so forth are also restored see page Purpose on page 135 If a function is being processed the action taken...

Page 184: ...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 Example data 100 Say...

Page 185: ...till have balance dollars left when balance 0 then do say Warning Balance is now zero STOP all spending say You cut it close this month Hope you do not have any say checks left outstanding end Otherwi...

Page 186: ...w you enter them in the program Similarly for SIGNAL VALUE the expression must evaluate to a string in uppercase or the language processor does not find the label You can omit the subkeyword VALUE if...

Page 187: ...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 One...

Page 188: ...Null The symbol is taken as a constant and is therefore v A numeric option v One of the valid prefix or alphabetic character word options described later The option that follows TRACE or the result o...

Page 189: ...al This is valid only if the TRACE S clause itself is not nested in any other instruction including INTERPRET or interactive debug or in an internal routine Prefix Options The prefixes and are valid e...

Page 190: ...hen a loop is being traced the DO clause itself is traced on every iteration of the loop 2 You can retrieve the trace actions currently in effect by using the TRACE built in function see section TRACE...

Page 191: ...ion call L The data traced is a literal string uninitialized variable or constant symbol O The data traced is the result of an operation on two terms P The data traced is the result of a prefix operat...

Page 192: ...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 Example a1 Hello b1 there Uppe...

Page 193: ...nt which has no effect can appear between the name and the left parenthesis The arguments are evaluated in turn from left to right and the resulting strings are all then passed to the function This th...

Page 194: ...uilt in These functions are always available and are defined in the next section of this manual External You can write or use functions that are external to your program and to the language processor...

Page 195: ...command fails with a return code of 4 1 Within the current exec for an internal function or subroutine Note This search can be bypassed by explicitly identifying the function or subroutine as external...

Page 196: ...ptions of DATATYPE This is not true for RANDOM v Any argument named as a string may be a null string v If an argument specifies a length it must be a positive whole number or zero If it specifies a st...

Page 197: ...f desired for example say Enter option pull option select keyword1 is to be the default when abbrev keyword1 option then when abbrev keyword2 option then otherwise nop end ABS Absolute Value ABS numbe...

Page 198: ...rings is the largest number n for which ARG n e would return 1 or 0 if there are no explicit argument strings That is it is the position of the last explicitly specified argument string 2 Programs cal...

Page 199: ...cally eXclusive 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 If no pad character is p...

Page 200: ...e character than the left hand end Here are some examples CENTER abc 7 ABC CENTER abc 8 ABC CENTRE The blue sky 8 e blue s CENTRE The blue sky 7 e blue Note To avoid errors because of the difference b...

Page 201: ...ll four cases Here are some examples CONDITION CALL perhaps CONDITION C FAILURE CONDITION I CALL CONDITION D FailureTest CONDITION S OFF perhaps Note The CONDITION function returns condition informati...

Page 202: ...format that represents string converted to hexadecimal The returned string contains twice as many bytes as the input string For example on an EBCDIC system C2X 1 returns F1 because the EBCDIC represe...

Page 203: ...pear only between pairs of hexadecimal characters Also returns 1 if string is a null string which is a valid hexadecimal string Here are some examples DATATYPE 12 NUM DATATYPE CHAR DATATYPE 123 CHAR D...

Page 204: ...January 2000 to 2 January 2000 Days returns the number of days including the current day so far in this year in the format ddd no leading zeros or blanks European returns date in the format dd mm yy J...

Page 205: ...hat starts at the nth word and is of length blank delimited words If you omit length or if length is greater than the number of words from n to the end of string the function deletes the remaining wor...

Page 206: ...r result is possible if it has additional leading sign characters 00 x and FF x D2X Decimal to Hexadecimal D2X wholenumber n returns a string in character format that represents wholenumber a decimal...

Page 207: ...nction always returns a 0 FIND WORDPOS is the preferred built in function for this type of word search See page 198 for a complete description FIND string phrase returns the word number of the first w...

Page 208: ...ccording to the current NUMERIC settings of DIGITS and FORM The expp sets the number of places for the exponent part the default is to use as many as needed which may be zero The expt sets the trigger...

Page 209: ...for length is the length of new If length is less than the length of the string new then INSERT truncates new to length length The default pad character is a blank Here are some examples INSERT abcde...

Page 210: ...string The string returned is padded with pad characters or truncated on the right as needed The default pad character is a blank length must be a positive whole number or zero The LEFT function is ex...

Page 211: ...rget n length pad returns the string target which starting at the nth character is overlaid with the string new padded or truncated to length length The overlay may extend beyond the end of the origin...

Page 212: ...gument as described in Note 1 This seed must be a positive whole number ranging from 0 to 999999999 Here are some examples RANDOM 305 RANDOM 5 8 7 RANDOM 2 0 0 to 2 RANDOM 1983 123 reproducible Notes...

Page 213: ...en carried out Returns 1 if number is less than 0 returns 0 if it is 0 and returns 1 if it is greater than 0 Here are some examples SIGN 12 3 1 SIGN 0 307 1 SIGN 0 0 0 SOURCELINE SOURCELINE n returns...

Page 214: ...the default is a blank If you specify char it must be exactly one character long Here are some examples STRIP ab c ab c STRIP ab c L ab c STRIP ab c t ab c STRIP 12 7000 0 12 7 STRIP 0012 700 0 12 7 S...

Page 215: ...expression to prevent substitution before it is passed to the function Here are some examples following Drop A 3 J 3 SYMBOL J VAR SYMBOL J LIT has tested 3 SYMBOL a j LIT has tested A 3 SYMBOL 2 LIT a...

Page 216: ...in the format sssss no leading zeros or blanks except for a result of 0 Here are some examples assuming that the time is 4 54 p m TIME 16 54 22 TIME C 4 54pm TIME H 16 TIME L 16 54 22 123456 Perhaps T...

Page 217: ...licates in tablei the first leftmost occurrence is used If the character is not found the original character in string is used The result string is always the same length as string The tables can be o...

Page 218: ...and optionally assigns it a new value By default VALUE refers to the current REXX variables environment however if you want to specify selector the value must be RLS If the selector of RLS is specifi...

Page 219: ...All characters following it are ignored and it can be in upper or lowercase as usual If you specify Match the function returns the position of the first character in string that is in reference or re...

Page 220: ...contains no words or if phrase is not found Multiple blanks between words in either phrase or string are treated as a single blank for the comparison but otherwise the words must match exactly By def...

Page 221: ...f four and does not include any blanks If hexstring is null the function returns a null string Here are some examples X2B C3 11000011 X2B 7 0111 X2B 1 C1 000111000001 You can combine X2B with the func...

Page 222: ...otation In both cases it is converted to a whole number which may therefore be negative If n is 0 the function returns 0 If necessary hexstring is padded on the left with 0 characters note not sign ex...

Page 223: ...following results vary from system to system STORAGE 200000 32 This returns 32 bytes of storage at hex address 200000 as a result SYSSBA SYSSBA row col SYSSBA converts screen row col to a set buffer a...

Page 224: ...Functions 202 CICS TS for VSE ESA REXX Guide...

Page 225: ...ing patterns 2 Parse each substring into words Simple Templates for Parsing into Words Here is a parsing instruction parse value time and tide with var1 var2 var3 The template in this instruction is v...

Page 226: ...emoves leading and trailing blanks from each word before it is assigned to a variable The exception to this is the word or group of words assigned to the last variable The last variable in a template...

Page 227: ...es contrast simple templates with templates containing literal string patterns Simple template name Smith John parse var name ln fn Assigns ln Smith fn John Notice that the comma remains the variable...

Page 228: ...seful for working with a file of records such as character positions 1 11 21 40 end of FIELDS LASTNAME FIRST PSEUDONYM record The following example uses this record structure Parsing with absolute pos...

Page 229: ...d a positional pattern follows the variable name The templates from the examples of absolute and relative positional patterns give the same results lastname 11 firstname 21 pseudonym lastname 10 first...

Page 230: ...hn init Q ln Public The pattern divides the template into two sections v fn init v ln The matching pattern splits the source string into two substrings v John Q v Public The language processor parses...

Page 231: ...l date parse var date month 3 delim 1 day 2 delim year Sets month 11 delim day 15 year 90 If an equal a plus or a minus sign precedes the left parenthesis then the value of the variable is treated as...

Page 232: ...list when you call the program or arguments in the call to a subroutine or function PARSE EXTERNAL Next line from terminal input buffer PARSE NUMERIC Numeric control information from NUMERIC instruct...

Page 233: ...m Displays 9 0 SCIENTIFIC if defaults are in effect PARSE PULL PUSH 80 7 Puts data on queue parse pull fourscore seven Assigns fourscore 80 seven 7 SAY fourscore seven Displays 87 PARSE SOURCE parse s...

Page 234: ...ing String and Positional Patterns A Special Case There is a special case in which absolute and relative positional patterns do not work identically We have shown how parsing with a template containin...

Page 235: ...ng string end is the end of the source string or substring length is the length of the source string match start is in the source string and is the first character of the match match end is in the sou...

Page 236: ...Match start 1 Match end 1 yes End of template Parsing complete no CALL Find Next Pattern CALL Word Parsing Step to next token yes Token a comma Set next source string and template no Figure 50 Concept...

Page 237: ...s Variable yes Resolve String start match end equal form its value Match start min length 1 value Match end match start Return no no Token a yes String start match end number Match start min length 1...

Page 238: ...od yes no Any more tokens yes Next token a variable or no Assign rest of substring period to variable yes no Any substring left Assign null string to variable yes Strip any leading blanks no Any subst...

Page 239: ...us and prefix minus In addition there are two further division operators integer divide divides and returns the integer part remainder divides and returns the remainder The result of an arithmetic ope...

Page 240: ...ch calculations are carried out Results are rounded to that precision if necessary If you do not specify expression in this instruction or if no NUMERIC DIGITS instruction has been processed since the...

Page 241: ...eet your requirements Arithmetic Operation Rules Basic Operators The basic operators addition subtraction multiplication and division operate on numbers as follows Addition and Subtraction If either n...

Page 242: ...ated upon is arbitrary The operations may be carried out as integer operations with the exponent being calculated and applied afterward Therefore the significant digits of a result are not in any way...

Page 243: ...requires 10 digits for the result 3333333333 and would therefore fail if NUMERIC DIGITS 9 were in effect Note that this operator may not give the same result as truncating regular division which could...

Page 244: ...instruction NUMERIC FUZZ expression Here expression must result in a positive whole number or zero The default is 0 The effect of FUZZ is to temporarily reduce the value of DIGITS by the FUZZ value fo...

Page 245: ...00 Displays 1 0e123 0e456 Displays 1 0e123 0e456 Displays 0 The preceding numbers are valid for input data at all times The results of calculations are returned in either conventional or exponential f...

Page 246: ...umber had been added to 0 In the following cases the number used must be a whole number and the largest number you can use is 999999999 v The positional patterns in parsing templates including variabl...

Page 247: ...o raised if any command indicates failure and neither CALL ON FAILURE nor SIGNAL ON FAILURE is active The condition is raised at the end of the clause that called the command but is ignored if the ERR...

Page 248: ...urs instead of the usual flow of control a CALL trapname or SIGNAL trapname instruction is processed automatically You can specify the trapname after the NAME subkeyword of the CALL ON or SIGNAL ON in...

Page 249: ...goes directly to the function rather than searching for an internal label 2 In all cases the condition is raised immediately upon detection If SIGNAL ON traps the condition the current instruction is...

Page 250: ...hose attempted reference caused the NOVALUE condition The NOVALUE condition trap can be enabled only using SIGNAL ON SYNTAX Any string the language processor associated with the error This can be the...

Page 251: ...ional failure of a function call as in the following example signal on syntax a a 1 This is to create a syntax error say SYNTAX error not raised exit Standard handler for SIGNAL ON SYNTAX syntax say R...

Page 252: ...230 CICS TS for VSE ESA REXX Guide...

Page 253: ...n identifier with no exec name the IBM supplied REXXTRY interactive utility CICRXTRY exec is issued REXXTRY provides an interactive shell for performing REXX statements and commands While you are in t...

Page 254: ...This is distinguished from the rest by being highlighted and it is the line most of the command line commands affect The command line lets you interact with the editor on a high level basis All of th...

Page 255: ...hat allows a replication factor is the replicate command So when you specify a number with the replicate block command you need to know how many times you want the block not individual lines replicate...

Page 256: ...ent edit screen Command Line Commands The syntax and description for each of the command line commands follows ARBCHAR ARBCHAR arbchar ARBCHAR sets the arbitrary characters Operands arbchar specifies...

Page 257: ...edited passing it the arguments defined in line one The last line deletes the arguments BACKWARD BAckward 1 n BACKWARD scrolls backward toward the beginning of a file for a specified number of screen...

Page 258: ...saving changes and without any warning messages that changes have been made 2 CANCEL is a synonym for QQUIT CASE CASE 1 MIXED RESPECT IGNORE UPPER RESPECT IGNORE Notes 1 The default is set in the use...

Page 259: ...ines from the current line to the end of the file are changing is the delimiting character Return Codes 0 Normal return 202 Invalid operand 210 Request failed 223 Search argument not found Example CHA...

Page 260: ...at the following character in the string passed to the RESERVED command is a control character PROTECT specifies that the string passed to the RESERVED command is protected from user input NOPROTECT s...

Page 261: ...he current edit screen Return Codes 0 Normal return 210 Request failed Example DISPLAY This example displays the current edit screen Note The DISPLAY command is only useful when it runs from a macro I...

Page 262: ...ple opens an edit session for the file TEST EXEC Notes 1 The directory used when editing a file is determined as follows v If a fully qualified directory ID is explicitly given then it is always used...

Page 263: ...XX program name to execute If you do not specify a name the last saved copy of the file that is currently being edited will be executed If any arguments have been defined using the ARGS command these...

Page 264: ...a search is performed on the previous search string previous_searcharg Return Codes 0 Normal return 202 Invalid operand 223 Search argument not found Examples FIND REDT This example finds the first o...

Page 265: ...lls to the bottom of the file and the current line is set to the last line of data If n is not specified the screen scrolls forward one display Return Codes 0 Normal return 202 Invalid operand Example...

Page 266: ...uts it after the current line in an edit session Note GETLIB is the VSE equivalent of the GETPDS function available with CICS ESA INPUT Input 1 text Notes 1 If text is not specified the new line is bl...

Page 267: ...erand 210 Request failed Example LEFT 20 This example scrolls left 20 characters to the left LINEADD LINEADD LINEADD adds a blank line after the cursor line Return Codes 0 Normal return 230 Cursor is...

Page 268: ...made to call an exec with that suffix Otherwise an attempt is made to call an exec whose suffix is EXEC Return Codes n specifies the return code set by the exit of the called exec 0 Normal return 3 Ex...

Page 269: ...ritten with trailing blanks or trailing nulls Operands ON specifies that fields on the screen are written with trailing nulls OFF specifies that fields on the screen are written with trailing blanks R...

Page 270: ...ocesses a program function PF key Operands number specifies the PF key that is set or processed text specifies the text that the PF key is set to If you do not specify text the PF key is processed Ret...

Page 271: ...rn Codes 0 Normal return Example QQUIT This example quits the current editor session unconditionally without saving any file changes Notes 1 QQUIT lets you exit the editor without saving changes and w...

Page 272: ...on page 247 NUMBERS displays the current setting of NUMBERS For more information see the Text Editor command section NUMBERS on page 247 PFKLINE displays the current setting of the PFKLINE For more i...

Page 273: ...OFF is a keyword specifying that the line is freed from its reserved state text specifies a string of text with optional control characters that is displayed on the reserved line Return Codes 0 Normal...

Page 274: ...ide of the record scrolling stops at the right side of the record SAVE Save 1 fileid Notes 1 If fileid is not specified the file is saved as the default file ID SAVE saves a file to an RFS file or VSE...

Page 275: ...column tocol specifies that the lines are sorted on data ending in this column Return Codes 0 Normal return 202 Invalid operand 229 Number out of range Example SORT A 5 10 This example sorts all line...

Page 276: ...y valid command that executes the command action for which it is a synonym command specifies any valid command Return Codes 0 Normal return Example SYNONYM GL GETLIB This example makes GL equivalent t...

Page 277: ...bers that require removing The editor does not currently have support for placing or maintaining sequence numbers in a file UP UP 1 number UP scrolls backward in the file towards the top of the file O...

Page 278: ...256 CICS TS for VSE ESA REXX Guide...

Page 279: ...s directory can contain files as well as subdirectories A subdirectory is a directory within another directory Subdirectories can be created within any other directory A new directory can be created w...

Page 280: ...first in the search order when working with REXX File System RFS The current directory can be set using the CD command see section CD on page 321 The CD command has a similar format to the IBM Person...

Page 281: ...l of security 2 At the RFS directory level user directories are private directories and can be accessed only by the owning user by default However the owner of a directory can use the RFS AUTH command...

Page 282: ...ion RFS on page 363 Example RFS AUTH POOL1 USERS USER1 DOCS PUBLICR This example makes directory DOCS a public directory All users have read only access to the files in directory DOCS CKDIR RFS CKDIR...

Page 283: ...get file fileid2 already exists the contents of fileid1 replaces it Return Codes See the RFS command section RFS on page 363 Example RFS COPY POOL1 USERS USER1 TEST1 EXEC POOL1 USERS USER1 TEST2 EXEC...

Page 284: ...ontains the nth record read from the file DISKW RFS DISKW DATA fileid stem DISKW writes records to an RFS file from a stem The file is overlaid with the data in the stem Operands fileid specifies the...

Page 285: ...new RFS directory level Operands dirid specifies a REXX File System directory identifier This is partially or fully qualified See the CD command section CD on page 321 for more information Return Code...

Page 286: ...he contents of fileid1 replaces it Return Codes See the RFS command section RFS on page 363 Example RFS RENAME POOL1 USERS USER1 TEST1 EXEC POOL1 USERS USER1 TEST2 EXEC This example renames the file P...

Page 287: ...k Macros under the REXX CICS File List Utility The REXX File List Utility supports REXX macros giving the macros the ability to alter the FLST settings and display the FLST screens Macros can process...

Page 288: ...of the file where the results are placed Note If fileid already exists it is replaced Example COPY TEST3 EXEC This example executed from the command column next to TEST1 EXEC creates a new file TEST3...

Page 289: ...m the command line use the following syntax DOWN n DOWN scrolls down one or more lines Operands n specifies the number of lines to be scrolled down Example DOWN 5 This example scrolls forward through...

Page 290: ...es the return code set by the exit of the called exec 0 Normal return 3 Exec not found 10 Exec name not specified 11 Invalid exec name 12 GETMAIN error 99 Internal error Example EXEC TEST3 PARMS This...

Page 291: ...found 10 Exec name not specified 11 Invalid exec name 12 GETMAIN error 99 Internal error Example MACRO POOL1 USERS USER1 TEST This example calls the macro POOL1 USERS USER1 TEST EXEC Note Macros have...

Page 292: ...ile Operands fileid specifies the new file ID Note If fileid already exists it is replaced Example RENAME TEST4 EXEC This example executed from the command column next to TEST3 EXEC renames TEST3 EXEC...

Page 293: ...s by attribute RC specifies sorting the file by number of records SZ specifies sorting the files by size Example SORT FN This example sorts the file list by file name SYNONYM When you type SYNONYM fro...

Page 294: ...File System except where it is specified differently See the RFS command section RFS on page 363 for more information Running Execs and Transactions from FLST Most REXX CICS execs can be run from FLS...

Page 295: ...ories can be created within any other directory A new directory can be created with the RLS MKDIR command All directories except the root are distinguished by a one to 250 character directory file nam...

Page 296: ...CHARTS are two files CHART1 DATA and CHART2 DATA Current Directory and Path The current list directory is the current working directory and is first in the search order when working with REXX List Sy...

Page 297: ...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 Example RLS CKDIR USERS USER1...

Page 298: ...example pulls a record from the top of the RLS queue QUEUE1 LPUSH RLS QUEUE LPUSH varname queid LPUSH pushes a record onto the top of the RLS queue LIFO Operands varname specifies a simple REXX variab...

Page 299: ...RLS LQUEUE VARA QUEUE1 This example adds a record the contents of VARA to the end of the RLS queue QUEUE1 MKDIR RLS MKDIR dirid MKDIR creates a new RLS directory level Operands dirid specifies a REXX...

Page 300: ...contains the nth record read from the list VARDROP RLS VARDROP varname dirid VARDROP deletes an RLS saved variable Operands varname specifies a simple REXX variable name It does not end in a period d...

Page 301: ...a REXX variable and copies it into an RLS saved variable of the same name Operands varname specifies a simple REXX variable name It does not end in a period distinguishing a variable name from a stem...

Page 302: ...ATA 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 U...

Page 303: ...ce to place single or double quotes around portions of command strings that do not involve REXX variable substitution REXX external functions are traditionally used to extend the capabilities of the R...

Page 304: ...assembler language Assembler language routines must exist in a CICS program properly defined for example by using the CEDA DEFINE PROGRAM command These programs are invoked by an EXEC CICS LINK if th...

Page 305: ...d parameter list of the command line parsed into 8 character tokens followed by a end of list fence of hex high values X FFFFFFFFFFFFFFFF 52 4 EPLIST Address of an extended parameter list which matche...

Page 306: ...address where the address of variable contents are data_len specifies the length of area pointed to by data_addr fullword function_name specifies the particular CICGETV function to be performed There...

Page 307: ...XX CICS DB2 is EXECSQL the command environment that supports SQL Note EXECSQL is an authorized commands You must be a REXX CICS authorized user to use the EXECSQL command environment REXX CICS provide...

Page 308: ...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 v You cannot use the follow...

Page 309: ...ry to build the results area for the SELECT statement SQLCODE etc A set of SQLCA variables are updated after SQL statements are processed The entries of the SQLCA are described in section Using the SQ...

Page 310: ...containing X FF SQLERRP Product code and if there is an error the name of the module that returned the error SQLERRD n Six variables containing diagnostic information The variable n is a number betwe...

Page 311: ...xit 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 DB2 Interface Chapter 22 REXX CICS DB2 Interface 289...

Page 312: ...DB2 Interface 290 CICS TS for VSE ESA REXX Guide...

Page 313: ...external procedure that is called to process subsequent REXX command strings REXX CICS provides the optional ability for the environment name specified in the ADDRESS instruction to be the name of an...

Page 314: ...ICS EXEC TRACE O turn off source tracing ARG parm1 parm2 parm3 CICS READQ TS QUEUE MYQ INTO DATA ITEM 5 NUMITEMS 1 if rc 0 then EXIT 100 SAY TSQ Data data CICS SEND TEXT FROM DATA ERASE Define the SER...

Page 315: ...hen request COMMAND2 then CALL command2 When request STOP then CALL stop_server Otherwise End Select End Do Forever exit subroutine to process command1 Command1 C2S varname WORK WORK WORK 1 S2C WORK v...

Page 316: ...High level Client Server Support 294 CICS TS for VSE ESA REXX Guide...

Page 317: ...d control characters to define a panel layout The control character definition and the panel definition the two parts together are called panel source is saved in the REXX File System v Uses the panel...

Page 318: ...automatic generation is executed whenever the panel object cannot be found or when the panel source has a date or time change that is later than the panel object Any change to the panel source causes...

Page 319: ...let you associate REXX variables with Panel Facility variables Then in your panel definition you can imbed the variable identifier control character instead of the REXX variable name The same REXX va...

Page 320: ...le control character is replaced with the third variable listed for that control character The stem variable is replaced by appending a three character number tail to the stem name The number starts a...

Page 321: ...able starts within the protected field to either the end of the field or the start of the next variable or text NULls specifies that a field will be padded with the null character BLAnks specifies tha...

Page 322: ...en the unprotect and variable control characters When the explicit field length is used a field does not need termination If an explicit length field is the last field of a line then a terminating fie...

Page 323: ...exec or in the REXX interactive environment The REXX interactive environment is an ideal place to test the initial panel development To test display the panel use the TEST panel command This displays...

Page 324: ...panel sent with a position argument needs to be received with the same position values so the operator input is assigned correctly to the REXX variables v Enclose the field ID list within parenthesis...

Page 325: ...tput or generate FIle specifies the name of the RFS directory directory_name containing this panel Specified for all panel commands except END CUrsor specified for SEND and CONVERSE only positions the...

Page 326: ...ement is 4 rows down and 9 columns to the right FReekb specified for SEND and CONVERSE only frees the keyboard allowing operator input This is the default LOckkb specified for SEND and CONVERSE only l...

Page 327: ...aracter fills the character positions that are not occupied by a variable value In a protected field the pad character is similar but the scope of the fill area is not the whole field as in the unprot...

Page 328: ...EA contains state codes and input codes to help in error determination See section State Codes and Input Codes on page 308 for more information PAN LOC Internal location code Three to four digit numbe...

Page 329: ...re out of synchronization 403 Panel object data has been corrupted First check to see the file is correct and that it is a panel object 404 CICS receive buffer corrupted 405 Bad validation request 406...

Page 330: ...ore than one stem name was listed 139 More variable fields defined than listed in the control character definition 140 Explicit input field value caused field to go past screen end 143 Panel name in f...

Page 331: ...MDT 17 Cursor 18 Pad 19 closing parenthesis of the ATTRIBUTE argument Input codes Input codes for 11xx and 20xx location codes 01 field type protect skip unprotect 02 color red blue green 03 Intensity...

Page 332: ...anel generator common processor 11xx DEFINE verb processor 12xx PANEL verb processor 20xx Panel runtime command processor 21xx Dynamic attribute resolution processor 30xx Output 3270 data stream proce...

Page 333: ...mized 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 Notice the position of th...

Page 334: ...a su mo tu we th fr sa su mo tu we th fr sa Leave Calendar Backup a month Go forward a month IF RC 4 PAN REA 124 THEN warning and no input received Example of a REXX Panel Program data base ACCOUNT 12...

Page 335: ...END LEAVE END forever DISP_DATE DATE U set to display current date MSG 1 Be sure cursor is in the first column MSG 2 Press ENTER or and PF key to continue SALUTATION Hi WORD ACCOUNT ACCOUNT_NUM 5 WOR...

Page 336: ...M_OF_DAYS 7 31 NUM_OF_DAYS 8 31 NUM_OF_DAYS 9 30 NUM_OF_DAYS 10 31 NUM_OF_DAYS 11 30 NUM_OF_DAYS 12 31 MONTH_NAME 1 January MONTH_NAME 2 February MONTH_NAME 3 March MONTH_NAME 4 April MONTH_NAME 5 May...

Page 337: ...AY TOT_DAYS NUM_OF_DAYS MONTH 1 7 IF MONTH 12 THEN RIGHT_MONTH 1 ELSE RIGHT_MONTH MONTH 1 DISP_RIGHT_MON MONTH_NAME RIGHT_MONTH right display month name RIGHT_DAYS DO I FIRST_WEEKDAY 1 TO NUM_OF_DAYS...

Page 338: ...ift the months to left CENTER_DAYS I RIGHT_DAYS I END IF MONTH 12 THEN need a new right month RIGHT_MONTH 1 ELSE RIGHT_MONTH MONTH 1 FIRST_WEEKDAY TOT_DAYS NUM_OF_DAYS MONTH 1 7 RIGHT_DAYS DO I FIRST_...

Page 339: ...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...

Page 340: ...318 CICS TS for VSE ESA REXX Guide...

Page 341: ...X variable name which is either the source or the target for the desired data v The same REXX variable should not be used as both the source and target fields on a CICS command If this is done the res...

Page 342: ...USER2 and SYSPGMR REXX CICS authorized users Notes 1 If you are an authorized user you can use REXX CICS authorized commands regardless of whether you are running in an exec that was loaded from an au...

Page 343: ...1 USERS USER1 XYZ The default directory ID for you is poolid USERS userid where poolid is the file pool identifier of the first RFS file pool defined and userid is your CICS signon user ID If you are...

Page 344: ...for execs Commands 322 CICS TS for VSE ESA REXX Guide...

Page 345: ...s the following format v Binary halfword containing inclusive length of field v Binary halfword containing the number of messages produced v Binary halfword containing the highest message severity 0 a...

Page 346: ...riable has the following format v Binary halfword containing inclusive length of field v Binary halfword containing the number of messages produced v Binary halfword containing the highest message sev...

Page 347: ...le If the current directory is USERS USER1 ABC and you enter CLD XYZ the new current directory will be USERS USER1 XYZ The default directory ID for you is USERS genid where genid is your CICS signon u...

Page 348: ...specifies a fully qualified REXX File system file or only the REXX file name If a fully qualified name is not supplied the curent REXX directory is used to store the file Return Codes n specifies the...

Page 349: ...d However the source REXX variable is not altered in this process If this length is omitted then the current length of the source REXX variable is used struct_vname specifies a REXX variable containin...

Page 350: ...working storage VAR1 00000000 x set a REXX variable with 4 bytes of hex COPYR2S VAR1 WORKANC 4 This example requests 200 bytes of virtual storage and copies the hex value of 00000000 x into bytes 4 th...

Page 351: ...However the source REXX variable is not altered in this process If this length is omitted then the current length of the source REXX variable is used struct_vname specifies a REXX variable containing...

Page 352: ...the fullword address in REXX variable WORKANC and copies it to REXX variable VAR1 Notes 1 Anchor addresses are not limited to being set by the GETMAIN command For example a COPYS2R can be used to cop...

Page 353: ...0 Normal return 2440 No variable name specified 2441 Error retrieving variable 2442 Error storing variable 2448 No client available Example C2S VARA VARB This example shows that the contents of the c...

Page 354: ...external environment names known to you can be redefined without breakage of the agents that process these commands If the internal and external names are identical then there is no need for you to sp...

Page 355: ...is command Notes 1 When the REXX CICS environment name is REXXCICS which is the default when all execs or macros are called then the first token of the command string is the environment name that coul...

Page 356: ...om 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 334 CICS TS for VSE ESA REXX Guid...

Page 357: ...the agent that processes the command string This is needed so that the external environment names known to you can be redefined without breakage of the agents that process these commands If the intern...

Page 358: ...nd under the default command environment of REXXCICS by entering CICS SEND arg1 arg2 argn This example shows program SENDPGM being called by an EXEC CICS LINK command to process this command Notes 1 W...

Page 359: ...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...

Page 360: ...retrieving trantable information 1226 Exec name length error 1228 Error setting trantable value 1233 Transaction not found in table Example Define a new CICS transaction ID named XYZ make it call exe...

Page 361: ...number of elements in the entry Refer to section Stems on page 123 for more information If you omit this the contents are displayed on the screen Return Codes 0 Normal return 321 Cannot access curren...

Page 362: ...d specifying a group of instructions applied to the file being edited macroname specifies the file name portion of the profile macro file ID REXX exec name Return Codes 0 Normal return 201 Invalid com...

Page 363: ...cid specifies the 1 to 17 character identifier of the exec args specifies the argument string being passed to the called exec Return Codes n specifies the return code set by the exit of the called exe...

Page 364: ...mber type of PROC is assumed MEM indicates that a member name has been specified name specifies a fully qualified RFS file name or a VSE Librarian sublibrary and member Note The member type must not b...

Page 365: ...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 Commands Chapter 25 REXX CICS Commands 343...

Page 366: ...e of a stem A stem must end in a period Refer to section Stems on page 123 for more information varname specifies a REXX variable name that is the source or target for this EXECIO operation recno spec...

Page 367: ...rds 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...

Page 368: ...not be specified A member type of PROC is assumed name specifies a fully qualified RFS file name or a VSE Librarian sublibrary and member Note For a sublibrary and member the member type must not be s...

Page 369: ...d 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 copi...

Page 370: ...xecs that have been loaded using EXECLOAD Return Codes 0 Normal return 1623 EXECLOAD directory not found Example EXECMAP If the exec POOL1 USERS USER1 TEST EXEC had been EXECLOADed then this display w...

Page 371: ...found 1736 Unexpected CICS error 1738 Invalid VSE Librarian member name 1741 Unsupported record format 1799 Internal error Example EXPORT POOL1 USERS USER1 TEST DATA USER1 TEST MEM1 PROC This example...

Page 372: ...st file in a new RFS file pool ADD adds an additional VSAM file to an existing file pool Return Codes 0 Normal return 1802 Invalid operand 1821 Invalid file pool subcommand 1822 File pool subcommand n...

Page 373: ...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...

Page 374: ...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...

Page 375: ...r 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 Return Codes 0 Normal retu...

Page 376: ...M REXX Development System for CICS TS for VSE ESA online Operands search_term specifies the string you want located Return Codes n specifies the return code passed by from internal RFS or PANEL comman...

Page 377: ...mal return 1701 Invalid command 1702 Invalid operand 1723 RFS write error 1724 RFS read error 1733 Input for export not found 1736 Unexpected CICS error 1738 Invalid VSE Librarian member name 1741 Uns...

Page 378: ...mmand environment defined using DEFCMD or DEFSCMD cmdname specifies the name of a command specified in DEFCMD or DEFSCMD Return Codes 0 Normal return 821 Invalid environment name 822 Invalid command n...

Page 379: ...name of each VSE Librarian sublibrary specified on the last SETSYS AUTHCLIB command Return Codes 2226 Invalid stem varible name 2245 Error retrieving authorized library information Example LISTCLIB L...

Page 380: ...ame of each VSE Librarian sublibrary specified on the last SETSYS AUTHELIB command Return Codes 2226 Invalid stem varible name 2245 Error retrieving authorized library information Example LISTELIB LST...

Page 381: ...d 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 Return Codes 0 Normal return 2225 Error retrieving file pool information 2226 Invalid stem...

Page 382: ...NID command Return Codes 0 Normal return 2325 Error retrieving trantable information Example LISTTRNID The CICSTART exec defines the default transactions and their EXEC names The resulting display is...

Page 383: ...shows that the directories in this list are searched in the order specified from left to right PATH REXX1 EXECS REXX2 EXECS This example shows you that the search is started with the first VSE Librar...

Page 384: ...turn 2502 Invalid operand 2521 Operand not specified Example PSEUDO ON This example turns the pseudo conversational mode on Note The PSEUDO ON OFF setting is temporary The pseudo setting exists while...

Page 385: ...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 a...

Page 386: ...pecified RFS directory RENAME is a command that renames an RFS file to a new name fileid1 specifies the source file identifier it may be a fully or partially qualified directory and file identifier fi...

Page 387: ...ied 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...

Page 388: ...ction CLD on page 325 for more information DELETE is a command that deletes an RLS directory level or RLS list listname specifies a REXX List System list identifier This is partially or fully qualifie...

Page 389: ...riable of the same name WRITE is a command that writes records to an RLS list from a stem Return Codes 0 Normal return 701 Invalid command 702 Invalid operand 713 Directory not found 715 Directory alr...

Page 390: ...eturn Codes n specifies the return code passed back by CICS if an error is detected 0 Normal return 499 Internal error Example SCRNINFO Notes 1 The screen information that is returned is obtained by d...

Page 391: ...s for the user that was created by the SET or SETSYS commands SET sets the REXX CICS processing options for the current user Operands LANG specifies that one of the following languages are available E...

Page 392: ...rary storage queue name The default tsq_name is CEBRxxxx where xxxx is your terminal ID If you enter the CEBR transaction without specifying a TSQ name this is the default name that is used Return Cod...

Page 393: ...for the system Operands LANG specifies that one of the following languages are available ENG English CANFR Canadian French FRANC French GER German ESPAN Spanish UCENG Uppercase English HANZI Tradition...

Page 394: ...containing the REXX CICS authorized commands AUTHELIB establishes the VSE Librarian sublibraries containing the REXX CICS authorized execs lib sublib the name of the VSE Librarian sublibraries contai...

Page 395: ...ame specified 2841 Error retrieving variable 2842 Error storing variable 2848 No client available Example S2C VARA VARB This example shows the contents of the server REXX variable VARA copying into th...

Page 396: ...d EIBTRMID in the variable TERMID Return Codes 0 Normal return 2921 Error in obtaining terminal ID 2928 Error setting TERMID value Example TERMID This example places the CICS terminal ID from the CICS...

Page 397: ...remaining 3270 fields that have been modified Return Codes 0 Normal return 3021 No terminal is attached 3099 Internal error Example WAITREAD This example reads input from the terminal screen and plac...

Page 398: ...t variable 3199 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 Example WAITR...

Page 399: ...Part 3 Appendixes Copyright IBM Corp 1992 2009 377...

Page 400: ...378 CICS TS for VSE ESA REXX Guide...

Page 401: ...CREX486E Error 5 CICREX450E Error 29 CICREX487E Error 6 CICREX453E Error 30 CICREX468E Error 7 CICREX454E Error 31 CICREX469E Error 8 CICREX455E Error 32 CICREX492E Error 9 CICREX456E Error 33 CICREX4...

Page 402: ...er response Run the exec or macro on its own or check a program issuing NUCXLOAD for a possible loop that has not terminated properly See your system administrator for additional storage requirements...

Page 403: ...truction or if you specified a name on the END keyword that does not match the name following DO System action Execution stops User response Make the necessary corrections It may be helpful to use TRA...

Page 404: ...respectively after a literal string when the string is not intended as a hexadecimal or binary specification In this case use the explicit concatenation operator to concatenate the string to the value...

Page 405: ...haracter but some other characters are allowed CICREX470E Error 34 running fn ft line nn Logical value not 0 or 1 Explanation The language processor found an expression in an IF WHEN DO WHILE or DO UN...

Page 406: ...he language processor encountered a result of an arithmetic operation that required an exponent greater than the limit of 9 digits more than 999999999 or less than 999999999 This error can occur durin...

Page 407: ...m action Execution stops User response Make the necessary corrections CICREX485E Error 25 running fn ft line nn Invalid sub keyword found Explanation The language processor expected a particular sub k...

Page 408: ...fy your system support personnel CICREX491E Error 18 running fn ft line nn THEN expected Explanation All REXX IF and WHEN clauses must be followed by a THEN clause Another clause was found before a TH...

Page 409: ...d the SQL statement area 32 There was not enough memory to build the SQLDA variable 33 There was not enough memory to build the results area for the SELECT statement RFS and FLST 0 Normal return 101 I...

Page 410: ...perand CD 0 Normal return 521 Error in retrieving filepool definition 522 Error in creating default RFS directory 523 Error in storing current RFS directory information 524 RFS directory does not exis...

Page 411: ...variable not found 754 User not owner of list LISTCMD 0 Normal return 821 Invalid environment name 822 Invalid command name CLD 0 Normal return 923 Error in storing current RLS directory information 9...

Page 412: ...formation 1525 Error retrieving EXECLOAD information 1530 Unable to link to CICLIBR routine 1531 Error returned from CICLIBR routine 1532 Error returned from RFS READ 1547 GETMAIN error 1548 No client...

Page 413: ...ound LISTCLIB and LISTELIB 2226 Invalid stem variable name 2245 Error retrieving authorized library information GETVERS 0 Normal return 1910 Request failed COPYR2S 0 Normal return 2002 Invalid operand...

Page 414: ...0 Normal return 2721 Invalid SETSYS subcommand 2722 Error storing variable 2723 Invalid language 2725 Invalid MAXVSTOR operand 2726 Invalid RETRIEVE PFkey operand 2727 Invalid TERMOUT operand 2732 In...

Page 415: ...e passed back by CICS if an error is detected 0 Normal return 202 Invalid operand 221 Too many operands specified 222 Recno operand out of range 224 Lines operand invalid CONVTMAP n specifies the retu...

Page 416: ...s variable table limit 537 Argument must be a variable 538 Variable does not exist 539 Invalid variable name 540 Master system trace flag must be on for tracing 541 Parsing error 542 Generic name is i...

Page 417: ...if the results are printed It may be seen if the results are displayed on certain terminals General Description The following characteristics help define the rules used by DBCS to represent extended...

Page 418: ...Mixed SBCS DBCS Symbols A DBCS only symbol consists of only non blank DBCS codes as indicated in Table 5 on page 395 A mixed DBCS symbol is formed by a concatenation of SBCS symbols DBCS only symbols...

Page 419: ...tion operator or function If you use a mixed string with an instruction operator or function that does not allow mixed strings this causes a syntax error The following rules must be followed for mixed...

Page 420: ...the end of string For this reason w1 is assigned the value of the entire string and w2 is assigned the null string PUSH and QUEUE The PUSH and QUEUE instructions add entries to the program stack Sinc...

Page 421: ...When multiple characters are consecutively extracted from a string SO and SI that are between characters are also extracted For example A B is extracted from A B and when the string is finally used as...

Page 422: ...2 A B C D SUBWORD W2 2 1 B C SUBWORD W2 2 2 B C D Built in Function Examples Examples for built in functions those that support DBCS and follow the rules defined are given in this section For full fun...

Page 423: ...s INSERT and OVERLAY In EBCDIC INSERT a b A B 1 ba A B INSERT A B C D 2 C D A B INSERT A B C D E 2 C D A B E INSERT A B C D 3 E C D E A B OVERLAY A B C D 2 C A B OVERLAY A B C D E 2 C A B OVERLAY A B...

Page 424: ...word extraction from a string and character concatenation rules STRIP In EBCDIC STRIP A B A A B Applying the character extraction from a string and character concatenation rules SUBSTR and DELSTR In E...

Page 425: ...fred A B looks up FRED VALUE fred 3 looks up A B VALUE a A B A3 if ETMODE is on VERIFY In EBCDIC VERIFY A B X B A C D E 3 Applying the character extraction from a string and character comparison rules...

Page 426: ...ions The following are the DBCS functions and their descriptions DBADJUST DBADJUST string operation In EBCDIC adjusts all contiguous SI and SO or SO and SI characters in string based on the operation...

Page 427: ...ER A B C 9 P A B C P DBCENTER A B C 10 P P A B C P DBCENTER A B C 12 P Y P A B C P DBCJUSTIFY DBCJUSTIFY string length pad option formats string by adding pad characters between nonblank characters to...

Page 428: ...ank 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 DBRIGHT ab A B 4 A B DBRIG...

Page 429: ...re some EBCDIC examples DBTODBCS Rexx 1988 R e x x 1 9 8 8 DBTODBCS A B A B Note In these examples the x is the DBCS character corresponding to an SBCS x DBTOSBCS DBTOSBCS string converts all passed v...

Page 430: ...falls in the valid range for the implementation it is being run on that is in EBCDIC the leftmost byte range is from X 41 to X FE Here are some EBCDIC examples z abc de DBVALIDATE ab A B 1 DBVALIDATE...

Page 431: ...recommended for users to run host commands or commands with the same name as REXX keywords QUEUE for example This can create problems for any programmer whose REXX programs might be used for some time...

Page 432: ...has an initial value You can alter them just as with any other variable and the PROCEDURE and DROP instructions affect these variables in the usual way Certain other information is always available t...

Page 433: ...tring no tracing takes place except that nonzero return codes from host commands are displayed Host commands are always run that is are not affected by the prefix on TRACE instructions but the variabl...

Page 434: ...the pause specifically for entering data for the PULL The user should not enter the data at the pause after the corresponding SAY statement this is an interactive debug pause Exceptions Some clauses...

Page 435: ...d interactive debugging better enables the switch to an Incremental Development Methodology also known as Prototyping Development Methodology With this methodology REXX can be used for quick and expre...

Page 436: ...es the use of a prototyping methodology The users of an application under development can participate very closely in the application development process The end result is that those who have the best...

Page 437: ...mer investment in CICS based mainframe systems CICS based application development data collection for CICS based systems and employee education relating to the use and support of CICS based systems CI...

Page 438: ...416 CICS TS for VSE ESA REXX Guide...

Page 439: ...er CICSTART PROC in the LIBDEF PROC search chain for the CICS partition Note The sublibrary in which the member CICSTART PROC is found is treated as the initial authorized REXX CICS sublibrary This ca...

Page 440: ...immediately after CICS system initialization by creating a CICS program load table PLT entry to invoke the CICREXD program Otherwise the first REXX CICS user after region startup will cause the CICSTA...

Page 441: ...Function IDs A Alter R Read U Update System Definition Customization Administration Appendix G System Definition Customization Administration 419...

Page 442: ...System Definition Customization Administration 420 CICS TS for VSE ESA REXX Guide...

Page 443: ...ies For example VSAM file access is accomplished through the READ WRITE and REWRITE commands REXX command level security is controlled by the DEFSCMD and DEFCMD AUTH parameter and by the provision of...

Page 444: ...uthorized Users Authorized users are defined by the AUTHUSER command that are allowed to use authorized REXX CICS commands commands defined using the DEFCMD or DEFSCMD command with the AUTH option spe...

Page 445: ...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 au...

Page 446: ...Security 424 CICS TS for VSE ESA REXX Guide...

Page 447: ...nt server support is a REXX feature that provides a substantial performance advantage With this facility a server REXX exec can often be used instead of a nested REXX exec to provide application funct...

Page 448: ...426 CICS TS for VSE ESA REXX Guide...

Page 449: ...this appendix is using BMS map PANELG The following is the map definition TITLE PANEL GROUP FOR REXX CICS 00000010 PRINT ON NOGEN 00000020 PANELG DFHMSD TYPE MAP LANG ASM MODE INOUT STORAGE AUTO SUFFI...

Page 450: ...L 1 PANEL1L PANEL1L 00000250 PANEL1O DS 0CL PANEL1L 1 PANEL1L PANEL1L 00000260 ORG 00000270 END OF DEFINITION 00000280 SPACE 3 00000290 ORG 00000300 PANELGT EQU END OF MAP SET 00000310 END OF MAP SET...

Page 451: ...ORKPTR 0 90 COPYS2R WORKPTR POOL1 USERS USER1 PANELG DATA loop until the user enters a USERID exactly 8 characters in length do forever MUSERID STRIP DUSERIDO if LENGTH MUSERID 8 then do DMSGO Please...

Page 452: ...REXX CICS HEADER PANEL1 PANEL1 PLEASE ENTER YOUR USERID TEST MSG Please enter 8 character USERID BMS Example 430 CICS TS for VSE ESA REXX Guide...

Page 453: ...group When you have completed any changes use CEDA to INSTALL the new group and add it to the appropriate GRPLISTs ready for the next cold start Update LSRPOOL Definitions Because the RFS files have...

Page 454: ...gle apostrophes to delimit the command Two filepools are defined in the CICSTART PROC Change them to match changes to the supplied CICREXX group You can add additional filepools at a later date FILEPO...

Page 455: ...ne the FILEPOOL FORMAT command was successful Attempting to re format a filepool gives the message Subcommand return code 1836 This is also the return code displayed by SAY RC Continue this process un...

Page 456: ...t the REXX transaction then enter EXEC CICHPREP without apostrophes to run the exec that creates the HELP text In response to the following messages enter user sublib where this is the sublibrary you...

Page 457: ...executed 5000 assignment statements have been executed 6000 assignment statements have been executed 7000 assignment statements have been executed 8000 assignment statements have been executed 9000 as...

Page 458: ...The default is SQLDBAPW but this is normally changed as part of the DB2 installation process JOB RELOAD CICSQL PACKAGE LIBDEF SEARCH PRD2 DB2710 PRD1 BASE EXEC PROC ARIS71DB STARTER DATABASE IDENTIFI...

Page 459: ...S TS for VSE ESA Application Migration Aid Guide SC33 1943 CICS TS for VSE ESA System Programming Reference SC33 1659 CICS TS for VSE ESA Distributed Transaction Programming Guide SC33 1661 CICS TS fo...

Page 460: ...em programming commands v The REXX Language A Practical Approach to Programming by M F Cowlishaw IBM Order number ZB35 5100 and available in book stores offers general information about the REXX langu...

Page 461: ...User s Guide and Reference SC26 8797 Debugging Guide and Run Time Messages SC33 6681 Diagnosis Guide SC26 8060 Fact Sheet GC33 6679 Installation and Customization Guide SC33 6682 LE VSE Enhancements S...

Page 462: ...ion Guide SC09 2423 User s Guide SC09 2424 COBOL for VSE ESA COBOL VSE Debug Tool for VSE ESA Fact Sheet GC26 8925 Debug Tool for VSE ESA Installation and Customization Guide SC26 8798 Debug Tool for...

Page 463: ...14 Recovery and Restart Guide SH24 5030 Reference Summary CALL Program Interface SX24 5103 Reference Summary System Programming SX24 5104 Reference Summary HLPI Interface SX24 5120 Release Guide SC33...

Page 464: ...442 CICS TS for VSE ESA REXX Guide...

Page 465: ...re such provisions are inconsistent with local law INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS OR IMPLIED INCLUDING BUT NOT...

Page 466: ...444 CICS TS for VSE ESA REXX Guide...

Page 467: ...ness 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 OfficeVisi...

Page 468: ...446 CICS TS for VSE ESA REXX Guide...

Page 469: ...tor 24 118 not greater than operator 117 strictly not greater than operator 118 not less than operator 117 strictly not less than operator 118 not equal operator 117 strictly not equal operator 117 A...

Page 470: ...ent user s guide 3 content addressable storage 122 control variable 39 139 controlled loops 139 CONVTMAP command 326 COPY command 261 copying a string using COPIES 179 COPYR2S command 327 COPYS2R comm...

Page 471: ...269 PFKLINE command 249 example continued PSEUDO command 362 QQUIT command 249 QUERY command 250 QUIT command 250 RDIR 264 READ 278 RESERVED command 251 RESET command 251 RIGHT command 252 S2C comman...

Page 472: ...command environment 82 hours calculated from midnight 194 how to use this book 103 I identifying users 196 implied semicolons 114 IMPORT command 355 imprecise numeric comparison 222 inclusive OR opera...

Page 473: ...ction 74 PARSE instruction 127 PARSE PULL instruction 73 PARSE UPPER ARG instruction 74 PARSE UPPER PULL instruction 74 PARSE UPPER VALUE 74 PARSE UPPER VAR 75 PARSE VALUE WITH 74 PARSE VAR 74 parsing...

Page 474: ...running REXX programs 5 S S2C command 282 291 373 SAA 104 SAVE command 252 SAY instruction 5 12 127 SBCS strings 395 scientific notation 223 SCRNINFO command 368 searching a string for a phrase 185 s...

Page 475: ...les 142 unconditionally leaving your program 143 underflow arithmetic 224 uninitialized variable 121 UNTIL phrase of DO instruction 138 unusual change in flow of control 225 UP command 255 Update CICS...

Page 476: ...454 CICS TS for VSE ESA REXX Guide...

Page 477: ...comments to IBM you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you You can send your comments to IBM in an...

Page 478: ...456 CICS TS for VSE ESA REXX Guide...

Page 479: ......

Page 480: ...SC34 5764 01...

Page 481: ...Spine information CICS TS for VSE ESA REXX Guide...

Reviews: