IBM SC34-5764-01 User Manual

Browse online or download User Manual for Software IBM SC34-5764-01. IBM SC34-5764-01 User's Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 481
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews

Summary of Contents

Page 1 - R EXX Guide

CICS Transaction Server fo r VSE/ES AR EXX GuideSC34-5764-01

Page 2

OVERLAY...189POS (Position) ...189QUEUED ...190RANDOM ...

Page 3

(Without +, −,or= before the left parenthesis, the language processor would consider the variable to be astring pattern.) The following example uses t

Page 4

c) word3 =4. PARSE VALUE 'Experience is the best teacher.' WITH v1 5 v2...+...1...+...2...+...3.a) v1 =b) v2 =5.quote = 'Experien

Page 5 - Contents

f) word6 = ''3.a) word1 = Experienceb) word2 = isc) word3 = teacher.4.a) v1 = Expeb) v2 = rience is the best teacher.5.a) v1 = Experienceb)

Page 6

Chapter 8. Using Commands from a programThis chapter describes how to use commands in a REXX program.Types of CommandsA REXX program can issue several

Page 7 - Contents v

Calling Another REXX Program as a CommandPreviously, this book discussed how to call another program as an external routine (Chapter 6, “WritingSubrou

Page 8

RFS This is an optional environment that executes commands for the REXX File System.RLS This is an optional environment that executes commands for the

Page 9 - Contents vii

84 CICS TS for VSE/ESA: REXX Guide

Page 10

Chapter 9. Diagnosing Problems within a programThis chapter describes how to trace command output and other debugging techniques.Debugging ProgramsWhe

Page 11 - Contents ix

SIGLThe language processor sets the SIGL special variable in connection with a transfer of control within aprogram because of a function, a SIGNAL or

Page 12

instruction2ENDELSEinstructionAIf the command ends with a nonzero return code, the ELSE path is taken. To force taking the first path,the input during

Page 13 - Contents xi

Arithmetic Operation Rules—Additional Operators ...220Numeric Comparisons ...222Exponential Notation ...

Page 14

88 CICS TS for VSE/ESA: REXX Guide

Page 15 - Contents xiii

Chapter 10. Programming Style and TechniquesThe method you use for constructing your programs is just as important as the language you use to writethe

Page 16

Answer:Happy HourHere is a chance to have some fun.This is a very simple arcade game. Type it in and play it with your friends. Later in this chapter,

Page 17 - Contents xv

/* CATMOUSE EXEC *//* The user says where the mouse is to go. But where *//* will the cat jump? */say "This is the mouse ----------> @"sa

Page 18

Good job! Now, take a while to put your new skills into action, or continue reading.Designing a ProgramStill thinking about method, which is just as i

Page 19 - Contents xvii

Do forevercall DisplayMouse's moveCat's moveendConclusionMethods for Designing LoopsThe method for designing loops is to ask two questions:v

Page 20

What Do We Have So Far?Putting all this together, we have:The method that we have just discussed is sometimes called stepwise refinement. You start wi

Page 21 - Prerequisites

At this stage, look at the specification again. A sailor might need to put on the pullover in the dark, quickly,without worrying about the front or ba

Page 22

This gives the trace:rotate6 *-* wheel:8 *-* cog:10 *-* true:8 *-* cog:10 *-* true:8 *-* cog:10 *-* true:6 *-* wheel:8 *-* cog:13 *-* false:8 *-* cog:

Page 23 - Part 1. User's Guide

This next example is easier to read. It is divided into segments, each with its own heading. The commentson the right are sometimes called remarks. Th

Page 24

QQUIT ...249QUERY ...249QUIT ...250RESERVED ...

Page 25 - Chapter 1. Introduction

This next example has additional features that are popular with some programmers. Keywords written inuppercase and a different indentation style highl

Page 26 - Components of REXX

Congratulations! Now you know the best ways to program your REXX execs. Have fun writing programsthat will make your life easier!/********************

Page 27 - What is a REXX Program?

100 CICS TS for VSE/ESA: REXX Guide

Page 28 - Syntax of REXX Instructions

Part 2. Reference© Copyright IBM Corp. 1992, 2009 101

Page 29 - Continuing an instruction

102 CICS TS for VSE/ESA: REXX Guide

Page 30

Chapter 11. IntroductionThis introductory section:v Identifies the reference's purpose and audiencev Explains how to use the referencev Gives an

Page 31 - Types of REXX Clauses

Overview of Product FeaturesThe following list is the product features of REXX/CICS described in this section.v SAA Level 2 REXX Language Support Unde

Page 32 - Null Clause

Dynamic Support for EXEC CICS CommandsSupport for most EXEC CICS API commands is included in REXX/CICS. This is a dynamic interface (noEXEC CICS comma

Page 33 - Running a Program

SQL InterfaceREXX programs may contain SQL statements. These statements are interpreted and executeddynamically. The results of the SQL statements are

Page 34 - Interpreting Error Messages

v Required items appear on the horizontal line (the main path). STATEMENT required_item v Optional items appear below the main path. STATEMENTop

Page 35 - Characters within a program

Security ...274RLS commands ...275CKDIR ...275DELETE ...

Page 36 - Characters Input to a program

Introduction108CICS TS for VSE/ESA: REXX Guide

Page 37 - Specifying Too Many Values

Chapter 12. REXX General ConceptsThe REstructured eXtended eXecutor (REXX) language is particularly suitable for:v Command proceduresv Application fro

Page 38

v Zero or more blanks (which are ignored)v A sequence of tokens (see section “Tokens” on page 111)v Zero or more blanks (again ignored)v A semicolon (

Page 39 - Passing Arguments

You can avoid this type of problem by using concatenation for literal strings containing /* or */; line 2would be:if substr(input,1,5) = '/'

Page 40

Note: A hexadecimal string is not a representation of a number. Rather, it is an escapemechanism that lets a user describe a character in terms of its

Page 41 - Variable Names

If a symbol does not begin with a digit or a period, you can use it as a variable and can assign it avalue. If you have not assigned it a value, its v

Page 42 - Variable Values

345>=123345 >=123345 >= 123345 > = 123Some of these characters may not be available in all character sets, and, if this is the case,approp

Page 43 - Using Expressions

ContinuationsOne way to continue a clause onto the next line is to use the comma, which is referred to as thecontinuation character. The comma is func

Page 44 - Order of Evaluation

blanks and comments. In addition, one or more blanks, where they occur in expressions but are notadjacent to another operator, also act as an operator

Page 45 - Comparison Operators

Prefix −Same as the subtraction: 0 - numberPrefix +Same as the addition: 0 + number.See Chapter 16, “Numbers and Arithmetic,” on page 217 for details

Page 46 - Using Comparison Expressions

Options...304PANEL Variables ...305Panel Facility Return Code Information ...

Page 47 - Logical (Boolean) Operators

>>= Strictly greater than or equal to\<<, ¬<<Strictly NOT less than<<= Strictly less than or equal to\>>, ¬>>Stric

Page 48 - Using Logical Expressions

=>< (comparison operators)== >> <<\= ¬=>< <>\> ¬>\< ¬<\== ¬==\>> ¬>>\<< ¬<<>= >

Page 49 - Concatenation Operators

Clauses and InstructionsClauses can be subdivided into the following types:Null ClausesA clause consisting only of blanks or comments or both is a nul

Page 50 - Priority of Operators

Assignments and SymbolsA variable is an object whose value can change during the running of a REXX program. The process ofchanging the value of a vari

Page 51 - Tracing Operations

Simple SymbolsA simple symbol does not contain any periods and does not start with a digit (0–9).By default, its value is the characters of the symbol

Page 52 - Tracing Results

where d0 is the uppercase form of the symbol s0, and v1 to vn are the values of the constant or simplesymbols s1 through sn. Any of the symbols s1-sn

Page 53

pull amount nameif datatype(amount)='CHAR' then leavetotal.name = total.name + amountendNote: You can always obtain the value that has been

Page 54

The expression is evaluated, resulting in a character string (which may be the null string), which is thenprepared as appropriate and submitted to the

Page 55 - IF...THEN...ELSE Instructions

argument to the exec. For example: EDIT TEST.EXEC causes the REXX/CICS editor exec, CICEDIT, tostart and TEST.EXEC, the argument, names the file to ed

Page 56 - Control Flow within a Program

REXX File SystemExecs can be stored as members in the VSAM-based REXX File System (RFS), provided withREXX/CICS, or in VSE librarian members with a me

Page 57

Example ...331Notes ...331DEFCMD ...332Operands ...

Page 58 - Tr ueFalse

v The USERID function returnsa1to8character CICS user ID if the user is signed on. If the CICS userhas not signed on and a default user has been speci

Page 59

Pseudo-conversational Transaction SupportCICS pseudo-conversational support for REXX execs is supported though the use of the CICS RETURNTRANSID() com

Page 60

REXX General Concepts130CICS TS for VSE/ESA: REXX Guide

Page 61 - Repetitive Loops

Chapter 13. Keyword InstructionsA keyword instruction is one or more clauses, the first of which starts with a keyword that identifies theinstruction.

Page 62 - DO FOREVER Loops

ADDRESSPurpose ADDRESSenvironmentexpressionexpression1VALUE; ADDRESS temporarily or permanently changes the destination of commands. Commands are

Page 63 - ITERATE Instruction

The two environment names are automatically saved across internal and external subroutine and functioncalls. See the CALL instruction (page “Purpose”

Page 64 - Conditional Loops

ARGPurpose ARGtemplate_list; ARG retrieves the argument strings provided to a program or internal routine and assigns them tovariables. It is a sh

Page 65 - DO WHILE

CALLPurpose CALL,nameexpressionOFF ERRORFAILUREHALTON ERRORFAILURE NAME trapnameHALT; CALL calls a routine (if you specify name) or controls the

Page 66 - DO UNTIL

The CALL then causes a branch to the routine called name, using exactly the same mechanism asfunction calls, see Chapter 14, “Functions,” on page 171.

Page 67

v The status of DO loops and other structures: Executing a SIGNAL while within a subroutine is safebecause DO loops, and so forth, that were active wh

Page 68 - Nested DO Loops

Return Codes ...350Example ...351Note ...351FLST ...

Page 69 - Exercises - Combining Loops

DOPurposeDO groups instructions together and optionally processes them repetitively. During repetitive execution, acontrol variable (name) can be step

Page 70 - EXIT Instruction

Repetitive DO LoopsIf a DO instruction has a repetitor phrase or a conditional phrase or both, the group of instructions forms arepetitive DO loop. Th

Page 71 - CALL and RETURN Instructions

end /* 1.7 *//* 2.4 *//* 3.1 *//* 3.8 */The control variable can be altered within the loop, and this may affect the iteration of the loop. Alteringth

Page 72 - SIGNAL Instruction

Note: Using the LEAVE or ITERATE instructions can also modify the execution of repetitive loops.Evaluate exprr + 0evaluate expri + 0exprt + 0, exprb +

Page 73 - Chapter 5. Using Functions

DROPPurpose DROPname(name); DROP “unassigns” variables, that is, restores them to their original uninitialized state. If name is notenclosed in p

Page 74 - Built-In Functions

EXITPurpose EXITexpression; EXIT leaves a program unconditionally. Optionally EXIT returns a character string to the caller. Theprogram is stopped

Page 75 - Conversion Functions

IFPurpose IF expression;THEN instruction; ELSE instruction;IF conditionally processes an instruction or group of instructions depending on the eva

Page 76 - String Manipulating Functions

INTERPRETPurpose INTERPRET expression ; INTERPRET processes instructions that have been built dynamically by evaluating expression.The expression

Page 77 - Miscellaneous Functions

>O> "Hello Kitty">L> "!">O> "Hello Kitty!"Hello Kitty!Here, lines 3 and 4 set the variables used in li

Page 78 - Using Functions

ITERATEPurpose ITERATEname; ITERATE alters the flow within a repetitive DO loop (that is, any DO construct other than that with a simpleDO).Execut

Page 79

Return Codes ...368Example ...368Notes ...368SET...

Page 80

LEAVEPurpose LEAVEname; LEAVE causes an immediate exit from one or more repetitive DO loops (that is, any DO construct otherthan a simple DO).Proc

Page 81

NOPPurpose NOP ; NOP is a dummy instruction that has no effect. It can be useful as the target of a THEN or ELSE clause:Example:Selectwhen a=c the

Page 82 - Passing Information

NUMERICPurpose NUMERIC DIGITSexpression1SCIENTIFICFORMENGINEERINGexpression2VALUEFUZZexpression3; NUMERIC changes the way in which a program carri

Page 83

OPTIONSPurpose OPTIONS expression ; OPTIONS passes special requests or parameters to the language processor. For example, these may belanguage pro

Page 84

PARSEPurpose PARSEUPPERARGEXTERNALLINEINNUMERICPULLSOURCEVALUE WITHexpressionVAR nameVERSIONtemplate_list; PARSE assigns data (from various source

Page 85

Example:Parse Numeric Var1After this instruction, Var1 would be equal to: 9 0 SCIENTIFIC. See section “NUMERIC” on page 150and the built-in functions

Page 86

PARSE VERSIONparses information describing the language level and the date of the language processor. Thisinformation consists of five words delimited

Page 87 - ARG arg1, arg2, arg3,

PROCEDUREPurpose PROCEDUREEXPOSE name(name); PROCEDURE, within an internal routine (subroutine or function), protects variables by making themunk

Page 88

Example:/* This is the main REXX program */j=1; z.1='a'call toftsayjkm /*Displays "1 7 M" */exit/* This is a subroutine */toft: pr

Page 89

Example:/* This is the main REXX program */a.=11; i=13; j=15i=i+1C.5 = 'FRED'call lucky7saya.a.1ijc.c.5say 'You should see 11 7 14 15 C

Page 90 - Exercise - Writing a Function

LISTPOOL ...391LISTTRNID ...392C2S...392PSEUDO ...

Page 91

PULLPurpose PULLtemplate_list; PULL reads a string from the program stack. If the program stack is empty, PULL then tries reading a linefrom the c

Page 92

PUSHPurpose PUSHexpression; PUSH stacks the string resulting from the evaluation of expression LIFO (Last In, First Out) onto theexternal data que

Page 93 - Chapter 7. Manipulating Data

QUEUEPurpose QUEUEexpression; QUEUE appends the string resulting from expression to the tail of the external data queue. That is, it isadded FIFO

Page 94 - Using Stems

RETURNPurpose RETURNexpression; RETURN returns control (and possibly a result) from a REXX program or internal routine to the point of itsinvocati

Page 95 - Parsing Instructions

SAYPurpose SAYexpression; SAY writes a line to the default output stream (the terminal) so the user sees it displayed. The result ofexpression may

Page 96 - PARSE VAR Instruction

SELECTPurpose SELECT;WHEN expression THEN instruction;;OTHERWISEinstruction;END ; SELECT conditionally calls one of several alternative instru

Page 97 - Parsing with Patterns

SIGNALPurpose SIGNAL labelnameexpressionVALUEOFF ERRORFAILUREHALTNOVALUESYNTAXON ERRORFAILURE NAME trapnameHALTNOVALUESYNTAX; SIGNAL causes an unu

Page 98 - Variable

The VALUE form of the SIGNAL instruction allows a branch to a label whose name is determined at thetime of execution. This can safely effect a multi-w

Page 99

TRACEPurposeTRACE controls the tracing action (that is, how much is displayed to the user) during processing of aREXX program. (Tracing describes some

Page 100 - Manipulating Data

All Traces (that is, displays) all clauses before execution.CommandsTraces all commands before execution. If the command results in an error or failur

Page 101

System Profile Exec ...417Authorized REXX/CICS VSE Librarian sublibraries ...417Defining Authorized Users

Page 102

Using the ? prefix, therefore, switches you alternately in or out of interactive debug. (Because thelanguage processor ignores any further TRACE state

Page 103 - Using Variables in Commands

message when interactive debug is entered, an indication of a syntax error when in interactivedebug, or the traceback clauses after a syntax error in

Page 104 - Using Commands from a Program

UPPERPurposeThis is a non-SAA instruction provided in REXX/CICS. UPPERvariable ; UPPER translates the contents of one or more variables to upperc

Page 105

Chapter 14. FunctionsA function is an internal, built-in, or external routine that returns a single result string. (A subroutine is afunction that is

Page 106

instruction, various other status information (TRACE and NUMERIC settings and so forth) is savedtoo. See the CALL instruction (page “Purpose” on page

Page 107 - Debugging Programs

Internal routines are not used if the function name is given as a literal string (that is, specified inquotation marks); in this case the function mus

Page 108 - Starting Interactive Debug

Built-in FunctionsREXX provides a rich set of built-in functions, including character manipulation, conversion, andinformation functions.Other built-i

Page 109 - Ending Interactive Debug

ABBREV (Abbreviation) ABBREV(information,info,length) returns 1 if info is equal to the leading characters of information and the length of info i

Page 110

returns an argument string or information about the argument strings to a program or internal routine.If you do not specify n, the number of arguments

Page 111 - Test Yourself

BITAND('12'x) -> '12'xBITAND('73'x,'27'x) -> '23'xBITAND('13'x,'5555'x) -&

Page 113

Screen Definition Facility II (SDF II) ...441Notices ...443Trademarks ...

Page 114 - Designing a Program

If binary_string is the null string, B2X returns a null string. If the number of binary digits in binary_string isnot a multiple of four, then up to t

Page 115 - The Conclusion

v The instruction processed as a result of the condition trap (CALL or SIGNAL)v The status of the trapped condition.To select the information to retur

Page 116 - What Do We Have So Far?

If string is null, returns 0.Here are some examples:C2D('09'X) -> 9C2D('81'X) -> 129C2D('FF81'X) -> 65409C2D(&a

Page 117 - Tracing Your Program

Binaryreturns 1 if string contains only the characters 0 or 1 or both.C returns 1 if string is a mixed SBCS/DBCS string.Dbcs returns 1 if string is a

Page 118 - Coding Style

base date, 1 January 0001, in the format: dddddd (no leading zeros or blanks). The expressionDATE('B')//7 returns a number in the range 0–6

Page 119

DBCS (Double-Byte Character Set Functions)The following are all part of DBCS processing functions.DBADJUST DBRIGHT DBUNBRACKETDBBRACKET DBRLEFT DBVALI

Page 120

If you specify n, it is the length of the final result in characters; after conversion, the input string issign-extended to the required length. If th

Page 121

returns the REXX error message associated with error number n. The n must be in the range 0–99, andany other value is an error. Returns the null strin

Page 122

The number is first rounded according to standard REXX rules, just as though the operation number+0 hadbeen carried out. The result is precisely that

Page 123 - Part 2. Reference

INDEXPOS is the preferred built-in function for obtaining the position of one string in another. See page 189 for acomplete description. INDEX(hayst

Page 124

PrefaceWhat this book is aboutThis book describes REXX/CICS or REXX for CICS Transaction Server for VSE/ESA. This IBM programproduct provides a native

Page 125 - Chapter 11. Introduction

LASTPOS (Last Position) LASTPOS(needle,haystack,start) returns the position of the last occurrence of one string, needle, in another, haystack. (S

Page 126 - Introduction

 MAX(,number) returns the largest number from the list specified, formatted according to the current NUMERIC settings.Here are some examples:MAX(

Page 127

haystack. By default the search starts at the first character of haystack (that is, the value of start is 1). Youcan override this by specifying start

Page 128 - SQL Interface

REVERSE REVERSE(string) returns string, swapped end for end.Here are some examples:REVERSE('ABc.') -> '.cBA'REVERSE('X

Page 129

Here are some examples:SPACE('abc def ') -> 'abc def'SPACE(' abc def',3) -> 'abc def'SPACE('abc def

Page 130

SUBWORD SUBWORD(string,n,length) returns the substring of string that starts at the nth word, and is up to length blank-delimited words. The nmust

Page 131 - Structure and General Syntax

(described later) was started or reset. The number has no leading zeros or blanks, and the settingof NUMERIC DIGITS does not affect the number. The fr

Page 132 - Comments

TRACE TRACE(option) returns trace actions currently in effect and, optionally, alters the setting.If you specify option, it selects the trace sett

Page 133 - REXX General Concepts

decimal point. If you specify n, it must be a positive whole number or zero. The number is first roundedaccording to standard REXX rules, just as thou

Page 134

/* REXX EXEC - ASSIGN FIND VALUE OF FRED */FRED = 7'RLS VARPUT FRED \USERS\userid\'X = VALUE(FRED,,RLS)SAY X/*Xnow=7 */Notes:1. If the VALUE

Page 135

xx CICS TS for VSE/ESA: REXX Guide

Page 136 - Implied Semicolons

WORDINDEX WORDINDEX(string,n) returns the position of the first character in the nth blank-delimited word in string or returns 0 if fewer thann wo

Page 137 - Operators

and end. The default value for start is '00'x, and the default value for end is 'FF'x.Ifstart is greater thanend, the values wrap

Page 138 - Arithmetic

 X2D(hexstring,n) returns the decimal representation of hexstring. The hexstring is a string of hexadecimal characters. If theresult cannot be exp

Page 139 - Comparison

If you specify data, after the old value has been retrieved storage starting at address is overwritten withdata (the length argument has no effect on

Page 140 - Logical (Boolean)

Functions202CICS TS for VSE/ESA: REXX Guide

Page 141

Chapter 15. ParsingGeneral DescriptionThe parsing instructions are ARG, PARSE, and PULL (see section “ARG” on page 134, section “PARSE”on page 152, an

Page 142

The PARSE VAR instruction is similar to PARSE VALUE except that the source string to parse is always avariable. In PARSE VAR, the name of the variable

Page 143 - Constant Symbols

/* Alternative to period as placeholder */stars='Arcturus Betelgeuse Sirius Rigil'parse var stars drop junk brightest rest /* brightest=&apo

Page 144 - Compound Symbols

Templates Containing Positional (Numeric) PatternsA positional pattern is a number that identifies the character position at which to split data in th

Page 145

A relative positional pattern is a number with a plus (+) or minus (-) sign preceding it. (It can also be avariable within parentheses, with a plus (+

Page 146 - Commands

Part 1. User's Guide© Copyright IBM Corp. 1992, 2009 1

Page 147 - REXX Exec Invocation

│ 2 │ │var1 4 │ │ 1 │ │var2 2│ │ 4 var3 5│ │11 var4 ││ 2 │ │var1 +2 │ │ ─3 │ │var2 +1│ │+2 var3 +1│ │+6 var4 │└──┬──┘ └───┬────┘ └──┬───┘ └───┬───┘ └─

Page 148 - Editing Execs

v 'R E'v 'X'v 'X'The variable var1 receives 'R'; var2 receives 'E'. Both var3 and var4 receive &apos

Page 149

Converts alphabetic characters to uppercasebefore parsingMaintains alphabetic characters in case enteredARGPARSE UPPER ARGPARSE ARGPARSE UPPER EXTERNA

Page 150

When total=7 then new='purple'When total=9 then new='orange'When total=10 then new='green'Otherwise new=var1 /* entered

Page 151 - Miscellaneous Features

This instruction consists of the keywords PARSE ARG and three comma-separated templates. (For anARG instruction, the source strings to parse come from

Page 152

Parsing with DBCS CharactersParsing with DBCS characters generally follows the same rules as parsing with SBCS characters. Literalstrings and symbols

Page 153 - ADDRESS VALUE expression

┌────────────────────────────────────────┐│┌────────────────────────────────┐ ││START │ ││Token is first one in template. │ ││Length=length(source st

Page 154

┌────────────────────────────────────────────────┐│┌─────────────┐ ┌────────────────────────────────┐ ││Start: │yes │String start=match end. │ ││End

Page 155

┌─────────────────────────┐ ┌────────────────────────┐│Start: Match end <= │no │ ││ string start? ├───│String end=match start. │└───────────┬─────

Page 156

Chapter 16. Numbers and ArithmeticREXX defines the usual arithmetic operations (addition, subtraction, multiplication, and division) in asnatural a wa

Page 157

2 CICS TS for VSE/ESA: REXX Guide

Page 158

DefinitionA precise definition of the arithmetic facilities of the REXX language is given here.NumbersA number in REXX is a character string that incl

Page 159

an operation, when a number is rounded to the required precision.) The operation is then carried out underup to double that precision, as described un

Page 160 - Simple DO Group

The result is then rounded, counting from the first significant digit of the result, to the current setting ofNUMERIC DIGITS.DivisionFor the division:

Page 161 - Repetitive DO Loops

all bits have now been inspected, the initial calculation is complete; otherwise the accumulator is squaredand the next bit is inspected for multiplic

Page 162

Numeric ComparisonsThe comparison operators are listed in section “Comparison” on page 117. You can use any of these forcomparing numeric strings. How

Page 163

For both large and small numbers some form of exponential notation is useful, both to make long numbersmore readable, and to make execution possible i

Page 164

/* after the instruction */Numeric form scientific123.45 * 1e11 -> 1.2345E+13/* after the instruction */Numeric form engineering123.45 * 1e11 ->

Page 165

Chapter 17. Conditions and Condition TrapsA condition is a specified event or state that CALL ON or SIGNAL ON can trap. A condition trap canmodify the

Page 166

/* The following does not raise NOVALUE. */signal on novaluea.=0say a.zsay 'NOVALUE is not raised.'exitnovalue:say 'NOVALUE is raised.&

Page 167 - INTERPRET

Because these conditions (ERROR, FAILURE, and HALT) can arise during execution of an INTERPRETinstruction, execution of the INTERPRET may be interrupt

Page 168

Chapter 1. IntroductionThis chapter describes the REXX programming language and some of its features.What is REXX?REXX is an extremely versatile progr

Page 169

Condition InformationWhen any condition is trapped and causes a SIGNAL or CALL, this becomes the current trappedcondition, and certain condition infor

Page 170

code following the SYNTAX label may PARSE SOURCE to find the source of the data, then call an editorto edit the source file positioned at the line in

Page 171

230 CICS TS for VSE/ESA: REXX Guide

Page 172

Chapter 18. REXX/CICS Text EditorREXX/CICS provides a general purpose CICS-based text editor, patterned after VM/CMS XEDIT.The editor is provided so t

Page 173 -  OPTIONS expression ; 

Screen FormatWhen you call the editor without a profile, the default screen definition is displayed as shown in thefollowing figure.EDIT ---- POOL1:\U

Page 174

line just below it for input. You can also append a number to the end of the prefix command. This acts asa replication factor. If the number “5” is ap

Page 175 - PARSE VAR string word1 string

Example:/* Macro to alter the setting of the REXX/CICS editor */ADDRESS EDITSVR'SET NUMBERS OFF''SET CURLINE 10''SET MSGLINE

Page 176

Notes:1Ifarguments is not specified, any previously defined arguments are deleted.ARGS stores the default parameters to be passed to the program being

Page 177 - PROCEDURE

Return Codes0 Normal returnExample'BOTTOM'This example scrolls to the bottom of the file.CANCEL CANCEL CANCEL ends the current edit sess

Page 178

Return Codes0 Normal request202 Invalid operandExample'CASE MIXED RESPECT'This example sets the case to MIXED and the sensitivity to RESPECT

Page 179

Components of REXXThe various components of REXX make it a powerful tool for programmers. REXX is made up of:v Clauses, which can be instructions, nul

Page 180

BOTTOMdisplays the command line on the bottom line of the screen.Return Codes0 Normal return202 Invalid operandExample'CMDLINE TOP'This exam

Page 181

Operandsnumberspecifies the screen line number.Return Codes0 Normal return202 Invalid operandExample'CURLINE 3'This example sets the current

Page 182

Example'DOWN 5'This example scrolls forward through the file five lines.EDIT EDITNONAMEfileidlib.sublib(mem.type) LIB( MACRO macronameED

Page 183 -  RETURN

3. The default user profile macro that the editor tries to call is CICEPROF. The CICEPROF macro createsan ISPF/PDF like environment. A second profile

Page 184 - Example:

Operandsfileidspecifies the file ID of the file. If you do not specify fileid, the file is saved as the default file ID.Return Codes0 Normal return202

Page 185

2. The search begins at the current line and continues downward until BOTTOM OF DATA is reached, ora match is made. If BOTTOM OF DATA is reached witho

Page 186

 GETLIB lib.sublib(mem.type) GETLIB imports a member from a VSE Librarian sublibrary into the current edit session. The file isinserted after the

Page 187

210 Request failedExample'JOIN'This example joins the line that the cursor is on with the line immediately following it.LEFT LEFT1number

Page 188

Operandsprefixspecifies any standard prefix (such a C, CC, M, MM, B, A) that is entered during an edit session.Return Codes0 Normal return202 Invalid

Page 189 - Prefix Options

Operandsnumberdisplays the message line on the corresponding screen line.OFFdoes not display the message line.INFOdisplays messages in the header line

Page 190 - Format of TRACE Output

Chapter 2. Writing and Running a REXX ProgramThis chapter introduces programs and their syntax, describes the steps involved in writing and runningpro

Page 191

Return Codes0 Normal return202 Invalid operandExample'NUMBERS ON'This example displays sequential numbers in the prefix area.NoteLine number

Page 192

BOTTOMdisplays the PF key line on the bottom line of the screen.numberspecifies the screen line number.OFFremoves the PF key from the display screen.R

Page 193 - Chapter 14. Functions

CMDLINEdisplays the current setting of the command line. For more information see the Text Editor command,section “CMDLINE” on page 237.COLUMNdisplays

Page 194 - Search Order

NoteWhen the current file has been changed, the editor does not let you exit until either a save is done or youenter the QQUIT command.RESERVED RESe

Page 195 - Errors During Execution

 RIght1numberRIGHT scrolls right in the file.Operandsnumberspecifies the number of characters to scroll. If you do not specify number, the screen

Page 196 - Built-in Functions

 SORT *numAD1fromcoltocolSORT sorts the lines from the current line on down.Operands* specifies that all the lines from the current line to the en

Page 197 - ARG (Argument)

 STRIP STRIP strips the trailing blanks off all file lines.Return Codes0 Normal returnExample'STRIP'This example strips all trailing bla

Page 198 - BITAND (Bit by Bit AND)

Operandscolumnspecifies the last column you want to keep.Return Codes0 Normal return202 Invalid operandExample'TRUNC 72'This example truncat

Page 199 - B2X (Binary to Hexadecimal)

256 CICS TS for VSE/ESA: REXX Guide

Page 200 - CONDITION

Chapter 19. REXX/CICS File SystemThe REXX File System (RFS) is provided for the storage of text files and execs created with theREXX/CICS editor, and

Page 201 - C2D (Character to Decimal)

When you run the example program, the first PULL instruction assigns the variable number1 the value 42.The second PULL instruction assigns the variabl

Page 202 - DATATYPE

Example:POOL1: File Pool\ Root DirectoryTEST1.EXEC FileUSERS\ SubdirectoryUSER1\ SubdirectoryTEST2.EXEC FileDOCS\ SubdirectoryTEST3.DOCUMENT FileUSER2

Page 203 - Functions

The exec name is fully qualified, using the directory ID of each directory in the search before the search ofeach respective directory is performed. T

Page 204

AUTH authorizes access to RFS directories.Operandsdiridspecifies a REXX File System directory identifier. This is partially or fully qualified. See th

Page 205 - D2C (Decimal to Character)

Return CodesSee the RFS command, section “RFS” on page 363.Example'CKFILE POOL1:\USERS\USER1\TEST.EXEC'This example checks for a file called

Page 206 - ERRORTEXT

DISKR reads records from an RFS file.Operandsfileidspecifies the file identifier.stem.specifies the name of a stem. (A stem must end in a period.) See

Page 207 - EXTERNALS

GETDIR returns a list of the contents of the current or specified directory into the specified REXX array.Operandsstem.specifies the name of a stem. (

Page 208

Example'RFS RDIR POOL1:\USERS\USER1\DOCS'This example deletes a directory called DOCS in the existing directory POOL1:\USERS\USER1.RENAME

Page 209

USER=USER1 - DIRECTORY=\USERS\USER1CMD FILENAME FILETYPE ATTRIBUTES RECORDS SIZE DATE TIMETEST1 EXEC FILE 11 1 1994/03/27 10:30:29TEST2 EXEC FILE 5 1

Page 210 - MAX (Maximum)

CDWhen you type CD from the command line use the following syntax: CDdiridCD changes the current directory.Operandsdiridspecifies a REXX File Syst

Page 211 - POS (Position)

DELETEWhen you type DELETE on the FLST command column use the following syntax: DELETE DELETE deletes a file.When you type DELETE from the command

Page 212

SAY 'This is a REXX literal string.' /* Using single quotation marks */SAY "This is a REXX literal string." /* Using double quotat

Page 213 - SOURCELINE

Operandsparameterspecifies the parameters passed to the exec as arguments.Example'EXEC / PARMS'This example, executed on the command column

Page 214 - SUBSTR (Substring)

NoteSee Chapter 19, “REXX/CICS File System,” on page 257 for more information about the REXX FileSystem.MACROWhen you type MACRO from the command line

Page 215

NoteIf you specify text, the PF key is set with the text. If you do not specify text, the PF key is processed.REFRESHWhen you type REFRESH on the FLST

Page 216

SORTWhen you type SORT from the command line use the following syntax: SORTDTFNFTATRCSZSORT sorts the file list.OperandsDTspecifies sorting the fi

Page 217 - TRUNC (Truncate)

Example'SYNONYM DISCARD RFS DELETE'This example makes DISCARD equivalent to the RFS command DELETE.UPWhen you type UP from the command line

Page 218

Chapter 20. REXX/CICS List SystemREXX/CICS provides a facility for maintaining tables or lists of data in virtual storage. This facility is calledthe

Page 219

The following example shows RLS directories and lists.Example:\ Root DirectoryTEST1.DATA FileUSERS\ SubdirectoryUSER1\ SubdirectoryTEST2.DATA FileDOCS

Page 220 - XRANGE (Hexadecimal Range)

RLS commandsUnder the RLS command environment you issue commands to interface with RLS. If you set thecommand environment to RLS, you should not speci

Page 221 - X2D (Hexadecimal to Decimal)

 RLS*QUEUE*LPULL varnamequeidLPULL pulls a record from the top of the RLS queue.Operandsvarnamespecifies a simple REXX variable name. It does not

Page 222

LQUEUE RLS*QUEUE*LQUEUE varnamequeidLQUEUE adds a record to the end of the RLS queue (FIFO).Operandsvarnamespecifies a simple REXX variable name.

Page 223

CICS Transaction Server fo r VSE/ES AR EXX GuideSC34-5764-01

Page 224

SAY 'This is' 'a string.'The space between the two separate strings is preserved:This is a string.Continuing a literal string with

Page 225 - Chapter 15. Parsing

Operandslistnamespecifies the list identifier.stem.specifies the name of a stem. (A stem must end in a period.) See section “Stems” on page 123 formor

Page 226 - The Period as a Placeholder

Operandsvarnamespecifies a simple REXX variable name. It does not end in a period, distinguishing a variable namefrom a stem name.diridspecifies a REX

Page 227 - Chapter 15. Parsing 205

stem.specifies the name of a stem. (A stem must end in a period.) See section “Stems” on page 123 formore information. The default stem is DATA..Retur

Page 228

Chapter 21. REXX/CICS Command DefinitionThe REXX/CICS Command Definition Facility provides a means of easily defining (or redefining) REXXcommands and

Page 229 - Chapter 15. Parsing 207

authorized user to use DEFSCMD to change command definitions that affect other REXX/CICS users. Seesection “DEFCMD” on page 332 for more information o

Page 230

Entry Specifications when DEFCMD CICSLINK is specified:When the code for the command program gets control by an EXEC CICS LINK, the CICS Commareaconta

Page 231 - Using UPPER

Non-REXX Language InterfacesREXX/CICS makes it possible to transparently convert a REXX process to a non-REXX process. To dothis requires that non-REX

Page 232 - Parsing Instructions Examples

Chapter 22. REXX/CICS DB2 InterfaceThe REXX/CICS DB2 Interface provides a means of executing SQL from a REXX exec. The SQL areprepared and executed dy

Page 233 - Parsing Multiple Strings

ADDRESS EXECSQL"statement""statement"...SQL can exist on more than one line. Each part of the statement is enclosed in quotes and

Page 234

v Host variables are not allowed within the SQL. Instead, you can use REXX variables to pass input datato the EXECSQL environment. The REXX variables

Page 235 - Details of Steps in Parsing

Types of REXX ClausesREXX clauses can be: instructions, null clauses, and labels. Instructions can be keyword instructions,assignments, or commands. T

Page 236

SQLCOLn.1Some SELECT functions such as CURRENT SQLID, MAX, and AVG are not associated with aparticular DB2 column. To view the results you must refere

Page 237 - Chapter 15. Parsing 215

Exit rcend/*---------------------------------------*//* Display the members of the department *//*---------------------------------------*/Say 'H

Page 238

DB2 Interface290CICS TS for VSE/ESA: REXX Guide

Page 239

Chapter 23. REXX/CICS High-level Client/Server SupportClient/Server computing has become very popular in the Information Processing industry. Some of

Page 240 - Arithmetic Operators

v Because REXX/CICS allows REXX clients and servers to be recoded in non-REXX languages,performance intensive parts of an application system can be se

Page 241 - Multiplication

REXX/CICS Server Exec Example/* EXAMPLE REXX/CICS SERVER1 EXEC */TRACE 'O' /* turn off source tracing *//*----------------------------------

Page 242 - Basic Operator Examples

High-level Client/Server Support294CICS TS for VSE/ESA: REXX Guide

Page 243 - Additional Operator Examples

Chapter 24. REXX/CICS Panel FacilityFacilityThe REXX panel facility provides the REXX programmer with simple tools and commands for paneldefinition an

Page 244 - Exponential Notation

mail_city = 'DALLAS'; /* prefill the most likely response for city/state */mail_state = 'TX';mail_zip = '';do forever;&a

Page 245 - Numbers and Arithmetic

characters are re-activated. Certain keyword combinations are incompatible and are not allowed whileothers which may seem meaningless are allowed. For

Page 246 - Numbers Used Directly by REXX

LabelA label, such as sub: is a symbolic name followed by a colon. A label can contain either single- ordouble-byte characters or a combination of sin

Page 247

! Defcolor unprotect bright& Variable identifierOperandscharspecifies the control character being defined.VAriabledefines a REXX variable identifi

Page 248

Notes:1. When you do not specify a default color, the color is based on the field type and intensity values:protect/normal displays blue, protect/brig

Page 249

The panel layout is close to what you see, with the exception of the control characters and the imbeddedvariables which are not shown when the panel i

Page 250 - The Special Variable SIGL

 .PANEL panel_nameprotect_ccskip_cc variable_pairtextvariable_ccunprotect_cc variable_ccfield_length variable_pair.PANELOperandspanel_namespecifi

Page 251

The characteristics of the PANEL command follow.v All the arguments or keywords are not meaningful or valid for all commands.v The last panel command

Page 252

NORmalBRightINVisibleGReenREDBLUeTUrquoiseWHiteYEllowPInkDEfcolorBLInkREVerseUNDerlineNOJustifyLEftRIghtNULlsPAd ( )BLAnkscharNUMeric CUrsor MDT 

Page 253 - Invocation

the field. The field list must be enclosed with parenthesis. Only the attributes stated are changedand the other attributes default to what was static

Page 254 - Individual Line Commands

Notes:1. When you do not specify a default color, the color is based on the field type and intensity values:protect/normal displays blue, protect/brig

Page 255 - Destination Commands

OPID OPERATOR IDMSRE MAGNETIC READERSTRF STRUCTURE FIELDTRIG TRIGGERPA1PA2PA3PF1PF2PF3PF4PF5PF6PF7PF8PF9PF10PF11PF12PF13PF14PF15PF16PF17PF18PF19PF20PF

Page 256 - Command Line Commands

Return Codes4 Warning. Panel facility continues processing. Processing stops for other return code values.8 Programmer error10 Programmer error, PAN.R

Page 257 - BACKWARD

character is X'0F') The SO and SI characters are non-printable. In the following example, the less than (<)and greater than (>) symbol

Page 258 - Text Editor

117 Variable value was too long and was truncated to fit output field118 Text field was truncated. Check to see if explicit length did not force a sub

Page 259

06 Numeric07 extended highlight (blink/reverse/underline)08 MDT09 Cursor10 Pad()11 Variable12 DropState codesState codes for 20xx location codes:01 pa

Page 260 - Operands

State CodesState codes for 12xx location codes:01 panel name02 protect/skip field03 unprotect field04 text within a protect/skip field05 (not implemen

Page 261

Example 2.DEFINE > prot green.DEFINE < unprot underline white.DEFINE + var service..DEFINE % skip turq.PANEL service> Panel service &disp

Page 262

Example 4.DEFINE ) protect bright.DEFINE + drop.DEFINE & var msg.A panel to display output dynamic messages..PANEL msgbox2)+----------------------

Page 263

'PANEL SEND SIGNON' CLR_INP_FIELDS PATH_NAME ,'CURSOR(' CURS_NAME ')' ATTR_STRINGIF RC > 4 THEN /* more than a warnin

Page 264

END; /* select */END; /* do forever */EXITIF SYMBOL('ACCOUNT.ACC_NUM') == 'VAR' THENRETURN(1)ELSERETURN(0);NON_ITEMIZE_ROUTINE:QUE

Page 265

NUM_OF_DAYS.2 = 29;ELSENUM_OF_DAYS.2 = 28;FIRST_WEEKDAY = (TOT_DAYS+1) // 7;FIRST_WEEKDAY_SAVE = FIRST_WEEKDAY;DISP_CENTER_MON = MONTH_NAME.MONTH; /*

Page 266

LEFT_MONTH = 12;ELSELEFT_MONTH = MONTH - 1;FIRST_WEEKDAY = (TOT_DAYS - NUM_OF_DAYS.LEFT_MONTH +1) // 7;DISP_LEFT_MON = MONTH_NAME.LEFT_MONTH;LEFT_DAYS

Page 267

(SUBSTR(DATE_SAVE,7,2)+FIRST_WEEKDAY_SAVE);ATTR_STRING = 'ATTRIB(' CUR_DAY_FIELD 'RED )' ;END;END; /* select */'PANEL RECEIVE

Page 268

rexx helloHello! What is your name?samHello SAMHere is what happens:1. The SAY instruction displays Hello! What is your name?2. The PULL instruction p

Page 269

318 CICS TS for VSE/ESA: REXX Guide

Page 270

Chapter 25. REXX/CICS CommandsThis chapter provides you with detailed reference information for all REXX/CICS commands. Return codeinformation for all

Page 271

AUTHUSERNote: This is an authorized command. AUTHUSER;useridAUTHUSER authorizes a list of user IDs.Operandsuseridis a CICS signon user ID that be

Page 272

CD CDdiridCD changes the RFS file system directory.Operandsdiridspecifies a partial or full REXX File System directory that becomes the new curren

Page 273 - RESERVED

for execs.Commands322CICS TS for VSE/ESA: REXX Guide

Page 274

CEDA CEDA RDO_Command Executes a CEDA command for resource definition online (RDO).OperandsRDO_Commandspecifies a command string passed as input t

Page 275

CEMT CEMT master_term_cmd CEMT executes a CICS master terminal command from REXX.Operandsmaster_term_cmdspecifies a command string passed as input

Page 276

CLD CLDdiridCLD changes your current RLS list directory.Operandsdiridspecifies a partial or full REXX List System directory that becomes the new c

Page 277

CONVTMAP CONVTMAP lib.sublib(mem.type) rfs_fileid CONVTMAP reads a VSE Librarian sublibrary member and converts a DSECT (created by a previouslyas

Page 278

COPYR2SNote: This is an authorized command. COPYR2S source_vname stor_anchor offset* lengthstruct_vname fieldnamestruct_name fieldnameCOPYR2S copi

Page 279 - POOL1:\USERS\USER1\TEST.EXEC

When the program runs, the language processor sends the following lines of output.7 +++ PULL who /* Get the person's name.IF who ='' TH

Page 280 - Current Directory and Path

Return Codes0 Normal return2002 Invalid operand2021 Invalid structure definition2022 Invalid variable structure definition2023 Field name not found202

Page 281 - RFS commands

COPYS2RNote: This is an authorized command. COPYS2R stor_anchor vname offset length* struct_vname fieldnamestruct_name fieldnameCOPYS2R copies dat

Page 282 - File System

Return Codes0 Normal return2102 Invalid operand2121 Invalid structure definition2122 Invalid variable structure definition2123 Field name not found212

Page 283

C2S C2S client_rexx_varnameserver_rexx_varnameC2S copies a client REXX variable to a server REXX variable.Operandsclient_rexx_varnamespecifies the

Page 284

DEFCMD DEFCMD etarget ecmdnmetarget *itarget icmdnmitarget *==pgmnameCICS_loadmodexecname( CLEAR( CICSLINKCICSLOAD AUTHREXXDEFCMD defines (or rede

Page 285

CICSLOADis a keyword indicating that the processing agent is a CICS program that is loaded by an EXECCICSLOAD.REXXis a keyword indicating that the pro

Page 286 - File List Utility

from the REXX user (programmer), a command can be quickly written in REXX and later transparentlyrewritten in another language, if it becomes performa

Page 287 - FLST Commands

DEFSCMDNote: This is an authorized command. DEFSCMD etarget ecmdnmetarget ***itarget icmdnmitarget *==pgmnameCICS_loadmodexecname( CLEAR( CICSLINKCI

Page 288

CICSLINKis a keyword indicating that the processing agent for the defined REXX command is a standard CICSprogram that is called by an EXEC CICS LINK.C

Page 289

5. REXX commands can be written in REXX. These REXX commands in turn call other REXX commandswhich are written in REXX, in a building block fashion. S

Page 290

Quotation marks ensure that information in a program is processed exactly as typed. This is important inthe following situations:v For output that mus

Page 291

DEFTRNIDNote: This is an authorized command. DEFTRNID trnid execnameCLEARDEFTRNID is a region-wide authorized command that can be used to define t

Page 292

DIR DIRdirid ( stem.DIR displays the current directory contents or optionally returns the directory contents in a REXXcompound variable.Operandsdi

Page 293

EDIT EDITNONAMEfileidlib.sublib(mem.type) LIB( MACRO macronameEDIT opens a new edit session.OperandsNONAMEa file ID is not specified. This is the

Page 294 - FLST Return Codes

EXEC EXEC execid args EXEC calls a REXX exec at a lower level (as a nested exec). All variables for this new exec are keptseparate from the higher

Page 295 - Directories and Lists

EXECDROPNote: This is an authorized command. EXECDROP AUTHClib memberAUTHElibPROClibnameMEM(RFSLIBEXECDROP removes an EXECLOADed exec from virtual

Page 296

NoteIf a partial directory ID is given, it is temporarily appended to the end of the current working directory valueto get a fully qualified directory

Page 297 - RLS commands

EXECIO EXECIO lines*READ tsqnameWRITE tsqnamestem.varnamerecnoEXECIO performs file input/output to a CICS temporary storage queue.Operandslinesspe

Page 298 - List System

2. If a stem is specified for a READ operation (and a stem should be specified if more than one record isread), the actual number of records read is p

Page 299

EXECLOADNote: This is an authorized command. EXECLOAD AUTHClib memberAUTHElibPROClibnameMEM(RFSLIBEXECLOAD loads an exec into virtual storage.Oper

Page 300

Example'EXECLOAD POOL1:\USERS\USER2\TEST.EXEC (RFS'This example loads the exec TEST.EXEC from RFS into storage. Subsequent calls of TEXT.EXE

Page 301

The PULL instruction can extract more than one value at a time from the terminal by separating a line ofinput. The following variation of the example

Page 302

EXECMAP EXECMAP EXECMAP returns the sublibraries and members, the number of users, the descriptor table start (in hex),and the amount of storage r

Page 303 - Highlights

EXPORT EXPORT rfs_fileid lib.sublib(mem.type) EXPORT exports an RFS file to a VSE Librarian sublibrary member.Operandsrfs_fileidspecifies a fully

Page 304 - Command Definition

FILEPOOLNote: This is an authorized command. FILEPOOL DEFINE poolid dirid fileid (USERFORMAT poolidADD poolid fileidFILEPOOL performs RFS file poo

Page 305 - CICPARMS Control Block

Example'FILEPOOL DEFINE POOL1 REXXDIR1 REXXLIB1 (USER'This example defines file pool POOL1 and tells RFS the CICS file definition to use is

Page 306 - Non-REXX Language Interfaces

FLST FLSTdiridFLST calls the file list utility to work with the files.Operandsdiridspecifies an optional full or partial directory ID that a file

Page 307 - Embedding SQL Statements

GETVERS GETVERS GETVERS retrieves the current REXX/CICS, program name, version, and compile time information, andplaces it into the REXX variable

Page 308 - DB2 Interface

HELP HELPsearch_termHELP browses or searches this book (the IBM REXX Development System for CICS/ TS for VSE/ESA)online.Operandssearch_termspecifi

Page 309 - Receiving the Results

IMPORT IMPORT lib.sublib(mem.type) rfs_fileid IMPORT imports a VSE Librarian sublibrary member to an RFS file.Operandslib.sublib(mem.type)specifie

Page 310 - Example Using SQL Statements

LISTCMD LISTCMDenvname cmdnameLISTCMD lists REXX command definition information (previously specified by DEFCMD).Operandsenvnamespecifies the name

Page 311

LISTCLIB LISTCLIBstem.LISTCLIB displays the names of the authorized command libraries to the terminal or to a specified stemarray, if a stem has b

Page 312

REXX add 42 21 10The language processor assigns the value 42 to number1, the first variable following ARG. It assigns thevalue 21 10 to number2, the s

Page 313 - Overview

LISTELIB LISTELIBstem.LISTELIB displays the names of the authorized exec libraries to the terminal or to a specified stem array, ifa stem has been

Page 314 - REXX/CICS Client Exec Example

LISTPOOL LISTPOOLstem.LISTPOOL displays RFS file pool information to the terminal or to a specified stem array, if a stem hasbeen specified.Operan

Page 315 - REXX/CICS Server Exec Example

LISTTRNIDNote: This is an authorized command. LISTTRNID LISTTRNID lists the current transaction ID definitions created by the DEFTRNID command.Ret

Page 316

PATH PATH;diridlib.sublibPATH defines the search path for REXX execs.Operandsdiridspecifies one or more fully qualified REXX File System director

Page 317 - Example of Panel Definition

PSEUDO PSEUDO ONOFFPSEUDO turns the pseudo-conversational mode on or off.OperandsONenables automatic pseudo-conversational support so that when th

Page 318 - Defining Panels

RFS RFSPRIVATEAUTH diridPUBLICRPUBLICWSECUREDCKDIR diridCKFILE fileidCOPY fileid1 fileid2DELETE fileidDATA.DISKR fileidstem.DATA.DISKW fileidstem.GE

Page 319 - Panel Facility

fileid2specifies the target file identifier, it may be a fully or partially qualified directory and file identifier.DELETEis a command that deletes an

Page 320

NoteFile access security checking is performed at the directory level, rather than the file level. If a specified fileID is not a fully qualified ID,

Page 321

RLS RLS CKDIR diridDELETE listname*QUEUE*LPULL varnamequeid*QUEUE*LPUSH varnamequeid*QUEUE*LQUEUE varnamequeidMKDIR diridDATA.READ listnamestem. ( U

Page 322

MKDIRis a command that creates a new RLS directory level.READis a command that reads records from an RLS list into a stem.listnamespecifies the list i

Page 323

4. lastname = WEBER, firstname = JOE, score = 915. lastname = Baker, firstname = Amanda, score = Marie 956. lastname = Callahan, firstname = Eunice, s

Page 324 - PANEL RUNTIME

SCRNINFO SCRNINFO SCRNINFO returns a two-digit decimal screen height (in lines) in the variable SCRNHT, and returns athree-digit decimal screen wi

Page 325

SET SET(1)ENGLANGCANFRFRANCGERESPANUCENGHANZIKANJI1024MAXVSTORkilobytesRETRieve pfkeynnTERM CEBRxxxxTERMOUTNOTERM tsq_nameCANCELNotes:1 If no para

Page 326

RETRieveallows a PF key being set to retrieve the last line entered.pfkeynnspecifies the PF key number.TERMOUTsends terminal line-mode output to a CIC

Page 327 - PANEL Variables

SETSYSNote: This is an authorized command. SETSYSLANG ENGCANFRFRANCGERESPANUCENGHANZIKANJI1024MAXVSTORkilobytesRETRieve pfkeynnONPSEUDOOFFAUTHClib

Page 328

pfkeynnspecifies the PF key number.PSEUDOestablishes the default region-wide REXX/CICS automatic pseudo-conversational setting. For moreinformation on

Page 329 - System Error Reason Codes

S2C S2C server_rexx_varnameclient_rexx_varnameS2C copies a server REXX variable to a client REXX variable.Operandsserver_rexx_varnameis the name o

Page 330 - State Codes and Input Codes

TERMID TERMID TERMID returns the four-character CICS terminal ID from the CICS field EIBTRMID in the variableTERMID.Return Codes0 Normal return292

Page 331 - Input codes

WAITREAD WAITREAD WAITREAD performs full screen terminal input and places the results into the compound variable with:WAITREAD.0containing the num

Page 332 - Example 1

WAITREQ WAITREQ WAITREQ is used only in REXX servers causing the server to wait for a request. After a request isreceived, it is placed into REXX

Page 333 - Example 3

Part 3. Appendixes© Copyright IBM Corp. 1992, 2009 377

Page 334 - Example 5

Note!Before using this information and the product it supports, be sure to read the general information under “Notices” on page443.Second edition (Sep

Page 335

18 CICS TS for VSE/ESA: REXX Guide

Page 336

378 CICS TS for VSE/ESA: REXX Guide

Page 337

Appendix A. Error Numbers and MessagesExternal interfaces to the language processor can generate three of the error messages either before thelanguage

Page 338

System action: Execution is terminated at the point ofthe error.User response: Redefine storage and reissue thecommand.The following are the REXX erro

Page 339

When a1=b1 then When a1=b1 then DOSay 'A1 equals B1' Say 'A1 equals B1'exit exitOtherwise nop endend Otherwise nopendSystem action

Page 340

A-Z a-z 0-9 (Alphamerics)@#£$.?!_ (Name Characters)&*()-+=\¬ '";:<,>/|(Special Characters)If surrounded by X'0E' (shift-

Page 341

passed back from an EXIT or RETURN instruction(when a REXX program is called as a command) is nota whole number or will not fit in a general register.

Page 342 - AUTHUSER

Say Enter A, B, or Cshould be written as:Say 'Enter A, B, or C'System action: Execution stops.User response: Make the necessary corrections.

Page 343 - Examples

end with a RETURN statement specifying anexpression.System action: Execution stops.User response: Make the necessary corrections.CICREX481E Error 49 r

Page 344

v NUMERIC FUZZ expressionv OPTIONS expressionv SIGNAL VALUE expressionv TRACE VALUE expression.(FUZZ must be smaller than DIGITS.)System action: Execu

Page 345

Appendix B. Return CodesThis appendix is a list of all the REXX/CICS return codes.Panel Facility4 Warning. Panel facility continues processing8 Progra

Page 346

Chapter 3. Using Variables and ExpressionsThis chapter describes variables, expressions, and operators, and explains how to use them in REXXprograms.P

Page 347

207 Insufficient space in filepool210 Request failed211 Invalid file ID223 Search argument not found226 File is currently being edited229 Number out o

Page 348 - CONVTMAP

715 Directory already exists716 Directory not specified723 List not found726 List not specified728 List is in update mode729 List is not in update mod

Page 349

DEFTRNID0 Normal return1202 Invalid operand1222 Invalid option1223 Error storing trantable information1225 Error retrieving trantable information1226

Page 350

1823 Error storing file pool information1824 File pool ID not specified1825 Error retrieving file pool information1826 Invalid file pool ID1827 Invali

Page 351

2226 Invalid stem variable nameLISTTRNID0 Normal return2325 Error retrieving trantable informationC2S0 Normal return2440 No variable name specified244

Page 352

3021 No terminal is attached3099 Internal errorWAITREQ0 Normal return3121 WAITREQ not enabled3122 Exec not a server3123 Error saving request variable3

Page 353

-527 Redundant specification for option-528 Value for option not specified-529 Value specified for option which should not have a value-530 Value spec

Page 354

Appendix C. Double-Byte Character Set (DBCS) SupportA Double-Byte Character Set supports languages that have more characters than can be represented b

Page 355

DBCS character -> .A .B .C .DSBCS character -> abcdeDBCS blank -> '. 'EBCDIC shift-out (X'0E') -> <EBCDIC shift-in

Page 356

ValidationThe user must follow certain rules and conditions when using DBCS.DBCS Symbol ValidationDBCS symbols are valid only if you comply with the f

Page 357

v The first character cannot be 0 through 9 or a period (.)v The variable name cannot exceed 250 bytes. For names containing DBCS characters, count ea

Page 358

PARSEIn EBCDIC:x1 = '<><.A.B><. . ><.E><.F><>'PARSE VAR x1 w1w1 -> '<><.A.B><. .

Page 359

When the data is split up in shorter lengths, again the DBCS data integrity is kept under OPTIONSEXMODE. In EBCDIC, if the terminal line size is less

Page 360 - DEFTRNID

In EBCDIC:'<.A>' = '<.A. >' -> 1 /* true */'<><><.A>' = '<.A><><>

Page 361

DATATYPEDATATYPE('<.A.B>') -> 'CHAR'DATATYPE('<.A.B>','D') -> 1DATATYPE('<.A.B>&a

Page 362

RIGHT('a<>',2) -> 'a'CENTER('<.A.B>',10,'<.E>') -> '<.E.E.E.E.A.B.E.E.E.E>&

Page 363

Drop A.3 ; <.A.B>=3 /* if ETMODE is on */SYMBOL('<.A.B>') -> 'VAR'SYMBOL(<.A.B>) -> 'LIT' /* has

Page 364 - EXECDROP

WORDPOSIn EBCDIC:WORDPOS('<.B.C> abc','<.A. .B.C> abc') -> 2WORDPOS('<.A.B>','<.A.B. .A.B&g

Page 365

DBCENTER DBCENTER(string,length,pad ,option) returns a string of length length with string centered in it, with pad characters added as necessary

Page 366

padded with pad characters (or truncated) on the right as needed. The default pad character is a blank.The option controls the counting rule. Y counts

Page 367

 DBRRIGHT(string,length,option) returns the remainder from the DBRIGHT function of string.Iflength is greater than the length of string,returns a

Page 368 - EXECLOAD

ANSWERS1. Incorrect, because the first character is a number.2. Incorrect, because the first character is a “£”.3. Valid4. Valid5. Valid, but it is a

Page 369

DBVALIDATE DBVALIDATE(string,'C') returns 1 if the string is a valid mixed string or SBCS string. Otherwise, returns 0. Mixed string val

Page 370

Appendix D. Reserved Keywords and Special VariablesYou can use keywords as ordinary symbols in many situations where there is no ambiguity. The precis

Page 371

RC is set to the return code from any run host command (or subcommand). Following the SIGNALevents, SYNTAX, ERROR, and FAILURE, RC is set to the code

Page 372 - FILEPOOL

Appendix E. Debug AidsThis appendix describes the interactive debugging of problems, interrupting execution, and controllingtracing.Interactive Debugg

Page 373

Since any instructions may be run in interactive debug, you have considerable control over execution.Some examples:Say expr /* displays the result of

Page 374

Appendix F. REXX/CICS Business Value DiscussionCICS Transaction Server for VSE/ESA REXX provides an ideal system to deliver superior, valuable, andapp

Page 375

v CICS Transaction Server for VSE/ESA REXX is useable by business peopleQuite often, business people who best understand the business and their requir

Page 376

v CICS Transaction Server for VSE/ESA REXX supports six languagesCICS Transaction Server for VSE/ESA REXX provides REXX messages in six languages, in

Page 377

416 CICS TS for VSE/ESA: REXX Guide

Page 378

Appendix G. System Definition/Customization/AdministrationThis appendix discusses the system definition, customization, and administration of REXX/CIC

Page 379 - LISTCLIB

** Raise a number to a whole number power−number(Prefix −) Same as the subtraction 0 - number+number(Prefix +) Same as the addition 0 + numberUsing nu

Page 380 - LISTELIB

Setting System OptionsSystem options are specified by using the REXX/CICS SETSYS command. It is recommended thatsystem-wide SETSYS commands be placed

Page 381 - LISTPOOL

Function IDsA AlterR ReadU UpdateSystem Definition/Customization/AdministrationAppendix G. System Definition/Customization/Administration 419

Page 382 - LISTTRNID

System Definition/Customization/Administration420CICS TS for VSE/ESA: REXX Guide

Page 383

Appendix H. SecurityREXX/CICS can be viewed as a more sophisticated version of the CICS-supplied Command LevelInterpreter Transaction (CECI). The REXX

Page 384

authorized. This is the logical place to define authorized users and libraries. The sublibrary containing theCICSTART exec is treated as the initial “

Page 385

Notes:1. The AUTH option of the DEFCMD or DEFSCMD is itself an authorized command option. That is,AUTH may only be used if the user issuing it is an a

Page 386

Security424CICS TS for VSE/ESA: REXX Guide

Page 387

Appendix I. Performance ConsiderationsBecause of the production nature of CICS, emphasis is placed on performance. Many design choices canaffect perfo

Page 388

426 CICS TS for VSE/ESA: REXX Guide

Page 389

Appendix J. Basic Mapping Support ExampleThis appendix has a list of steps that you must follow so you can use the CICS basic mapping support(BMS) wit

Page 390 - SCRNINFO

7+2*3-1\___/63. Addition and subtraction from left to right7+6-1=12Using Arithmetic ExpressionsYou can use arithmetic expressions in a program many di

Page 391

The map DSECT follows.* TEST PANEL FOR REXX/CICS 00000010PANEL1S EQU * START OF DEFINITION 00000020SPACE 00000030DS CL12 TIOA PREFIX 00000040DUSERIDL

Page 392

/* and initialize */'PSEUDO OFF'ZEROES = '00'x'CICS GETMAIN SET(WORKPTR) LENGTH(90) INITIMG(ZEROES)'VAR1 = 'USERID

Page 393

REXX/CICS HEADER PANEL1 PANEL1PLEASE ENTER YOUR USERID: TESTMSG: Please enter 8 character USERIDBMS Example430CICS TS for VSE/ESA: REXX Guide

Page 394

Appendix K. Post-Installation ConfigurationThis appendix has a list of the steps to configure the REXX support.Create the RFS FilepoolsThe REXX Filing

Page 395

COPY CICHPREP.Z:=.PROC R=YCOPY CICIVP1.Z:=.PROC R=YCOPY CICIVP2.Z:=.PROC R=YCOPY CICIVP3.Z:=.PROC R=YCOPY CICLCLIB.Z:=.PROC R=YCOPY CICLELIB.Z:=.PROC

Page 396

Format the RFS FilepoolsEnsure that all required configuration tasks have been performed, and if necessary re-start CICS. Sign onwith a userid defined

Page 397 - WAITREAD

CONNECT S=PRD1.BASE : user.sublibCOPY CICR3270.Y : CICR3270.BOOKCOPY CICINDEX.N : CICINDEX.PANSRCCOPY CICSNDX.N : CICSNDX.PANSRCCOPY CICCHAP.N : CICCH

Page 398

Sample output:Enter a REXX command or EXIT to quitCALL CICIVP1***------------------------------------------------------****** This is a test REXX prog

Page 399 - Part 3. Appendixes

A package for the CICSQL program is loaded into the DB2 database under the SQLDBA user. This issupplied as member CICSQL.A.If you fail to do this, REX

Page 400

BibliographyCICS Transaction Server for VSE/ESA Release 1 libraryEvaluation and planningCICS TS for VSE/ESA Enhancements Guide GC34-5763CICS TS for VS

Page 401

For example, if A=4and Z=3, then the results of the previous comparison questions are:(A=Z) Does4=3? 0 (False)(A>Z) Is4>3? 1 (True)(A<Z) Is4&

Page 402 - Error Numbers and Messages

CICS ClientsCICS Clients: Administration SC33-1792CICS Universal Clients Version 3 for OS/2: Administration SC34-5450CICS Universal Clients Version 3

Page 403

TCP/IP User's Guide SC33-6601Turbo Dispatcher Guide and Reference SC33-6797Unattended Node Support SC33-6712High-Level Assembler Language (HLASM)

Page 404

Diagnosis LY43-0065Data Areas LY43-0104Messages and Codes SC31-6493Migration Guide GC31-8072Network Implementation Guide SC31-6494Operation SC31-6495O

Page 405

DL/I VSEApplication and Database Design SH24-5022Application Programming: CALL and RQDLI Interface SH12-5411Application Programming: High-Level Progra

Page 406

442 CICS TS for VSE/ESA: REXX Guide

Page 407

NoticesThis information was developed for products and services offered in the U.S.A. IBM®may not offer theproducts, services, or features discussed i

Page 408

444 CICS TS for VSE/ESA: REXX Guide

Page 409 - Appendix B. Return Codes

TrademarksThe following terms are trademarks of International Business Machines Corporation in the United States,or other countries, or both:ACF/VTAM

Page 410

446 CICS TS for VSE/ESA: REXX Guide

Page 411

IndexSpecial characters! prefix on TRACE option 168? prefix on TRACE option 167/ (division operator) 21, 116, 218// (remainder operator) 21, 116, 221/

Page 412

Exercises - Using Comparison Expressions1. Based on the preceding example of using a comparison expression, what result does the languageprocessor pro

Page 413 - LISTCLIB and LISTELIB

CASE command 236, 242CATMOUSE EXEC 91CD command 127, 231, 258, 321, 339CEDA command 105, 323CEMT command 105, 324Century option of DATE function 182CH

Page 414

error 379, 387debugging 29ERROR 225ERROR condition of SIGNAL and CALLinstructions 228error messages 12ETMODE 151European option of DATE function 182ev

Page 415

FFAILURE condition of SIGNAL and CALLinstructions 225, 228failure, definition 125featureof REXX 3FIFO (first-in/first-out) stacking 160file access sec

Page 416

LPUSH command 276LQUEUE command 277MMACRO command 246mapping between commands 319master terminal transaction (CEMT) 3messagesinterpreting 12minutes ca

Page 417 - General Description

quotation marksaround a literal string 6in an instruction 6Rrandom number function of RANDOM 190RDIR command 263READ command 277recursive call 136refe

Page 418 - Symbols and Strings

subkeyword 120subroutinecomparison to a function 57, 70description 57protecting variable 62writing 58subsidiary list 142, 155SUBSTR 192substring 192su

Page 419 - Instruction Examples

454 CICS TS for VSE/ESA: REXX Guide

Page 420 - SAY and TRACE

Sending your comments to IBMIf you especially like or dislike anything about this book, please use one of the methods listed below tosend your comment

Page 421 - DBCS Function Handling

456 CICS TS for VSE/ESA: REXX Guide

Page 423

OperatorMeaning& ANDReturns 1 if both comparisons are true. For example:(4 > 2) & (a = a) /* true, so result is 1 */(2 > 4) & (a = a

Page 424

SC34-5764-01

Page 425

Spine information: CICS TS for VSE/ESA REXX Guide

Page 426 - DBBRACKET

\___________________/ /true /\_____________________________/trueAs a result, when you run the program, it produces the result:Go skiing.Exercises - Us

Page 427 - DBCJUSTIFY

ContentsPreface ...xixWhat this book is about ...xixWho this book is for ...

Page 428 - DBRRIGHT

The result of this example is:baseball £ 5A more sophisticated way to format information is with parsing and templates. Information about parsingappea

Page 429 - DBUNBRACKET

3. Evaluate 0&1is 0Exercises - Priority of Operators1. What are the answers to the following examples?a. 22 + (12 * 1)b. -6/-2>(45%7/2)-1c. 10*

Page 430 - DBVALIDATE

When you run the example, the SAY instruction produces:9*-*IFa+1>5*y>V> "9">L> "1">O> "10">L>

Page 431 - Reserved Keywords

When you run this program, it produces:12*-*IF(a>z)|(c<2*d)>V> "1">V> "2">O> "0">V> "

Page 432 - Keywords and Variables

Using Variables and Expressions32CICS TS for VSE/ESA: REXX Guide

Page 433 - Appendix E. Debug Aids

Chapter 4. Controlling the Flow within a programThis chapter introduces instructions that alter the sequential execution of a program and demonstrates

Page 434 - Debug Aids

As a REXX instruction, the flowchart example looks like:IF expression THEN instructionELSE instructionYou can also arrange the clauses in one of the f

Page 435 - Business Solutions

Looking at the program you might assume the ELSE belongs to the first IF. However, the languageprocessor associates an ELSE with the nearest unpaired

Page 436 - Business Value Discussion

Exercise - Using the IF...THEN...ELSE InstructionWrite the REXX instructions for the following flowchart:ANSWERIFa=0THENIFc=2THENz=1ELSE NOPELSEIFz=2T

Page 437 - Product Positioning

SELECT WHEN...OTHERWISE...END InstructionTo select one of any number of choices, use the SELECT WHEN...OTHERWISE...END instruction. In aflowchart it a

Page 438

Tracing Results ...30Exercises - Using the TRACE Instruction ...30Chapter 4. Controlling the Flow wit

Page 439 - Defining Authorized Users

Each SELECT must end with an END. Indenting each WHEN makes a program easier to read.Exercises - Using SELECT WHEN...OTHERWISE...END"Thirty days

Page 440 - Parameters

Using Looping InstructionsThere are two types of looping instructions, repetitive loops and conditional loops. Repetitive loops letyou repeat instruct

Page 441 - Function IDs

DO number=1TO5SAY 'Loop' numberSAY 'Hello!'ENDSAY 'Dropped out of the loop when number reached' numberThis example resul

Page 442

This example sends strings to a user-written function for processing and then issues a message that theprocessing completed successfully or failed. Wh

Page 443 - Appendix H. Security

Number 1Number 2Number 3Number 4Number 5Number 6Number 7Number 9Number 10Exercises - Using Loops1. What are the results of the following loops?a.DO di

Page 444

DO WHILE LoopsDO WHILE loops in a flowchart appear as follows:DO WHILETr ueinstruction(s)expressionFalseENDAs REXX instructions, the flowchart example

Page 445

DO UNTIL LoopsDO UNTIL loops in a flowchart appear as follows:FalseDO UNTILTr ueinstruction(s)expressionENDAs REXX instructions, the flowchart example

Page 446

Exercise - Using a DO UNTIL LoopChange the program in the previous exercise on page “Exercise - Using a DO WHILE Loop” on page 43from a DO WHILE to a

Page 447

ANSWERCombining Types of LoopsYou can combine repetitive and conditional loops to create a compound loop. The following loop is set torepeat 10 times

Page 448

DO outer=1TO2DO inner=1TO2SAY 'HIP'ENDSAY 'HURRAH'ENDThe output from this example is:HIPHIPHURRAHHIPHIPHURRAHIf you need to leave

Page 449

What is a Host Command Environment? ...82How Is a Command Passed to the Host Environment?...83Changing the Host Com

Page 450 - BMS Example

Outer 1 Inner 1Outer 1 Inner 2Outer 1 Inner 3Outer 2 Inner 1Outer 2 Inner 2Outer 2 Inner 3Outer 3 Inner 1Outer 3 Inner 2Outer 3 Inner 32. The result i

Page 451

CALL and RETURN InstructionsThe CALL instruction interrupts the flow of a program by passing control to an internal or externalsubroutine. An internal

Page 452

SIGNAL InstructionThe SIGNAL instruction, like CALL, interrupts the usual flow of a program and causes control to pass to aspecified label. The label

Page 453 - Rename supplied Procedures

Chapter 5. Using FunctionsThis chapter defines what a function is and describes how to use the built-in functions.What is a Function?A function is a s

Page 454 - Update CICSTART.PROC

Rather than writing multiple instructions every time you want to find the maximum of a group of threenumbers, you can use a built-in function that doe

Page 455 - Create the Help Files

Arithmetic FunctionsFunction DescriptionABS Returns the absolute value of the input number.DIGITS Returns the current setting of NUMERIC DIGITS.FORM R

Page 456 - Verify the Installation

Formatting FunctionsFunction DescriptionCENTER orCENTREReturns a string of a specified length with the input string centered in it, with pad character

Page 457 - PI Configuration

Function DescriptionWORDPOS Returns the word number of the first word of a specified phrase in the input string.WORDS Returns the number of words in t

Page 458

Other useful built-in functions to test input are WORDS, VERIFY, LENGTH, and SIGN.Exercise - Writing a program with Built-In FunctionsWrite a program

Page 459 - Bibliography

Chapter 6. Writing Subroutines and FunctionsThis chapter shows how to write subroutines and functions and discusses their differences and similarities

Page 460 - VSE/ESA Version 2 Release 5

Operators ...115Parentheses and Operator Precedence ...118Clauses and Instructions ...

Page 461 - Bibliography 439

CALL SUBSTR 'verylongword', 1, 8a = RESULT /* a is set to 'verylong' */When deciding whether to write a subroutine or a function,

Page 462 - DB2 Server for VSE

instruction(s)EXITinstruction(s)instruction(s)RETURNz=func1(arg1, arg2)Both subroutines and functions can be internal (designated by a label) or exter

Page 463 - PL/I for VSE/ESA (PL/I VSE)

FUNC2ARG var1instruction(s)RETURN valueMAINinstruction(s)z=func2(arg1)instruction(s)………exitWhen to Use Internal Versus External Subroutines or Functio

Page 464

The next example is the same, except it passes information to a function rather than a subroutine. Thesubroutine includes the variable answer on the R

Page 465

The next example is the same, except it passes information using a function instead of a subroutine.To avoid this kind of problem in an internal subro

Page 466

The following examples show how results differ when a subroutine or function uses or does not usePROCEDURE.The next two examples are the same, except

Page 467 - Trademarks

Exposing Variables with PROCEDURE EXPOSE: To protect all but specific variables, use the EXPOSEoption with the PROCEDURE instruction, followed by the

Page 468

In a function call, you can pass up to 20 arguments separated by commas.function(argument1,argument2,argument3,...)Using the ARG Instruction: A subrou

Page 469 - Special characters

In the two preceding examples, notice the positional relationships between long and length, and wide andwidth. Also notice how information is received

Page 470

Exercise - Writing an Internal and an External SubroutineWrite a program that plays a simulated coin toss game and produces the accumulated scores.The

Page 471 - Index 449

OPTIONS ...151PARSE ...152PROCEDURE ...155PULL ...

Page 472

Exercise - Writing a FunctionWrite a function named AVG that receives a list of numbers separated by blanks and computes theiraverage. The final answe

Page 473 - Index 451

/******************************* REXX ********************************//* This function receives a list of numbers, adds them, computes *//* their ave

Page 474

Subroutines and Functions—Similarities and DifferencesThe following tables highlight similarities and differences between subroutines and functions:Si

Page 475 - Index 453

Chapter 7. Manipulating DataThis chapter describes how to use compound variables and stems and explains parsing.Using Compound Variables and StemsSome

Page 476

DOi=1TO6PARSE PULL employee.iENDIf you use the same names used in the example of the employee array, you have a group of compoundvariables as follows:

Page 477 - Sending your comments to IBM

h. SAY a.firsti. SAY z.a.42. After these assignment instructions, what output do the SAY instructions produce?hole.1 = 'full'hole. = 'e

Page 478

/* This REXX program parses the string: "Knowledge is power." */PARSE PULL word1 word2 word3/* word1 contains 'Knowledge' *//* wor

Page 479

quote = 'Knowledge is power.'PARSE VAR quote word1 word2 word3/* word1 contains 'Knowledge' *//* word2 contains 'is' *//

Page 480 - SC34-5764-01

StringIf you use a string in a template, parsing checks the input data for a matching string. When assigning datainto variables, parsing generally ski

Page 481 - REXX Guide

/* part1 contains 'Igno' *//* part2 contains 'rance' *//* part3 contains ' is bliss.' *//* part4 contains 'Ignoranc

Comments to this Manuals

No comments