SLAC-368 CONF-9006245 UC-405 (M)

PROCEEDINGS OF THE SYMPOSIUM FOR DEVELOPERS AND USERS

June 11,1990

STANFORDLINEAR ACCELERATOR CENTER STANFORDUNIVERSITY, STANFORD, CALIFORNIA 94.309

Cathie Dager Symposium Organizer

Nancy Larson Symposium AdministrativeAssistant

Prepared for the Department of Energy under contract number DE-AC03-76SF00515

Printed in the United States of America. Available from the National Technical Information Service, US. Department of Commerce, 5285 Port Royal Road, Springfield, Virginia 221 61. Price: Printed Copy A1 1, Microfiche AOI. PROCEEDINGS OF THE REXX SYMPOSIUM FOR DEVELOPERS AND USERS

TABLE OF CONTENTS

A. Summary II

B. Presentations : REXX 4.0 1

Bill Hawes Multitasking with REXX Marvin Weinstein: (no paper) Walter Pachl: IBM REXX Compiler 33

Kevin Kearney The Astonishment Factor 59 Charles Daney:

Keith Watts: Environmentand I/O Challenges 65

Brian Marks: OrientedObject REXX 75

Rick McGuire:IBM SAA REXX for OS/2 101

Neil Milsted: REXX for UNlX 112

Bob O'Hara:Why REXX Died (A Retrospective)124

Tony Johnson: SLAC Use of REXX on VM and VMS 132

Larry Oppenheim: Developing Fullscreen REXX Applications 152

Bebo White: CMS Pipelines 157

Mason Kelsey: REXX in Three Different Environments: VM/MVS/OS/2 172

C. List . of Attendees 23 1

D. Announcement of REXX Symposium for 1991 235

1 SUMMARY The first REXX Symposium for Developers and Users was held at t,he Stanford Linear Accelerator Center on June 11, 1990. Mike Cowlishaw, au- thor of the REXX Language, was the keynote speaker and the developers of all current implementations of REXX made presentations. The 118 par- ticipants represented five countries and allof the REXX user communities. This broad participation demonstrates the growing interest in REXX as a multi-platform computer language. The Symposium was planned as a gathering where REXX users and developers couldmeet each other, exchange ideas and information about the language and discuss future plans. In light of these plans, the morning and early afternoon of the Symposium were devoted to plenary presentations by the developers of various REXX implementations:

0 IBM SAA REXX; Mansfield Software Group Personal REXX for DOS and OS/2;

0 Portable REXX for DOS and TREXX for Tandem by Keith Watts;

0 Amiga AR.EXX by Bill Hawes; and the Workstation Group UniREXX for . Following the individual talks t'he developerssat on a panel and participated with the audience in a lively question and answer period. Late afternoon speakers talked about how they use REXX. This volume containscopies of the talks and transparencies. The Symposium was a success and many ideas were exchanged. Discus- sions included multi-platform considerations, requests for language exten- sions and st'andards and plans for continuing the work at another Sympo- sium next year. (Refer to Announcement of REXX Symposium for 1991.)

.. I1 ti In this paper for the REXX Symposiunl. for DewEopers and Users the history of the REXX language is reviewed and the new features in RE= level 4.00 are introduced. REXX level 4.00 is described in detail in the author’s new book, the Second Edition of The REZLanguage (Prentice-Hall, 1990, ISBN 0-13-780651-5j; this is the language irnp’lemented in the IBM OW2 Extended Editiejn : Release 1.2.

The REXX language (originally called “REX”) has developed in two distinct phases: the first being the rapid evolution of the language in an essentially experimental environ- ment, and the second being a more cautiousseries of enhancements following the commercial availability of implementations of the language. The first phase took place as a personal project of about four thousand hours during the years 1979 through 1982, at the IBM UK Laboratories near Winchester (England) and at the IBM T. J. Research Center in New York (USA). With this background RE= has an internat.ionaI flavour, with roots in both the European and North Amer- ican programming cultures. Its first presentation outside IBM was to SHARE 56, in Houston, in 1981. In 1983, my own Systed370implementation became part of theVirtual Machine/Syst,em Product, as the System Product Interpreter for the Conversational Monitor System (CMS). This implementation of the language is described in the Ref- erence Manual for that product.’ In 1985 the first edition of The REXX Language (de- scribing language level 3.50) wa.s published, and mon after that the pioneer non-IBM implementation of REXX was announced by t.1~Nmsfield Software Gr0u.p: this runs under the MS-DOS and PC-DOS operating systems for Personal Computers. A number of other implementations have followed from a variety of suppliers: one which perhaps best demonstrates the suitability of REXX for chfferent environments is a version for the Commodore Amiga computer. The next milestone for REXX was its choice by IBM as the Procedures Language for the Systems Application Architecture (SA4).2This 1987 announcement implies a com- mon REXX language across all the SAA operating systems: VM, MVS, OS/400, and OS/2.3The language interpreter development for all these environments is coordinated at the IBM Endicott Programming Laboratory, New York. All the first implementations of REXX were interpreters: notable, then, was the an- nouncement in 1989 ofIBM’s CMS REXX Compiler,developed at the IBM Vienna Software Development Laboratory in Austria with helpfrom the IBM Scientific Centre at Haifa in Israel. Inevitably the commercial exploitation of the language has required a stable language definition - the radical changes in the language that were characteristic of its first years are no longer possible. Fortunately, those early years of heavy use and rapid evolution probably mean that such radical changes are no longer necessary: rather one would expec,t to see incremental changes and adjustments consistent with the philoso- phy of keeping the language small and approachable. This, indeed, is the philosophy that hasbeen followed during the developmentof REXX level 4.00 over the past several years.

REXX 4.00 - Philosophy New features have been added to the REXX definition following a process of slow re- finement,essentially based on user feedback. In general the intention has been to “Keep the language small”, so the enhancements that have been made have beencho- sen for their high power-to-complexity ratio. Some of the enhancements have been made for pragmatic reasons,as such for improved inputand output flexibility(recognising the diversity of operatingsystems), error handling, etc. Others have been made in order to “tidy up” the language; these include improved arithmetic, defined character sets, and so on. ..- ...... ~ . ....

The Procedures Language for SAA comprises the REXX language, Double Byte Character Set support, and a series of common interfaces to the language.

More formally: CMS in the WSystem Product or VMExtended Architecture, TSO/E in the Enterprise Systems Architecture/370, Operating Systeml400 for the Application Systeml400 (AS/400), and Oper- ating Systeml2 Extended Edition.

2 DATE('%'') Base Date function has been added (this returns the number of days since 1 January 0001, calculated by extendmg today's calendar backwards). 11 June 1990 is day 726628. DAT%("c") Century Date removed because it is superseded by DATE("b"), and its use is likely to lead to problems in a few years4 Trace Scan Removed because it is very expensive to implement in certain cases. f $ @ $4 @ Removed from symbols (names) due to difficulties in cross-system transfer and portability.

nhancements * Mathematicalfunctions are consistentlydefined to normalizeinputs before use (most did before, though MIN and MAX &d not and could therefore produce sur- prising answers). * The definition of basic operators has been clarified (the previous description did not fully define addition and subtraction, for example). * The Power operator has been slightly redefined for improved accuracy:

should equal

FRED * FhUED * FRED

The algorithm is now defined as using precision D + L + 1 for its intermehate cal- culations, where D is the NUMERIC DIGITS setting, and L is the length of the exponent part of the number.

a Integer Divide and Remainder are in error if the result or partial result, respec- tively, is not a REXX whole number. For example:

123+30//7

was

(instead of 5) and is now an error. This avoids misleading results.

Removing an item from the language does not imply that it would be removed from existing imple- mentations.

3 Parsing A new, explicit, “Absolute” column notation has been added:

parse arg =5 rest

is the same as

parsearg 5 rest

This adds no new function to the language, but allows the following extension: * Indwect column number (absolute or relative), where the value of a variable can be used for column specification by enclosing its name in parentheses andpreceding

K-”, .. it with “+”, or “=,’. For example: ...... , .,. .. start=7 length=5 parsearg =(start) a +(length)

is the same as

parsearg =7 a +5

Binary String Support Newbinary-defined string notation:

‘1100 0001‘b = ’Cl‘x

New hexadecimal to binary conversionfunction:

x2b (’ BE’ ) --> ’ 1011111O‘

New binary to hexadecimal conversion function:

b2x (’10111110‘ ) --> ‘BE‘

.. .,. . .,...... Input/Output Enhancements .. New STREAM built-infunction, for: 1. Formal state of a stream (Error, Ready, Not Ready, or Unknown) 2. Descriptive state of a stream (adhtional information) 3. System-dependentstream commands.

4 * New NOTREADY condition for improved error handling. For example:

signal on notready

which might be raised when end-of-file is reached on a stream.

Improved Error * The CALL ON condition instructionlets a subroutinebe called for the ERROR, FAILURE, HALT, or NOTREADY conditions. The new NAME option for CALL OX or SIGXAL ON allows the specification of a label which will be the targetof the CALL or SIGNAL when the conditionis raised.

or

signal on error name baddie

* The new CONDITION built-in function can be asked to return: 1. The name of current trapped condition 2. A descriptive string associated with the condition(for example,the derived name of the variable whose attempted reference caused NOVALUE) 3. The instruction used to trap the condition (that is, CALL or SIGNAL) 4. Formal state of the conchtion (ON, OFF, or DELAY). DELAY is used when a condition has been raised but bas not yet been processed.

Enhanced variable handling Indwect lists may be used on PROCEDURE EXPOSE; variables whose names are enclosed in parentheses are themselves exposed and then their value is used as a list of variables to expose. For example:

vars=' fred mark st-. '

call mysub

mysub : procedure expose (vars) 20s.

return e Indirect lists are similarly permitted on the DROP instruction.

The VALUE function can now set variables:

ansther=3 €red=‘ ANOTBEEl‘ say value (fred, 51

sets ANOTHER to 5, and displays 3 (the the previous value of ANOTHER).

0 The VALUE functioncan now refer to external collections of variables(system- defined). For example:

say value (’ LIB‘ , , ‘ OS2ENVIRONKENT‘ )

.. in the OS/2 implementation provides access to the OW2 environment variables. , ... Thisexample might display “C:\OS2”. If a second argument is given then the variable will be set, as before.

6 7 ...... _......

0 0 cyj X uX CT I 0 32 0 a, P Q, cb X 3 X cr, W c U

T

8 ....

+--r C 3 0 0 X

...., ......

r' w>

X -. X a, k3 u CT .c.r 3 a v, L kh ii h ..' ...... ,......

0 0 l-

9 ..- eL4 > a ud

...... ,. ...

......

10 4

. ... .

11 cbgL QQ)P

......

12 u

...... -......

0 .-4-J

-Kgz

m,."0

n ...... OJ ...

-W s- +

......

13 ...

-c-ra X w

VB -0 a- s- L

+ +

......

14 s ...... ~...... _

cb

b c.. c..

rna, t cd .-rn 3 cn 0 a C a-cb

."...... I1 ~.,, ...., ...... ~~ II ...... ~......

15 b

+--ra, a0 r.ki 0

h n -.. I 0 U 0 a,> 0 6 2i. X E X .. .. W Q CT 3 cn .-S cn .- ax La QG= ci

16 Y- O I

a, -- . 12 . ,. .. . E .. 3 u-S 7 0 0 0

U U w" I- na

17 I-c a, N .I

n

a M G-r2 JC JC sc .. a 13 cn 2 a, G-r cn 3

. .\.

18 b 0 hc- a, .. a ., ...... cn ...... 9Ja

03 *jc Q 3 2 0 b-4 Iz v,

19 20 L 0 a, +.-r

E 3 S

m P II II rG .. .. . c, c, . .. k b rd d c, a, cn I-i

21 ......

4 El p7 x 4 4 ri u A 4 I I II II a 4 d 0 0 0 0 0 d d 1.

22 . ,. ..

U c

W W E

23b -c-rcno

a .s eu'

23 .F Q,

Em

24 L +0 U a,

c, -4 x a, c a, JZ c,

.. k

k a,

25 a, E rd r= k 0 k k 0 k k a, k a, G c 0 0

c) L 0

26 cn U

27 .. . .. - ul k rd 3 v

......

*

28 w0 oc. -.ruu-

29 ...... I...... - .. ,.. ...- ._.

E a-a, wd4J 0- cn c4tr Xka,

3

...... , ......

30 0 PC: H 3 wz cu [/I 0 \

\

...... Q ...... - .-cn 73 E 0 E

31 m

32 Walter Pachl

IBM Vienna Software Development Lab Austria

.. . ,...... June 1990

33 werview

REXX Positioning

Supported Environments

REXX Compiler Product Components

REXX Compiler Benefits

erformance Improvements

Compiler Output

Compiler Usage Scenarios

Compiier tnvscation

Differences to the CMS Re1 6 Interpreter

C~a~~e~~~to Compile REXX ..

__...... CWlS REXX Cornpiier IBM 6/90 Walter Pachl

34 REXX Positioning

TEXT EDITOR .. .. . COMMAND PROCESSOR ...... - .. .. r-- .. System Commands JrogramLogic Ir-- ProgramLogic REXX f -

hogram Logic System Command: Application Command: ProgramLogic

'CASUAL' APPLICATION APPLICATION PROTOTYPING yr AND PROGRAMMTNG

aS + REXX hasbeen implemented interpreters

Excellent debugging features ...... Very short and appealin! editlrun cycle

+ Interpreters - by nature - are slow !

- CMS REXX Compiler IBM 6/90 Walter Pachl

35 ...... , ......

Interpreter

~ I

Running REXX Program

Everything needs to be done at run-time

.."......

-. CMS REXX Compiler IBM 6190 Walter Pachl

36 How does the REXX Compiler work

Two step approach

+ Compile ...... - -......

Object ----, Program

Source Compiler ---- Program i Program o ProgramAnalysis

o AddressResolution Doeumen- tation Code Generation/ Optimization ---- c

Compiler's

Run-time

Support ......

I I

Running REXX Program

-. -. . CMS REXX Compiler IBM 6/90 Walter Pachl

37 Supported Environments

d CMS Re1 5

on VM/SP Re1 5 (5664-167) .. . and VM/SP Rei 5 HPO (5664-173) .. .. . and follow-on releases

d CMS Re1 5.5 (XAsupport)

on VM/XA SPI (5664-308)

and follow-on releases

+ "REXX Compiler SPE" to upgrade the operating system for support of compiled REXX

APAR VM36990 VMlSP Re1 5 . -.. .. . _.. . Re1 6 APAR VM37841 .. VM/XA SP Re1 I APAR VM36991

___.-...... _ CMS REXX Compiler IBM 6/90 Walter Pachl

38 REXX Compiler Product Components

+ Compile-time Part

Set of compiler phases performing ail compilation tasks

Written in C and compiled with SAA C1370 Compiler

Prerequisitewhen compiling:

IBM (3370 Library (5668-039)

+ Run-timeSupport

Common routines which are invoked from compiled REXX program

String Arithmetic, Conversions, Comparisons, Built-in Functions, Compound Variable Access, _..

...... -.- - 0 Extremely time critical --> written in Assembler

Can be loadedinto a DCSS

Compiler IBM CMS REXX Compiler 6/90 Waiter Pachl

39 + Compiled WEXX significantlyfaster than interpreted

...... ,

+ "Pletg-Compatibility"with interpreted REXX programs

+ LanguageEquivalence with REXX Interpreter (SPI)

+ "Unreadable" REXX programs

+ ComprehensiveProgram Documentation

____.-.-- CMS REXX Compiler IBM 6/90 Walter Pachl 7

40 REXX Compiler Benefits

Comprehensive REXX program documentation

Source and Cross-Reference Listings Syntax check of whole program More accurate messages

0 Increasedeveloper productivity

Improveprogram quality

"Unreadable" compiled REXX code

Provides for REXX programintegrity

Providesfor improved maintainai.d!t)

Protects REXX coded assets

CMS REXX Compiler IBM 6/90 Walter Pachl I7

41 REXX Compiler Benefits ...

LanguageEquivalence with the Interpreter ... .- + REXX ...... ~...... NO compiler-specific language features !

0 Minimizemigration effort

Almost all REXX programsrun unchanged - except those with INTERPRET instructions

+ Support of SAA ProceduresLanguage

Flagging of non-SAA items (optional)

Eases reuselmigration intoother SA A environments

-- -- -. - CMS REXX Compiler IBM 6/90 Walter Pachl

42 REXX Compiler Benefits ...

+ "Plug-Compatibility"with the REXX Interpreter .. .

Identical external interfaces

Compiled REXX programs"transparently" replace interpreted ones

No restriction on theirmutual invocation

+ Compiler,Run-time, compiled programs "exploit" XA

Run and usestorage also above the Wry:ltbyte line

Make roomfor others below the line

.- CMS REXX Compiler IBM 6/90 Walter Pachl

43 Significant Run-Time Performance improvements -_

Performance gains depend heavily on the program contents ., .,-.. . . .-. .. ., .. ., ...~. .._..

Programs with TINES Performance a lot of .. . faster than Category Interpreter

Arithmetic operations with default precision 6 - 10+ VERY HIGH Arithmetic operations with other precision 4 - 25 VERY HIGH

Assignments 6 - 10 VERY HIGH

Changes to variables' values 4- 6 HIGH

Constants and simple variables 4- 6 HIGH

Reuse of compound variables 2- 4 W-CTUM

Host commands 1- 2 L old -.- - ......

-- - . CMS REXX Compiler IBM 6/90 Walter Pachl

44 Significant Run-Time Performance Improvements ...

Assumptions

.. - ...... -. An interpreted REXX program -......

uses 12 secondsvirtual CPU runs 60 times a day for 30 days a month

Performance Hours/month Hourdmonth Category RUN SAVED

Interpreted 6

MEDIUM 3 - 1.5 3 - 4.5

HIGH 1.5 - 1.2 4.5 - 4.8

VERY HIGH 1.2 - 0.6 4.8 - F.6

+ With a performanceimprovement 2 - 10 + CPU usage will reducefrom 6 h/month + tojust 3 - 0.6 h/month

-- CMS REXX Compiler IBM 6/90 Walter Pachl

45 Compiler Output

4 Programdocumentation

e Sourcelisting ...... 1. Messages .... * Cross-referencelisting

4 Compiled REXX Program CompiledCode

Executable /370 instructions Merspersed with invocations of run-time routines Reentrant and relocatable Run-timecontrol blocks Symbol tree of all program items

4 Behaves EXACTLY likeinterpreted REXX

4 "immediately"executable

4 EXECLOADable

0 Can be loaded into an lnstallationDCSS

- _... -. __ CMS REXX Compiler IBM 6/90 Walter Pachl *"

46 Source Listing example

SAMPLE EXEC G1 CliS REXX COMPILER 1.1.0 TIME: 11:35:02 DATE: 30 Hay 1989 IF DO SEL LINE C -+-1-+-2-+-3-+-4-+-5--

1 /* SAMPLE incorrect REXX program X/ 2 3 Parse ArgTmp 4 Val. = TRANSLATECtmp) 5 line.2 = LEFT(val.,2,'40') I +++EAGGA00771S Invalid or missing argumentcs) on built-in function 6 $ = EXTFUNC(line.2) 7 CallINTFUNC 2 8 Exit 9 10 INTFUNK: Procedure Expose x. i 11 Signalon NOVALUE NAME my-value I +.++EAGGA00072SLabel notfound 12 Do x.i 1 13 If x.i//2 /= 0 then 11 14 say "Odd: " x.i 1 15 End 16 Return 17 18 my-valu: Say "NOVALUE raised at I " sigl 19 Return 20 /W end of program SAMPLE I +++EAGGA00654S Unmatched "/%"

--__ . - CMS REXX Compiler IBM 6/90 Walter Pachl

47 Cross Reference List example

ITEM ATTRIBUTE LINE REFERENCES

-- LABELS, BUILT-IN FUNCTIONS, EXTERNALRTNS - EXTFUNC EX1 RTN 6 INTFUNC EX1 RTN 7 INTFUNK LABEL lO(d) LEFT BUILT-IN 5 MY-VALU LABEL 18(d) MY-VALUE LABEL+++ ll(u) TRANSLATE BUILT-IN 4 - CONSTANTS - 'NOVALUE raised at: ' LIT STR 18 'Odd: ' LIT STR 14 0 NUMBER 13 L CONSTSYM 5 6 2 NUMBER 5 7 13 '40' LIT STR 5 SIMPLE VARIABLES -

$ SIMP VAR 6(s) I SIMP VAR 10 12 13 14 SIGL SIMP VAR 18 TMP SIMP VAR 3(s) 4 - STEMSAND COMPOUND VARIABLES -

LINE. 2 COMP VAR 5(~)L VAL. STEM 4(s) 5 x.1 COMP VAR 10 12 13 14

-- - CMS REXX Compiler IBM 6/90 Walter Pachl REXX Compiler Usage Scenarios

I: .- + Scenario Existing REXX programs .. .~ .. .

0 Compile -- > CorrectIMigrate L Compile and Run

0 Scenario 2: Newlydeveloped REXX programs

0 Code * SyntaxCheck - with REXX Compiler 0 Debug - with REXX Interpreter Compile - with REXX Compiler Run Run-time- Supportwith

Q REXX Compiler and Interpreter COMPLEMENT each other in program development

-__. . ..__ CMS REXX Compiler IBM 6/90 Walter Pachl

49 Compiled REXX Programs will ...

+ Significantlysave CPU time & reduce system load

Improve program quality & increase developer productivity

6 Providefor protection of REXX codedassets

+ Allow is keep applications in REXX

+ Saveexpensive rewrites toother HLL’s

+ Attractto write even moreapplications in REXX

-~.- CMS REXX Compiler IBM 6/90 Walter Pachl

50 How is a Compiled REXX program invoked

Execute:

(EXEC) SAMPLE

CMSEXEC handlerrecognizes type of EXEC and --b for a REXX program, invokesthe REXX Interpreter

Compile:

SAMPLE SAMPLE EXEC ICEXEC] Compiler A IA l-7 I I REXX Source Compiled REXX

FLIP-FLOP (rename)

REXXCompiled Source REXX

SAMPLE PIA--+ 1-71

(EXEC) SAMPLE

CMS EXEC handlerrecognizes SAMPLEEXEC as"Compiled REXX" -+ invokes REXX Compiler'sRun-time Support

---. . . CMS REXX Compiler IBM 6/90 Walter Pachl

51 Compiler Invocation ialog - REXXR

CMS REXX Compiler Specify a program. LicensedMaterials - Property of IBM Then select anaction. 5664-390 (ClCopyright XBM Corp.1989 All rightsreserved.

Program . . . . SAIIPLE-EXEC

2 Switch(rename1 source and compiled exec 3 Run activetsourcel 0program 4 Editsource program 5 Inspectcompiler listing 6 Printsource program 7 Print compilerlisting

8 Specifycompiler aptions

Argument string: ______

Command ===)

Enter F1-Help FtzFilelistFJ=Exit rlt=Cancel

- ______.____. CMS REXX Compiler IBM 6/90 Walter Pachl

52 Compiler Invocation Dialog - REXXD ...

CMS REXX Compiler Options Specifications

Specify which output files youwant, and their File-IDS

Fileidentifiers Program name SAHPLE name Program EXEC G1 V Compiler listing IY/N/P) = LISTING- =- Y Compiled 1Y/NEXEC I = Cr =- N TEXT file lY/Nl = TEXT-- =-

Specify compiler messagesto be issued I FLAG Minimum severity of messages to be shown II/W/EfS/T/Nl N TERM Display messages at the terminal (Y/NI NSAA SAA-compliance checking(Y/N)

specify contents of compiler listing Y SOURCE Include source listing IY/NI N XREF Include cross-reference listing (Y/NI 55 LC Number of lines per page 110-99 or, for no page headings, 0 or N)

Additional options N SL SupportSOURCELINE built-in function rY/Nl N TH Support HI immediatecommand [Y/NI S NOC Error level to suppress compilation Ir/W/E/S)

Special compiler diagnostics N- DUHP Produce diagnostic output (0-2047. Y. or NI

Command ===> __ - -. Enter Fl=HelpFZ=Filelist FJ=Exit F4=Save FSmRefrnsh Fh-Reset .- -_ .. .

- ... CMS REXX Compiler IBM 6/90 Walter Pachl

53 Differences to the CMS Ref 6 REXX Interpreter

+ INTERPRET Instructionnot supported

Rarelyused Difficultto implement Diagnosticmessage issued

0 Compilerdoes not generate code

So, try to avoid it - Interpret target'= 'expr -- > Call SETVAR target,expr For a SETVAR sampleAssembler program see! User's Guide Reference SH19-8120

Restructurethe program - isolateinterpretative part, - make it aseparate program, aw! - letthe interpreter handle it

. ._. CMS REXX Compiler IBM 6/90 Walter Pachl

54 Differences to the CMS Re1 6 REXX Interpreter ...

TRACEInstruction and Built-inFunction + , .., ...... ,...... Not supported in the interest of performance !

Does not change the semantics of a REXX program

No need to change REXX program

TRACEinstruction - NOP instruction TRACEbuilt-in function - "0" Interpreterdefault - "N"

Diagnosedwith an informationalmessage

+ PARSEVERSION version

REXXC370 3.46 30 Jun 1989

----. __ ...... CMS REXX Compiler IBM 6/90 Walter Pachl

55 hy is REXX hard to compile

... .- 6 PROCEDURE is an executableinstruction

Not a syntactic boundary Variables' life-time is dynamic - depends on calling sequence - "exposure"among procedures

e No denotation of the END of a procedure

Logical end is an executed RETURN

e Control can be transferred to ev~t-vv~~w~e even into "procedure" and loop bodies

0 Computed GOTO: SIGNAL VALUE

-. CMS REXX Compiler IBM 6/90 Walter Pachl

56 Why is REXX hard to compile ...

4 No data types

0 All data is "character string"

Sometimes contents mustbe "numeric", "whole number", or "Boolean"

4 No declarations

Variables come and go (DROP) . Can be shared withexternal programs (EXECCOMM) Names of variables canbe computed - tails of compound variables

Value of variables only limited by 4cmge Storage for values must be allocated dynamically .. . Arithmeticprecision can be set dynamically NUMERIC DIGITS

~- _- CMS REXX Compiler IBM 6/90 Walter Pachl Storage Requirements

4 MediumILarge REXX program of 4500 lines with 2500 instructions

Compiles - typically in a 4Mb virtual machine

(1Mb for (2370 Lib 4- REXX Compiler)

Storageon disk - about 50% more thansource (2 to 4 times as large for small and little commented programs)

Run-timestorage - about as much as Merpreted

+ 180 Kb for Run-time Support

--.. --.. .. _- CMS REXX Compiler IBM 6190 Walter Pachl The Astonishment Factor Kevin Kearney Mansfield Software Group, Inc. Charles Daney Quercus Systems June 11, 1990

59 “If a feature, acci entally misused, rently unpredictable results, a high astonishment factor and is therefore rnndesira

e says that

re§SiQIl]; LINEOUT’ ,[expression];

LINEOUT LINEBUT( ,)

A = LIINEQUT A = LINEOUT(,)

CALL LINEOUT PNEOUT * A = F(B) CALL F(B)

A = F(B,C)

CALL F(B,C) * LINEQUT(FILE,STRING) * Literals vs. Variables

Strengths of

* good human factors for reading & writing

.. * character string orientation ,. . .:.:. . ,. ...~ * stem variables * dynamic data typing * automatic storage management * few artificial limitations ..

Problems with the REXX Language

* scope of variables within program * access to variables in external routines * passing stems to subroutines * returning stems from subroutines

* iterating over values of a stem variable * array subscripting * signaYexception handling

Characteristics of the Presentation Manager

* object-oriented architecture * rich collection of user interface elements * message-driven design * multi-window, multi-tasking * single, serialized user input 'queue

62 Challenges facing REXX

* object-orientation * multi-tasking * event-driven programming * modeless application design

* interprocess communication & messaging

Object orientation may be found in:

* user interface * operating system architecture

* applications & data files as objects * programming languages

63 What is QOP?

* data abstraction * encapsulation

* hierarchical classes & inheritance * polymorphism

Benefits of QQP

* closer modeling of the real world

* easier code reuse & maintenance * natural for user-interface programming ...... * more efficient (eliminate switches)

64 ..

Keith Watts

.. . ..

65 ......

In parallel with the bloom of language offerings, the specification of REXX has not stood still. IBM's SAA procedures language specification {$6)has been revised, and specifications for other new features have arisen unexpectedly eisewhere. Michael Cowlishaw has revised Version 3.50 capabilities specified in his book called "The REXX Language" ($21, with Version 4.00 capabilities {93}.The MVS implementation {57} includes features which remah to be documented in the SAA standard. Presently there are numerous differences in the SAA and Cowlishaw definitions, and VM and MVS implementations. Furthermore, non- IBM vendor offerings have many additional refinements.

The following summarizes enhancementswhich remain to be commonly accepted:

Feature Source Variable pool interface [VPII SAA Double-byte character set [DBCSI s AA Multiple segmented stacks MVS Function packages MVS Callable condition handlers SAA, Cowlishaw 4.00 Stream I/O model Cowlishaw 3.50, 4.00 Permanent symbol pools Cowlishaw 4.00 Dropped special characters Cowlishaw 4.00 Bit string literals Cowlishaw 4.00

...... Perhaps IBM plans to revise the SAA specification, including all of those features, and to incorporate ...... these consistently within its product offerings. Those of us outside l8M have no idea how many . .~..~ independent language specification sources are authentic. VM origins

IBM's VM system environment was the breeding ground for the REXX language &21. This environment has several unique features which make theVM REXX implementation {§8}significantly different.

The foremost difference is how I/Q is accomplished. Files are organized into fixed size records: there are no special I/O characters such as carriage return and newline.A simple file naming conventionis used. I/O is canducted using the stack and the EXECI'J command, rather than ianguage statements. The only language statements which can perform I!Q are the SAY statement, and the stack accessing PULL, PUSH, and QUEUE statements. The Cowlisha:%' stream l/f3 modei is lacking.

REXX language 1/0 and environment challenges 66 There are ether significant differences. REX)( is embedded within the VM command interpreter, which is called CMS. As a consequence, it is already resident when a procedure request arrives. The stack is implicitly the source of input for any commands initiated by REXX. Thus, a REXX procedure can easily supervise the progress of commands it initiates. Furthermore, other command processors in the VM environment are modally accessible by name, making them eligible for connectivity with the AEDRESS statement. Console output can also be spooled to a file.

These featuresmay not be easily mimickedby REXX implementations in other system environments. This, in combination with Cowlishaw I/O model usage, causes VM REXX users to go through a painful transition period when they encounter other REXX implementations. Procedures which perform I/Q may require considerable and confusing revision until these work properly in the new environment.

...... - The Cowlishaw model for stream I/O is highly portable to a diversity of system environments. It can be ...... readily implemented usingstandard ANSI C library services. Theprimary benefit of this model, is that all fiie accesses can be performed using RE% procedure statements. It provides a base for productivity in file manipulations from a human perspective, even though it may be taxing of machine resources. Unfortunately, the Cowlishaw f/O model has not been accepted by IBM, and is noticeably absent in the SAA language specification and all IBM implementations. These use the aforementioned SAY and stack access statements for simple I/O. All other I/O is performed in programs developed using other language processors.

Cowlishaw's I/O model is simple, and well defined. Still, severalaspects require special attention.

Sequential files are either organized in fixed formats, or as an unorganized character sequence with records delimited by special end of line characters. Fixed formats predominate in IBM mainframe environments, whereas unstructured streams prevail in small and medium scale environments. Different methods are used to indicate the end of unstructured records. In MS-DQS@ environments a carriage- return, line-feed combination is usually used, but some developers consider either of these sufficient. unix8 uniformly treats a single line-feed character asa record divider.

Fixed length records are easily accessed, but are wasteful of space. As blanks consume a significant amount of file space, many methods of reducing these have been devised. Leading blanks are often replaced with tab characters. Whereas, trailing blanks are truncated during storage, and altered to pad characters during retrieval. Further space reduction can be achieved by run-length encoding, and data compression schemes.

All of these reduction techniques can significantly impact the portability of REXX procedures which perform l/O using Cowlishaw's model. For example,one system the author works with decided to replace tab characters with 10 spaces, by default.A low level override was required to disable this unsatisfactory behavior.

I/O involving binary data values Is also troublesome. System designersmay have preemptedany binary fila access intentions a REXX procedure developer harbors, with automatic actions performed whenever special values arrive, andno circumventions at hand. As a general rule, the character-at-a-time functions might be capable of binary I/O, but the line-at-a-time functions will rarely tolerate binaryvalues and are highly unportable when used for this purpose.

REXX language i/B and environment challenges 67 Cowlishaw's I/O model must be restricted when relative I/O is performed with console devices. Though this can be used to effectively access a specific screen character position, users wilt not appreciate procedures which reference position 99,999.

Input from consoles is also a nuisance. The methods for acquiring console input in VM, MVS, PC, and unixB environments are highly unportable.

PC. unix@,, andother environinents enable files to be redirected as stzndard program input and output. Thess rsdiracted files can be bsneficiaiiy linked with the default input and output streams of Cowlishaw's I!O model. This leads to significant productivity gains, as a singie procedure can be reused for multiple purposes simply Sy varying external input and outplrt destinations...... ".... - I. New probfems are introduced when default streams are eligible for redirection. Binary character values often have special rneanings whichcannot be altered. For example, in MS-DOS@ "1A"x [Ctrl-21 is an immediate end of file character, which causes all input and output on redirected streams to cease. Also, when defauit streams are redirected, the SAY and PULL statements may be unable to communicate directly with the terminal user; communicatingwith file destinations instead. This requires the introduction of console immediate stream destinations,so procedures can explicitly communicate with the user. ary inter-pa

Communicating between processes using a simple stream model would be beneficial, but there are aifficulties when binary data is interchanged with other processes. How is the end of a byte sequence indicated? IC an empty string is sent using LINEOUT, should any line ending characters be sent? When characters arrive, shocrld special character values be translated? Other problems arise when these inter- ~KXXSS cornnrunicatians proceed asynchronously, with optional exchanges of acknowledgements. Even worse, a HEY& procedure can sake when a synchronous response is expected from a partner which erroneousiy fails to respond, or if bath sides simultaneously enter receive waits.

The main problem for performing non-stream 1/O in REXX is specifications; there are none. It's 1990 and the REXX language is as capable at I/O as rnost 3rd generation languages achievedin the 1960's, and that presumes Cowlishaw's 1/0 model is defined. Whereas the SAA language specification and the VM and MVS implementations consider I/O barely necessary. Apparently these groups consider I/O the privileged domain of assembler and PU1, or perhaps that 1/8 accessing will be superceded entirely by single level storage.

The structuring of files for direct retrieval by keyedvalues is hardly a novelty. There are more intricacies than those involved in sequential I/O to be sure, particularly if alternate keys are permitted. Yet it is not much to ask for the definition of keyin (1 and keyout () built-in functions in Cowlishaw's next I/O model. It would be 8 real win if keys could have variable offset and extent within records, and if non-unique keys were permittedas well.

Cowlishaw's introduction of permanent symbol pools in Version 4.00 is an initial foray into keyed file access. This provides an elegant disguisefor keyed accessing of structured information, without entering the woods of access specifics. However, these permanent symbol pools can not be easily mapped to existing keyed files.

REXX lat-igilage i/O and environment challenges

68 RMational databases

SBL access ofrelational data is also well established. The conjunction ofREXX with SQL is a small leap of the imagination. Compiled REXX and static SQL can appeal to those with high volume OLTP problems to solve. For those with more ad hoc difficulties, the amplification of SQL semantics with REXX symbolic transformation capabilities is clearly a breakthrough. Query clauses could be dynamically composed. Parameterized database procedures could be considered external REXX procedures. Perhaps REXX procedures and built-in functions could even be usedwithin selection clauses as well. Consider,

createview eurusers as select firstname, lastname, phoneno, country( phoneno ) from users where assess( phoneno = "European" .. This uses hypothetical REXX procedures called countryand assess in situ. The country procedure transforms a phone number to a returned country name. The assess procedure analyzes values in the phoneno column to determine if these are European. It may take awhile for the Ansi and IS0 SQL committees to sanction this level of capability. I1 screen interactions

The majority of present application interfaces are full-screen, fill-in-the-blank menus in conjunction with function key actions. Current generation terminals are optimized for "field" modifications, which interact with host systems using block-at-a-time transfers, instead of byte streams. REXX, as defined by SAA and p-...-.v.rl,sha;iJ, :* is unsuitable for preparing competitive full-screen interactions. TheSAY and PULL statements permit conversational, line-at-a-time user interactions only. The Cowlishaw I/O functions permit relative screen operations, but these are conversational requests. Neither REXX definition provides fordisplay field accesses andblock mode transfers.

Within SAA, full-screen interactions are the domain of the dialog manager, based on IBM's proprietary ISPF/PDF product offerings. Application portability was probably of lesser concern when this decision was reached.

The REXX language can be easily enhanced to enable the development of full screen applications using REXX procedures exclusively. Readers interested in studying this concept further can obtain separate literature from the author.

Of course, individuals in the northwestern US contend that full-screen interactions are a historical artifact, for the [GUI] age has arrived. SAA has an independent presentation manager ...... component which addresses this issue. It is the author's conjecture that window-oriented applications could be developed in REXX exclusively, with the full range of capabilities, such as: windows, popups, pulldowns, scroll bars. ixels

The manipulation of graphical objects raises special challenges for REXX. A state-of-the-art graphical display can have 1024 x 1024 pixels, with each pixel having 232 possible colorations. This is a large hexadecimal literal string [4M bytes]. The alteration of bits can not be effectively accomplished with bi tand, bi tor, and bi txor . The modifying bit vector also has 4M bytes, and the bit-wise operation produces a 4M byte result. Instead, an array language object should be introduced. It should also be

REXX language I/O and environment challenges 69 possible to indirectly establish the array's origin * , so that pixel vaiues can be revised as direct memory accesses [DMA]. The need for array accesses are requiredby other problemdomains as well. Asynchronous I/O

High performance applications require I/O operations to be overlapped with procedure execution. Cowlishaw's i/O functions are synchronous by design2. In Version 4.00 the open-ended stream() built-in function was introduced. This rnightaccomodate asynchronous I/O. For example,

signal on notready

call lineout journal,"remember this, please" :* <-- an asynchronous write request */

do whatever end

if strean( journal, c, complete ) <> "READY /* <-- assert write has completed */ then say 'Whoa, journal record was not written" exit

notready: say Whoa, an I/O error occurred, description:"description( 'D )

A language implemente; could enable the above lineout operation to proceed asynchronously, and assert that the operation completed successfully in the stream function call. If an error occurred during the i/O operation the notready condition can be signalled.

However, this is a significant departure from Cowlishaw's definitions. Procedures based on this capability would be highly unportable. For the "stread journal, c, complete 1" expression is an implementation- dependent extension, eventhough permitted by Cowlishaw's Version 4.00 specification. ENVIRONMENT CHALLENGES

The REXX language is specified with no environmental dependencies. Automagically procedure source statements are located, run-time arguments become accessible, and execution proceeds on machines with unexhaustible memory resources. Language implementers portably translate commands and I/O requests to native system services. REMprocedures can bedeveloped in one system, and executed on another without source changes, or re-compilation. REM procedure developers can be blithely unaware of underlying system ideosyncracies. Operating system proliferation

Every year computer corporations announce new hardware families, new operating systems, and major advancements of existing operating environments. Presently versions of REXX are available, or announced, for VM, MVS, OS/400, MS-DOS@, OS2, mix@),Tandem, and the Amiga. Pick any two, they are as similaras condors and kangaroos.

IThis should be done symbolically, withoutintroducing address manipulation capabilities.. *Some implementations may be able to implicitly perform these synchronous requests asynchronously. For example, sequentialfile I/O in MVS is buffered externally by systemI/O services.

REXX language I/O and environment challenges

70 Naming conventions

The easiest way for system architects to establish a new nicheis toinvent a new naming convention. The following area few illustrativeexamples:

filename filetype fiiemode highqual.midqualf.midqual2.lowqcral.ext C:\root\dirl\dirZ!\filename.ext $A$DUA1::~usrgroup.usrdept,userlfilename.ext;3 \node.$disk.subvol.fiiename

These names are used to locate external REYX procedures, and to identify paths for I/O operations. Not ... .. only must RE>O( users overcome the shock of learning a new convention when they begin to use a new ...... -. environment, but they must also locate documents describing how partially qualified filenames are ..,, . resolved. Often within several daysthey quickly retreat to their prior environment. Environment symbol access

Most system environments have a proprietary technique of externally parameterizing run-time logical symbols. There arethree ways that these affect REXX procedures. First,if these symbols are to influence procedure behavior, there must bea way to acquire the external symbol’s value [getenv]. Second, REXX procedures are often expected to alter the value of these symbols for reference by subsequent system commands Iputenv]. Third, REXX procedures can also be expected to permanently revise or deactivate these symbols for upper level contexts [export, unexportl. None of these operations are identifiedin existing language specifications. Other language interfacing

Present language specifications enable REXX procedures to interact with programs written in other languages as follows:

1. Commands defined to the underlying system command interpreter 2. External procedure calls 3. Environments accessible with the ADDRESS statement 4. Symbol values and queued lines(SAA variable pool interface fvPlI) 5. External symbol pools (Cowlishaw Version4.00p 6. Inter-process communicationsperformed via Cowlishaw I/O capabilities [lineout/linein] 7. Function packages (MVS)

Other capabilities should be defined.Programs initiated from REXX should be able to invoke internal and external REXX procedures, as well as built-in functions, as though these were subroutines within the external module. Formalinter-process communication IIPCI and remote procedure call [RPCI mechafiisms should be specified.

Furthermore, the variable pool interface and function package definitions need to be improved so that these mechanismscan be used with languages otherthan Assembler. BreakJinterrupt handing [HALT]

A HALT signal causes an abnormal changein the flow of control, at best. The implementation of HALT handling is exposed to host mechanisms. WhenREXX relinquishes control to a system command, it may be necessary to disable the REXX break handler until the command completes. There are smali time

~~ %ariables in external pools can be shared with parallel external procedures.

REXX language l/O and environment challenges 71 windows before and after the command executes where the us8rcan hit the BREAK key, and no handler is active. This causes abrupt termination of the REXX environment, without the procedure’s HALT handler receiving control; and REXX cleanup routines may be side-stepped. If the REXX abnormal termination cleanup routine is performed, a new condition should be introduced called EXIT. Unlike the HALT condition handler, which can resume procedure execution, the EXIT handler should perform cleanup operations only. It should not be possible to reactivate the EXIT condition after it has been raised. The EXIT handler could also be used for normal procedure exits. ory exhaustion

REXX procedures can sometimes exhaustavailable memory capacity. It should be possible for execution to proceed after this event occurs. Phis could be piggy-backed onto the HALT signal handler, or a new MEMORY signal could be introduced. The MEMORY condition handler should drop or carefully restore the values of exposed symbols, and invokevarious other cleanup services. Afterwards,the MEMORY condition handier should EXIT the external procedure level which encountered the event. It should not be possible .. to reactivate the MEMORY condition after it has been raised; for the external procedure level which .. encountered the condition.

As was mentioned earlier, the VM environment has a console spooling feature. This feature is generally lacking, and sorely missed, in other environments. Implementers can accomodate this deficiency by providing special journalling of REXX console activity, during procedure execution. However, there are numerous additional upper level environment features which require emulation. These require consistent resolution by an overallREXX system architecture.

REXX language I/O and environment challenges

72 EP4TFPBI LEVEL SYSTEM ARCHITECTURE lBM’s SAA architecture was a historic milestone in the history of computing. It provides multiple interrelated specifications for all components of customer application systems. REXX was granted preferred status as the procedures language within this architecture. This has turned out to be a dadble-edged sword for the REXX language overall. Within environments which havethe fullcomplement of SAA components, REXX benefits from its interplay with these other components. However, in environments lacking these componentsREXX language capabilities are noticeably deficient, as has been described earlierin this paper.

What we as a REXX user community require is a minimal, entry-level REXX systems architecture. This architecture should specify components exteriorto REXX facilities proper, and explicitly identify the inter- component exchange interfaces.The following diagramis a preliminary sketch of the componentswithin this architecture. The formalization of this architecture would enable REXX system implementers to significantly advance the portability of REXX procedures. Procedure developers andusers wouldbe able to use an integrated setof components, rather than spending hours and weeks learning how to use proprietary environment components.

Support Tools Command Utilities Interpreter Interactive Help

REXX

. .. I I 1 . .. Funct 1 iona 1 Packages

Procedure Commands Ca 1 1s [async h]

REXX language I/O and environment challenges 73 TRY LEVEL SYSTEM ARCHITECTURE

LBM’s SA4 architecture was a historic milestone in the history of computing. It provides multiple interrelated specifications for all components of customer application systems. REXX was granted preferred status as the procedures language within this architecture. This has turned out to be a double-edged sword for the REXX language overall. Within environmentswhich have the full complement of SAA components, REXX benefits from its interplay with these other components. However, in environments lacking these components REXX language capabilities are noticeably deficient, as has been described earlier inthis paper.

What we as a REXX user community require is a minimal, entry-level REXX systems architecture. This architecture should specify components exterior to REXX facilities proper, and explicitly identify the inter- component exchange interfaces. The following diagram is apreliminary sketch of the components within this architecture. The formalization of this architecture would enable REXX system implementers to significantly advance the portability of REXX procedures. Procedure developers and users would be able to use an integrated set of components, rather than spending hours and weeks learning how to use proprietary environment components.

r 1 t I Support Tools Command Utilities Interpreter Interactive Help L J L I

k-I

REXX I Stream I/O I

I I I Functional-l -1 -1 Packages 1

Remote Spawned Procedure Commands Ca 11s Casynchl

REXX language I/O and environment challenges 73 CONCLUSION

The advancement of the REXX language faces numerous I/O and environment challenges. It will be best for the REXX community at large if a single standard comes forth with robust specifications for the range of issues addressedwithin this paper. If this standard does not materialize, then language implementers are forced to develop independent solutions. This causes REXX users to lose countless hours revising procedures as they port them from one environment to another. Let us be optimistic and hope that a single, robust language standard emerges.

BIBLIOGRAPHY

[l] Announcement of SANPL, Announcement Letter 287-088, IBM Corporation.

[2] Cowlishaw, M.F., "The design of the REXX Language", IBM Svstems Journal, 23, N0.4, p.326. IBM Corporation (1984).

[31 Cowlishaw, Michael F., The REXX Lanauaae: A Practical Amroach toProaramminq, Prentice-Hall, Englewood Cliffs, NJ (1985).

[41 Cowlishaw, Michael F., The REXX Lanauaae: A Practical Approach to Proarammina. SECOND EDITION, Prentice-Hall, Englewood Cliffs, NJ (1990).

[51 Hoernes, G.E., "REXX on TSO/E", IBM Svstems Journal, 28, No.2, p.274, IBM Corporation (1989).

[61 SvstemsAr>plication Architecture: Common Proarammins InterfaceProcedures Lanauaae Reference, IBM Corporation, Publication SC26-4358.

171 TSO Extensions Version 2, REXX Reference, IBM Corporation, Publication SC28-1883.

[81 VM/SP System Product Intermeter Reference, IBM Corporation, Publication SC24-5329.

REXX language I/O and environment challenges

74 Presenter, not Originator

Dr. Brian Marks

Chairman, SAA Procedures Language ARB IBM UK Laboratories Ltd Systems Technology Sheridan House Winchester

11th June 1990

75 Object-Ori nted REXX

Simon C. Nash

IBM UK Laboratories Ltd Systems Technology Sheridan House Winchester

8th March I990

76 This section consists of foils originally presentedSHARE at 74 in Anaheim. They describe an experimental language integrating object oriented principles with REXX. There is currently no plan for an IBM product in this area. Permission is hereby granted to SLAC to reproduce these foils in the Rexx Symposium Proceedings.

77 Background

* Research project

Systems Technology (Hursley Laboratory)

Language description

* Running prototype

SCN

78 Motivation

Bring the power of OOP to REXX

Bring the usability of REXX to OOP

Extend REXX usage

- windowing,multi-media, etc.

Build on existing REXX base

- fully upward compatible REXX Summary

* Designed for usability

st Natural typing (everything a string)

-cr Comprehensive string handling and numerics

* Procedural logic: IF, DO, SELECT, variables, assignment

~r Program structure: functions, subroutines

* External interfaces: functions, subroutines, commands

* Dynamic semantics (e.g., scope, type)

_____ ~ ___- __ - -

SCN 8 Mar 90 80 OOP Summary

-k de and data as unit

* ta encapsulation, message passing

-34 lymorphism

sses, inheritance

-A- C0d.e reuse

na bles concurrency OOP Languages

Simula

rt Smalltalk

* c++

Objective C

~r Object Pascal

Eiffel

* CLOS

* etc.

_____

SCN 8 Mar 90 82 Design Goals

* REXX compatibility

Everything an object

* Integrateconcurrency

* Maintainusability Primitive (e.g., string, number) or programmed

A Contain encapsulated data

+- Respond to messages by executing methods

Automatically reclaimed

SCN 8 Mar 90 84 Messages

All REXX operators

A New syntax: receiver-message(arguments)

Receiver defaults to environment if omitted

* Can appear as term or clause

* Sender waits for reply

SCN 8 Mar 90 85 Methods

A Define an object’s behaviour

-k Contain the code of an object

~t Established at creation or defined dyna mica Ily

* Activated when a message received

* May produce a result object

______-

SCN 8 Mar 90

86 I Variables

* Object variables persist for object’s lifetime

* Method variables exist during a method activation

Object variables exposed on METHOD instruction

Example: method expose a b. c

SCN 8 Mar 90 87 ing Exam

new -rect = myrectangl e-rotate(ang1 e) /* send "rotate" message (with "angle"argument) to 'lmyrectangIe" */

J/* "new- rect" is assigned the result object */ myfi 1 e-open ( I read ' ) /* 9'resu1t1tis assignedthe result object or dropped if no result */ myfi 1 e-cl ose /* this messagehas no arguments */ left- side = myrectangle-origin-x /* send a series of messages */ rect-do-setleft(0)-setright(90)-setbottom(Z5)-settop(75) /* send a series of messages to "rect" */

SCN 8 Mar 90 88 A REXX Example

jack = 3 /* create a number objectwith the value 3 */ /* ''jack" is assignedthis 113" object */ jill = jack + 4 /* create a number object with thevalue 4 */ /* send It+'' message (with "4" argument) to lljack" */ /* the "3" objectreturns the sum "7" */ /'* I1 j i 1 1 I1 isassigned the 117" object */ say jill

/* send "1 ineout" message (with "ji11 If argument) argument to default output streamobject */ /* "string" message is sent to Iljil1 If */ /* "7" returns itsstring representation */ /* thecharacter 7 is displayed */

~~ ~

SCN 8 Mar 90 89 Classes

Many objects with the same behaviour (methods)

Define shared behaviour in a class object

The class object creates new instances

SCN 8 Mar 90 90 Inheritance

Bank account

Current SavingsCurrent

Repaymentl-----l Endowment Immediate 90 days access notice

Class hierarchy

Subclass acquires behaviour of superclass and modifies it

* Avoids duplication of code

* Programming by differences .A Subclass sends an “inherit” message to morethan one uperclass

ethod conflicts resolved by search order

-~h Methods of the subclass can address any method of any immediate superclass

A No conflict of same-named object variables because of scope rules

SCN 8 Mar 90 92 Object-Based Concurrency

+ Objects are the units of concurrency

* All objects can execute concurrently

* Most objects awaiting message or reply

REPLY instruction

* START message

93 Concurrency Usage (1) __._ __ __ - -.

* Sequential:

Sender Receiver

* Early reply (implicit concurrency):

Sender Receiver

(wai ting) (some work)

0 REPLY

(continue) (morework) RETURN

SCN 8 Mar 90 94 Concurrency Usage (2)

* Start (explicit concurrency):

Sender Proxy Receiver

<---- reply -----

SCN 8 Mar 90 95 k Simple: objects execute concurrent each object is sequential

: concurrency within an object, with guarded methods

A Mixture of simple and advanced objects

Simple objects are easier to write

Advanced objects enable more function, better efficiency

SCN 8 Mar 90 96 Example w Stack

/* init: initializestack to empty */ method expose s. size size = 0

LO b- -nil /* in case an empty stack popped */ i push: add an item to the top of thestack */ method expose s . si ze parse arg item s1.7e =: -. size + 1 s,size = item

J'" pop: returnthe top stackitem and remove it */ method expose s. size rep'2y s .si ze if size > 0 then do /* ifstack non-empty */ drop s. size size = size - 1 Ci-jd

8 Mar 90 97 Example - Stack Usage

/* Define the stack class. The objects init- code, push- code, pop- code and size- code containthe methods shown on the previousfoil. */ stack = -class-new( 'Stack') stack-define('INIT',init- code) stack-define( 'PUSH' ,push- code) stack-define( 'FOP',pop - code) stack"define( 'SIZE',size- code)

/* Create a stack object and use it. When an object is created, its "init" method (if it has one) i s run automatical 'ly. */ mystack = stack-new mystack-'push( 'John Smith') mystack"push('Bil1 Brown') say mystack-pop /* displays "Bill Brown" */

SCN 8 Mar 90 98 a t

init: method expose balance overdraft - 1 imi t balance = 0 overdraft- 1 imi t = 0 overdraft: method expose overdraft - limit parse arg overdraft -limit debit: method expose balance overdraft -1 imit parse arg payee, amount if balance-amount >= -overdraft -limit then do payee-credi t (amount) balance = bal ance-amount end else payee-inform('1nsufficient funds') returnbalance credit: method exposebalance parse arg amount balance = bal ance+amount return bal ance

SCN 8 Mar 90 99 /* Define the account class, */

account = -cl ass-new( 'Bank account I ) account-define('init',init -code) account-def ine ( ' overdraft ' ,overdraft- code) account-define( 'debit' ,deb;t - code) account-define('credit',credit -code)

/* Create some account objects and use them. */ a = account-new /* createnew account */I b = account-new /* createaccountnew *I c = account-new /* createnewaccount */ a-credit(1000.00) /* a has 1000.00 *I a-debit(by400.00) /* a has 600.00, b has 400.00 */ b-overdraft(500.00) /* b can overdraw up to 500.00 */ b-debit(~~700.00) /* b has -300.00, c has 700.00 */

SCN 8 Mar 90 100 IBM SAA REXX FOR OS/2

Rick McGuire

101 NOTES:

THE REXX PROCEDURESLANGUAGE NOTES: WORKSHOPAGENDA

e INVOKINGREXX CREATINGSUBCOMMAND HANDLERS USINGREXX EXITS CREATINGREXX FUNCTIONS CREATINGMACROSPACEA MANIPULATING REXXVARIABLES

NOTES:

6 return, 8 relstr) :

program .CMD * arg input

REXXPROGRAM return a

102 \ RXSTRiNGS NOTES:

RXSTRINGSARE USED INREXX APk TOPASS ARBITRARYLENGTH, CONTENT INSENSITIVE CHARACTER STRINGS I I typedelstruct { ULONG slrlength: I * iength Of string * / I PCH strptr; / e far pointer !Q strlno / } RXSTRING: I I

RXSTRING MACROS SOMEHANDY MACROS FOR WORKING WITH RXSTRlNGs RXNULLSTRING Tesl II an RXSTRIWG e11slc -7 RXZEROLENSTRING Tell I1 an RXSTRING IC 01 zcto lcnglh

RXVALlDSTRlNC Test II an RXSTRING hac I nan- zero lenplh

RXSTRLEN Refurn or set the lenglh 01 an AXSTRING

RXSTRPTR Retufn or set Iht polntrr of an RXSTRING

MIKERXSTRING Set (he Dointer ane lenulh 01 an RXSTRING

USING IN- STORAGE PROGRAMS NOTES: REXXPROGRAMS MAY ALSO BE EXECUTEDDIRECTLY FROM STORAGE I rc = REXXSAA( argc,argv. c PROGRAM " MACRO. CMO" , Instore. NULL. I .!

103 7-.! THE REXX PROCEDURESLANGUAGE NOTES: WORKSHOP AGENDA

INVOKINGREXX c CREATINGSUBCOMMAND HANDLERS USINGREXX EXlTS CREATINGREXX FUNCTIONS CREATING A MAGROSPACE MANIPULATINGREXX VARIABLES I I

CREATINGSUBCOMMAND HANDLERS NOTES: rc = REXXSAA ( argc.argv, 1 APPLICATION " SPLIT. ED" , NULL, NULL, RXCOltiMAND, NULL, & return, & retstr) ; ',I

' LOCATt \sltinq\'

REXX hlACAO return a

Operatng Sysfernb' --______

CREATING A SUBCOMMANDHANDLER NOTES: - SUBCOMMANOHANDLERS ARE DECLARED WITH THERxSUECOMREGlSTER FUNCTION v handler.scbname = I' MyEdilor" ; handler. scbdll-name = ') ; handler.scbdll-proc = '' '' . handler.scbaddr = ( PFN) 'MyEditorhandler;

rc = RxSubcomRegister( & handler) ;

L

., . . . .. CREATING SUBCOMMANDHANDLERS

THECALL TO REXXSAASPECIFIES THE NAME OF THEENVIRONMENT TO BE USE0 FOR COMMANDS

SPLIT. ED' , NULL, " MyEditor' , RXCOMMAND, NULL, 6 relurn, 6 retstr) ;

CREATINGSUBCOMMAND HANDLERS NOTES: COMMANDS ISSUE0 FROM THEREXX MACRO ARE PASSEDAS RXSTRlNGs TOTHE SUBCOMMAND HANDLER

' LOCATE \string\'

I return a

CREATINGSUBCOMMAND HANDLERS NOTES: THE SUBCOMMAND HANDLERPROCESSES THE SUBCOMMAND

SHORTAPIENTRY MyEditorhandler ( PRXSTRING cmd, PUSHORT errorflag. PRXSTRING ReturnCode) ; t / handleeditor rubcommands /

II ( command= = LOCATE) {

.__ - Operattng Systernn-

10.5 r 1 CREATINGSUBCOMMAND HANDLERS NOTES: THENPASSES BACKRETURNA COOE AND ERROR INDICATOR

/ Set the return code and error flag / rnemcpy ( RXSTRPTR ( ReturnCode) , " 1" , s!rlen ( " 1" ) ) ; RXSTRLEN ( ReturnCode) = strlen ( " 1' ) ; errorflag = RXSUBCOM-ERROR; return 0;

NOTES:

THEREXX PROCEDURES LANGUAGE NOTES: WORKSHOPAGENDA

INVOKINGREXX CREATINGSUBCOMMAND HANDLERS USING REXXEXITS CREATINGREXX FUNCTIONS CREATINGMACROSPACEA MANIPULATINGREXX VARIABLES

106 USING REXXEXITS NOTES: REXX PROVIDES A NUMBER OF EXITS TO ALLOW AN APPLICATION TOSERVE AS A * HOST’ i RXFHC Process external functions

~ ~~ RXTCTRC Test external trace RXiHl InlaiiraUon pmcesrlnp RXTER I Terminalion processinn 1

r 1 USING REXXEXITS NOTES: -- EXIT HANDLERS ARE SPECIFIED WHEN REXXSAA IS INVOKED

exits[Oj. sysexil-name = SIOHANDLER’ ; exiIa[O]. rysexit-code = RXSIO; f exils[l]. mysexit-code = RXENDLST; L re = REXXSAA [ argc, argv, * MACRO. CMD” , NULL, NULL, RXCOMMAND, exits. 6 return, & retstr) ; I

USING REXXEXITS NOTES: .. EXiT HANDLERS MUST ALSOBE REGISTERED BEFORE USE

handier. tcbname = ’ SIOHANDLER’ ; handler.rcbdll-name = ; handier. rcbdll-proc = - handler. rcbaddr = ( PFN)’SIDHandler;

rc = RxExltReplsIer ( 6 handler) ; USINGREXX EXITS NOTES: ._____ AN EXIT IS INVOKEDWHENEVER THE PROGRAM REOUIRES THATSPECIFIC SERVICE ___~

EXIT HANDLER

nhln 0;

NOperatmg SystemQ' ..

THEREXX PROCEDURES LANGUAGE NOTES: WORKSHOP AGENDA

INVOKINGREXX CREATINGSUBCOMMAND HANDLERS USINGREXX EXITS 1CREATING REXX FUNCTIONS CREATINGMACROSPACEA MANIPULATINGREXX VARIABLES

r CREATINGREXX FUNCTIONS NOTES: REXXEXTERNAL FUNCTIONS MUST BE REGISTERED BEFOREUSE

From C ( ' CHANGE , * CHNGOLL" ,

IC = RxFuncAdd ( * CHANGE", , From REXX " CHNGOLL" , " CHANGE' ) ;

108 CREATINGREXX FUNCTIONS NOTES: WHENFUNCTIONA IS INVOKED,THE ARGUMENTS ARE PASSED AS ANARRAY OF RXSTRINGS

I I

Opratrng SystemR-

CREATING REXX FUNCTIONS NOTES: THEFUNCTION RESULT IS RETURNEDAS AN RXSTRING

THEREXX PROCEDURES LANGUAGE NOTES: WORKSHOP AGENDA

INVOKINGREXX CREATINGSUBCOMMAND HANDLERS USING REXXEXITS CREATINGREXX FUNCTIONS CREATINGMACROSPACEA MAN~PULATINGREXX VARIABLES J

109 CREATINGMACRO SPACES NOTES: FREQUENTLYUSE0 REXX FUNCTIONS MAY BE LOADED INTOMACROA SPACE FOR QUICKEREXECUTION

I 1

RxMacroChange ( I' CHANGE" , " CHANGE.MAC" , RXMACRO-SEARCH-BEFORE) ; RxMacroChange ( " SPLIT" , " SPLIT.MAC" , - RXMACRO-SEARCH-BEFORE) ;

RxMacroSave ( 2, FunctionLisl, " EOITMACS. SAV ) ;

CREATINGMACRO SPACES MACROSPACE PROGRAMS CAN BE INVOKE0 AS SUBROUTINES AND FUNCTIONS

REXXPROGRAM

MACROSPACE

THE REXXPROCEDURES LANGUAGE NOTES: WORKSHOP AGENDA

INVOKINGREXX CREATINGSUBCOMMAND HANDLERS USINGREXX EXITS CREATINGREXX FUNCTIONS CREATINGMACROSPACEA r MANIPULATINGREXX VARIABLES

110

. .. MANIPULATINGREXX VARIABLES NOTES: PROGRAMSINVOKE0 FROM REXXMAY MANIPULATE THEVARIABLES OF THECALLING PROGRAM

C PROGRAM 1

MANIPULATINGREXX VARIABLES NOTES: FUNCTIONSAVAILABLE VIA RXVAR

Felch .privale' variables

Scan Ihe entire variablepool

Operatrng System/Z'

111 REXX FOR UNlX

Neil Milstead

112 UNI -REXX OVERVIEW

AN SAA COMPLIANT IMPLEMENTATION OF THE REXX LANGUAGE FOR ALL UNIX PLATFORMS.

WRITTEN IN C, ONE SOURCE VERSION PRODUCES MANY SEPARATE BINARY EXECUTABLES.

INPUT/OUTPUT CHARACTER STREAMS AND THE EXTERNAL DATA QUEUE ARE IMPLEMENTED ACCORDING TO THE MODEL DEFINED BY COWLISHAW IN "THE REXX LANGUAGE".

ADDITIONALFUNCTIONS IMPLEMENT SOME CRITICAL UNIX C LIBRARY CALLS, TO ALLOW FULLER EXPLOITATION OF THE UNIX ENVIRONMENT-

PROGRAMMINGINTERFACES ALLOW IMBEDDING UNI-REXX INTO C LANGAUGE APPLICATION SYSTEMS AS A MACRO FACILITY-

UNI-REXX HAS ALREADY GENERATED INTEREST IN UNIX NEWS FORUMS.

113 UNI -REXX PLATFORMS

PLATFORM RELEASE NUMBER DOS COMPLETE SUN-3 COMPLETE SUN-4 COMPLETE SUN 3861 COMPLETE SCO XENIX 2.3 COMPLETE SCO UNIX 3.2 COMPLETE ISC 3861x COMPLETE HP/UX(9000) COMPLETE RS/6000 COMPLETE UN I COS COMPLETE ENCORE COMPLETE SILICON GR. COMPLETE NEXT COMPLETE RT COMPLETE APOLLO x500 COMPLETE AIXI370 IN PROGRESS APOLLO 10000 IN PROGRESS ULTRIX(3100 9 IN PROGRESS CONVEX IN PROGRESS INTERGRAF IN PROGRESS STARDENT IN PROGRESS UTS IN PROGRESS

114 UNI-REXX PROGRAM EXECUTION

LACKING THE HOOKS FOR EXECUTION THAT ARE BUILT-IN TO VM/CMSJ UNI-REXX RELIES ON UNIX FACILITIES TO RUN A UNI-REXX PROGRAM. THE INTERPRETER MAY BE RUN EXPLICITLY OR IMPLICITLY DEPENDING ON ENVIRONMENT-

EXPLICIT:

RXX PROGRAM- REX INTERPRET A UNI-REXX PROGRAM. RXC PROGRAM. REX COMPILE A UNI-REXX PROGRAM- RXI PROGRAM RUN A COMPILED UNI-REXX PROGRAM.

IMPLICIT: FOR BSD-BASED UNIX SYSTEMSJ IMPLICIT EXECUTION IS SUPPORTEDJ BY STARTING A UNI-REXX PROGRAM WITH A SPECIAL DIRECTIVE. #!/USR/LOCAL/BIN/RXX THE PROGRAM MUST BE MARKED EXECUTABLE WITH THE CHMOD COMMAND: CHMOD +X PROGRAM. REX

115 UNI-REXX AND UNIX COMMANDS

THERE ARE THREESEPARATE MECHANISMS FOR ISSUING UNIX COMMANDS FROM WITHIN A UNI-REXX PROGRAM-

IMBEDDINGA COMMAND CLAUSE DIRECTLY IN THE UNI-REXX PROGRAM. CLAUSES WHICH ARE NOT UNI-REXX INSTRUCTIONS ARE PASSED TO THE DEFAULT COMMAND ENVIRONMENT. THE OUTPUT FROM THE COMMAND WILL BEDIRECTED TO STDOUT-

SPECIFYING A UNIX COMMAND AS THE OPERAND OF THE A~~~~~~ UNIX INSTRUCTION. COMMAND OUTPUT ALSO GOES TO STBOUT.

USE THE POPENO FUNCTION, WITH A UNIX COMMAND OPERAND. THE COMMAND OUTPUT WHICH WOULD HAVE GONE TO STDOUT IS PLACED ON THEEXTERNAL DATA QUEUE- UNI-REXX ADDITIONAL FUNCTIONS

ADDITIONAL BUILT-IN FUNCTIONS ARE PATTERNED AFTER STANDARD UNIX C LIBRARYFUNCTIONS-

CHDIR~TRING) CHANGE THE CURRENT WORKING DIRECTORY .

CUSERIDO RETURN LOGGED ON USERID.

GETCWD() RETURN CURRENT WORKING DIRECTORY.

GETENV~TRING) RETURN ENVIRONMENT VARIABLE VALUE. (E. G. PATH, TERM)

POPEN (COMMAND) EXECUTE A UNIX COMMAND, PLACE ITS STANDARD OUTPUT IN THEEXTERNAL DATA QUEUE-

CHANGE THE VALUE OF AN ENVIRONMENT VARIABLE-

117 - UNI-REXX INPUT AND OUTPUT

THE UNI-REXX I/O MODEL IS BASED ON "THE REXX LANGUAGE"BY COWLISHAW. THIS MODEL CORRESPONDS CLOSELY TO THE UNIX FILE SYSTEM, UNLIKETHE RECORD ORIENTED I/o OF VM/CMS.

r /o CHARACTER STREAMS CHARACTER I/O FUNCTIONS SUPPORT THE UNIX STDIN, STDOUT OR ARBITRARYUNIX FILES.

CHARIN FUNCTION CHAROUT FUNCTION CHARS FUNCTION

EXTERNAL DATA QUEUE LACKING THE "PROGRAM STACK" OF VM/CMS, THEEXTERNAL DATA QUEUE 1s SIMULATED BY UNI-REXX.

PARSE PULL INSTRUCTION PULL INSTRUCTION PUSH INSTRUCTION QUEUE INSTRUCTION UNI-REXX vs PROGRAM EXAMPLE

COMPARE THE STRUCTURE, SEMANTICS AND READABILITY OF A SHELL-AWK PROGRAM TO THAT OF A UNI-REXX PROGRAM

A. Here's a shell wrapper-awk pmgm the1 marsend dlspleys enfries trWn the Us1 ol names and telephone numbers:

1 2 O(#) pdir. sh A simple phone directory searcher 3 # Author: Wdt Novinger, January 1989 4 # set -x # Unooment for deb-ng 5 USAGE="Usage: $0 pattern" 6 PHOK6ZIST=SHOKE/.phonedir # Phone list database 7 # 8 case $# in , 9 0) echo $USAGE >&2 # if no arguments, display usege 10 exit I ;; #exit and 11 *) ;; - 12 eaac 13 # 14 ENTRY='grep n$*n SPROKELIST' ' # search for pattern(6) 15 if [ -z "$ENTRYm 1; then 16 echo "Sorry, don't know S*'s number(s)" 17 exit 2

18~~ I1 19 20 echo "$ENTRYn I # send content of ENTRY to ark 21 awk -P" " ' I # tab character in double quote8 22 if (length($2) != 0) I # if there Is a home number 23 if (length(S3) != 0) # and a work number 24 printf n%-20a %(B) %e(W)\nm, S1, SI 53 25 else # no work number 26 . printf m%-20p %s(A)\n", $1, $2 27 I 28 else . # no home number , 29 printf m%-20s %s(W)\nm, $1, $3 30 I

UNIXWORLD JUNE ID00

/* * A simple phone directory searcher * Author: Ed Spire, June 1990 * */ parse arg pattraceopt If traceopt c-*It1 then trace value traceopt/* turn on traceif req. */ phonelist = "phonedir1I if pat = 11 $1 then say "usage: p pattern traceopt" /* if no arguement, exit */ el se do else /* if proceedarguement, */ callpopen llgrepll patphonelist /* que matching lines */ if queued()=O then say ##sorry,no match on" pat /* no matching lines, exit */ elsewhiledo queued()>O /* processeach match */ parse pull name ll09llx work t80911xhfme If home <> )*Isthen home = home*t( H ) /* add phone */ if work <> MII then work = workI1(W) /* number identifiers */ sayleft(name,20)1 /work1]home /* and displayline */ end end

119 UNI-REXX PROGRAMMING INTERFACES

THE PROGRAMMING INTERFACES ARE DESIGNED TO ALLOW IMBEDDING UNI-REXX INTO A C LANGUAGE APPLICATION SYSTEM AS A MACRO PROCESSOR.

IRXJCL RUN A UNI-REXX PROGRAM FROM A C PROGRAM.

IRXSUBCM ESTABLISH A NEW HOST COMMAND ENVIRONMENT TO ACCEPT COMMANDS FROM A UNI-REXX PROGRAM-

IRXSTK ACCESSTHE EXTERNAL DATA QUEUE FROM A C PROGRAM.

IRXEXCOM ACCESS UNI-REXX VARIABLES FROM A C PROGRAM.

THESE INTERFACES ARE MODELLED AFTER THOSE IN MVS-TSO/E REXX.

120 UNI -REXX TREE PROGRAMEXAMPLE

THIS PROGRAM DISPLAYS A UNIX DIRECTORY TREE STRUCTURE.

/* TREE displays the directory structure that exists belowthe * current directory. * * Get the directory argument */ parse arg Directory. if Directory= 'In then Directory= "." /* * Display the directory tree for the directory passedon the command line */ call RecursiveDirectoryDisplay Directory, 0 exit /* * Routine to display the subdirectories for the directory specified */ RecursiveDirectoryDisp1ay:procedure /* * Get the directory to scan and the amountto indent arguments */ parse arg Directory, Indent /* * List the directoryon the external data queue. */ call popen '1s-1' Directory /* * If there are any entries, skipthe first non-file entry */ if queued() = 0 then return pull * /* * Scan the external data queuefor directory entries. They begir. with Id'. If a directory is found, save in the directory table. */ DirectoryCount = 0 do while queued() <> 0 parse pull Permissions +1 ...... Filename . if Permissions = Id' then do DirectoryCount = DirectoryCount + 1 DirectoryTable.DirectoryCount = Filename end end /* * Display each directory indented to this level awith preceeding 'I+---->'I. * Then list the directory's contents by calling RecursiveDirectoryDisplay. */ do DirectoryIndex = 1 to DirectoryCount say copies(' I, Indent)'+---->'DirectoryTable.DirectoryIndex call RecursiveDirectoryDisplay Directory'/'DirectoryTable.DirectoryIndex, Inde nt + 6 end DirectoryIndex return

121 UNI-REXX TREE PROGRAM EXAMPLE OUTPUT

TREE PRODUCED THISOUTPUT FROM A LIVESYSTEM:

+---- >customer.mail +--...- >dis +---- >apollo +---- >uniREM +---->uniXEDIT +---->msdos +---- >uniREXX +--..- >uniXEDIT +---- >rs6000 +---- >uniREXX +---- >uniXEDIT +---->rt +---- >uniREXX +---- >uniXEDIT +---- >sco +---->uniREXX +---- >uniXEDIT +---->sun3 +---- >uniREXX +---- >uniXEDIT +-e-- >sun386 +---- >uniREXX +---- >uniXEDIT +---... > sun4 +---->uniREXX +---- >uniXEDIT +---- >samestuff UNI-REXX POSSIBLE EXTENSIONS

A NUMBER OF ENHANCEMENTS AND EXTENSIONS ARE PLANNED OR PROPOSED FOR UNI -REXX.

NUMERIC DIGITS 99

REXX VERSION 4 FEATURES: STREAM, NOTREADYJ CALL ONJ BINARY CONSTANTS. REXX SHELL

PROGRAMMING INTERFACES: FUNCTION PACKAGES VARIABLE POOL INTERFACE EXTERNAL FUNCTIONS

OPTION MIXEDCASE OPTION DBCS OPTION ANSI

,... . i ’!, (a retros >i

Robert P. Q’Hxx Lotus Development corpora tic^^ 55 Cambridge Parkwc?..( Cambridge MA 021 42

61 7-693-527-5 [email protected]

REXX Symposium

124 FC begins work on REXX VMlSP 3 released Modern Programming Using REXX published The REXX Language published 5 Personal REXX for MS-DOS from Mansfield Software released 87 REXX designated IBM SAA Procedures Language 89 REXX removed from OS/2 Standard Edition IBM OS2 1.2 Extended Edition released

June 9,1990 REXX Symposium Robert P. O’Hara

125 1991 BASIC desianatedU Microsoft universal macro language 1992 Bill Gates repllaces Dan Quay'le on Republican ticket 1994 BASIC designated IBM SAA supported language 1995 Instruction in BASIC required in all US schools

June 7,1990 REXX Symposium Robert P. O'Hara

126 Stage set for explosive

BUT.. .

June 7,1990 Robert P. O’Hara IBM doesn’t understand programming languages Gave up after PUI? Pigeonhole mentality (applications/systems/procedures) No HLL access to OS services REXX not an application language

Benign neglect would have been OK

BUT...

June 7,1990 REXX Symposium Robert P. O’Hara

126 Microsoft understands programming languages

* Pushed BASIC with religious fervor e Saw REXX as a direct competitor Realized there is war among languages

e Developed a strategic plan to win the war e Lobbied application vendors to use BASIC

AND.. .

June 7,1990 REXX Symposium Robert P. O’Hara

129 IBM acquiesced REXX pulled from OS/2 SE REXX thoroughly hidden in OS/2 EE No REXX interfaces to most OS/2 services (DDE, HLLAPI, APC.. .) Bid not lobby application developers to use REXX Did not port REXX to non-SAA platforms (DOS, Windows, AIX)

The problem was not lack of technology

The problem was lack of vision

June 7,1990 REXX Symposium Robert P. O'Hara

130 Realize you are not alon Realize you can’t ignore the problem

Lobby ~QWfor what you’ll need in the future Expand established IBM forums (SHARE, GUIDE)

June 7,1990 REXX Symposium Robert P. O’Hara

131 SLAC USE OF REXX ON VM AND VMS

TonyJohnson

132 SLAC's use of REXX on VM

and VMS. Tony Johnson 1lth June 1990 o What is SLAC? Why is REXX useful to SLAC. Interactive Data Analysis with REXX 0 REXX for VAX/VMS

3 Some other REXX applications.

133 Mission: SLAC is dedicated to experimental and theoretical research in elemen- tary particle physics and to the development of new techniques in particle acceleration and detection. Site sod Lacstion: Located on 426 ILcrw of Stanford University property, the iabora- tory is three miles west of the main University campus. The main entrance is on Sand Hill W,just east of Interstate 280. The Accelerator: Length - Two miles Beam Energy (electrons) - 5Q GeV Beam Energy (positrons) - 50 GeV Major Facilities: Three magnetic spectrometers SPEAR, an &GeV calliding-beam storage ring, 80 meters in diameter PEP, a 32-GeV colliding-beam storage ring, 800 meters in diameter SLC, the 100-GeV electron-positron linear coKder Milestans: 1962 Contract execution adstart of accelerator construction 1966 Construction completed and research begins 1968 First evidence discovered for quarks 1972 SPEAR operations begin 1974 Discovery of psi particles 1976 Discovery of charm quark and tau lepton 1976 Nobel Prize shared by SLAC's Burton Rjchter for SPEAR research I980 PEP operations begin 1983 Construction of SLC begins 1987 Construction completed and SLC commissioning begins 1989 SLC operations begin Management: Director - Burton Richter Deputy Director - Sidney Drell Associate Director - John Rees Associate Director, Technid Division - Kaye Lathrop Associate Director, Research Division - Charles Prescott Associate Director, Business &wices Division - Eugene Rickansrud St&: 1350 Operatin8 Budget: $113,000,000 (FY1990) munications: Mailing address: P.0. Box 4349, Stanford, CA 94309 Shipping address: 2575 Sand Hill bad, Menlo Park, CA 94025 Telephone: 415/926-3300 - FTS 462-3300 Telefacsixnile: 4151323-3626,verification OR 415/926-3344

SLAC is a National Facility Operated by Stanford University for the US Department of Energy

I .. ...

SEI

.i

I

i3b75 X- VM imdementation of IDA

User .-

REXX -+CMS/CP

Command Interpreter

Control Program

Histogram Detector Package Display Data Physics Package Manager Analysis (JAZELLE) Programming Graphics Language System (IDAL)

136 I 'soJ3euI How is REXX interfaced?

SUBGOM(environment,routine.rc)-

en-vironmente

VMREXX(optio~,~ymbol,val~e) Allows called program to examine and mo REXX variables.

KAG~M(file§pe~~~nvi~~me~t,rc~.

Start interpretati of specifiedA file with default environment.

138 6E I

I /* An IDA exec to make generating tables easy. Just type MAKETAB ... Example :

MAKETAB MCHITS TRACKTYP POINTS.VOLNAME POINTS.DOMNAME or MAKETAB MCHITS TRACKTYP POINTSIVOLNAME DOMNAME} ---.. To get the full power of JAZELLEs tabulate facility you must use the IDA commands TABLE and TABULATE. Author:Tony Johnson Section: Ida 12/12/88

Version 2.00 TonyAdded {} syntax */ Arg BankColumns Create='/C=ATE' Prefix=' ' Do whileColumns/=" Parse VarColumns Column Columns

Open = Index (Column, ' { ' ) Close - Index (Column, ' 1' ) If Open>O Then Do Parse Var Column Pre' { 'Column Prefix = Prefix' { 'Pre End

If Close>OThen Parse VarColumn Column'I'Pre ' TRBLE' Create Bank Bank I I Translate(Prefix, ' .' ,' {' ) ' 'Column If Rc/=OThen Exit Rc

If Close>OThen Do I=Length(Prefix)to 1 by -1 If Substr (Prefix, I, 1)/=' {' Then Iterate PrefixPSubstr (Prefix, 1'1-1) Leave End Create=' ' End

'TABULATE' Bank 'DEFAULT' Bank If Rc/=OThen Exit Rc ' TABULATE' Bank'USING' Bank Exit Rc

140

Can REXX beinterfaced to VMS morecompletely?

.-

0 Need to be ableto Address VMS

Need to be able to tell if VMS command was successfully executed. a VMS commandsneed to be able to writeoutput to stack. o Rexx needs to get information about VMS environment.

I

142 !

I XX3 I Completion codes from Address VMS

After anycommand is addressed to VMS-_three variableswill be assigned return codes:

RC = -3 (DCL-W-IVVERB) = 0 (Success) = 16 (Failure)

$STATUS = complete VMS completioncode $SEVERITY = VMS Severity code 0 = error 1 = success 2 = warning 3 = information 4 = fatal

Also when terminating REXX exec,

EXIT

144

P

m .. 3 e L n

!

146 ..

I xw;L<-+ I II €Id=<-+ I II ??Id3W<-+ I 3AIH3W<-+ I II aowm<-+ I ?IW<-+ I LISP&<-+ i II NOI&'tl&NM30a<-+ I II =3113zvr<-+ I P?3<-+ 1 II QaI<-+ I (INIJXZ<-+ I II S&W<-+ I II 3KJdLSyJ<-+ 1 sMm-mnac-+ I vaI<-+ I II M33U<-+ I X3Q~X3VI8<-+ I €;L3Naa<-+ I NIXIdW<-+ -- I wxazzvr z II~SY<-+ t 3AIH3MI<-+ I [XNOLI : o.crsn$xsra /* Rexx */ Curlevel=l Offsets" 1 n Call Makedir Do Forever If Q.curlevel>O Then Do Q.curlevel=Q.Curlevel-1 Pull . ' 3 ' Actdir' .DIR' Say Offset Say Offset'->'Actdir 'SET DEFAULT [ . 'Actdir' 1 ' Curlevel = Curlevel + 1 Off set=Of f set"I " Call Makedir End Else If Curlevel>l Then Do ' SET DEFAULT[ -1 ' Curlevel=Curlevel-1 Offset = Substr(Offset,l,Length(offset)-4) End Else Exit End Makedir: procedure Expose9. Curlevel OldQ-Queued () 'DEFINE SYSSOUTPUT NL:' 'DEFINE SYSSERROR NL:' 'DIR/OUT-LIFO/NOHEAD/NOTRAIL *.DIR' 'DEASSXGN SYSSOUTPUT' 'DEASSIGN SYSSERROR' Q. Curlevel=Queued() -0ldQ Return

i

148 6F1

.. This is the main HELP file for IDA. HELP may be obtained on any IDA command listed below. Some of the commands listed however are only actually available if the relevant module has been loaded withIDA. For example the DSP commands listed below are only available if the DISPLAY package has been loaded. For an introduction to IDA and a general discussion of KEfrissues select INTRODUCTION from the itemsbelow.

AdditionalInformation Available: $RETURN $SIGNAL --function @-command bit functions ADD ALPHA ATTACH Bank functions BANKLOOP BETX CALL CLEAR CLOSE CMDPEOC CMS CONTINUE DEBUG DEF DEL D IR DO/ENDdo DOPT ELSE DSP ELSEIF END IF ENDWHILE EXITif EXTERNAL FIT GET GO Belp HCAT HCLR HCOMB HDEL HDIV HGE T BXNXT HIST HMULT HOP TN HOUT HREAD HSET HSLICE H SPACE HSTAT HSUB HWRITE Introduction IDALREXX IF IMMEDIATE INDEX INPROC INTERPret JLIST JMOD RON LABEL MAKETAB MESSAGE NAN0 NEXTif OPEN OPENTAPE Plot definition PAUSE PEEK PLOT POINTER POKE PROC- PROC PROCESSOR PROJECT READ REBIN RECTYPE REMOVE RETURN REWIND mxx RUN SCATSIGNALSETPTR SET SEGLIST SPAWN STATUS SYNONYM TABLE TABLELOOP TABULATE TD TIMELIM TOPDRAW TYPE UNFIT VAR WHILE WIPE WRITE PFlrSelect ItemPF3-Previous Menu PF4=QuitPF7=Backward PF8=Forward

PSU5t> Macro-read 2 Files

I

150 This HELP describes the SLD shellprogram, IDA, as well as the commands for severalof the facilitiesbuilt into it by default. The major sectionsare : OverviewDiscussion of the logical organization sf IDA XDAL commands Summary of IDAT, commands and the Jazelle - interface to IDAL Jazelle-commands Summary of Jazelle commands. 10 commands Input-output commands Wandypak-commands Hiatogram manipulation commands User Iinterface Description of the user interfaceand assoicated commmands Fit-commands Summary of the comnds to fit plots

Additional Information Available: Overview ICDAT,- commands Jazelle-commandsHandypak-commands IO- commands User-Interface Fit- commands PFlmSelectItem PF3mPrevious Menu PFJxQuit PF7-Backward PFB=Forward

=arm=> Macro-read 2 Files

151 i’I

DEVELOPING FULLSCREEN REXX APPLICATIONS

Larry Oppenheim

152

What is XMENU?

I A set of tools making it easy to wrap full screen menus around REXX applications.

I The XHENU product has threemain pieces:

XMEDIT

A menu painter and menu editor.

MENUEXEC

The interface between menus and REXX.

Subroutines

A set of subroutineswhich allow non-REXX languages to handleyour existing menus.

154 XMEDIT

8 BasicDefinitions:

Menus created by XMEDIT consistofprotected and unprotectedfieldsthat have various highlighting options.

Fieldsare assigned names toallow an applicationto read or writethe screen.

I Advantages:

The programmer doesn’t need to know thelocations of the data on thescreen.

. You can easi ly make changes to menus without touchingthe supporting REXX code.

It should be obviousthat XMENU is great for rapid prototyping.

I How to Create a Menu:

Enter the XMEDIT command (it is to menus what XEDIT is to ordinary flles).

Quicklytype the text portion (field captions, etc.) on thescreen.

. Transfer to edit mode to refine the rough sketch.

Returnto input mode todefine your fields and assign them attributes.

Set initialcursor position.

Name the fields which will receive or display data.

Transfertodisplay mode toget an immediate WYSIWYG view of your newmenu.

155 MENUEXEC

I Allows REXX to move data back and forth between the EXEC and thescreen.

I Controlof the menu is providedin two ways by MENUEXEC:

MENUEXEC command options

MENUEXEC subcommands

I MENUEXEC bestis invoked by usingthe SUBCOMCMS interface. Here is anexample:

/* REXX application */ MENUEXEC menuname (SUBCMDS ADDRESS MENUCMDS "ERRMSG MESSAGE" "FIELDMSG NAME 'This is the NAME helpmsg'" "FIELDPFK PFOl" "REQUIRE NAME ALPHA" next subcommand MENUEND /* Terminates SUBCOM interface */ ADDRESS COMMAND

Notes on the above example:

The SUBCMDS optioninitiates the SUBCOM interface.

The MENUCMDS environmentexpects valid MENUEXEC subcommands.

MENUEND terminatesthe SUBCOM interface.

ERRMSG, FIELDMSG,FIELDPFK and REQUIRE all work together: - ERRMSG describesthe field in whicherror messages areplaced - FIELDMSG associates a help or error message with the named field. Themessage is triggered by one of the following events:

A REQUIRE conditionfails (invalid data was entered in thefield), or ... The FIELDPFK (PF 1) was pressed with the cursor on that f ie7d.

156 157

> u) Q) m U c cn 3 I L 0 rn

-0

Y yl i= OdL Q)

UL

0 0 0 0

159 L Q)

.I>

+Q) 0 ..I> mQ)

Q)Q)

0 0

160 L *I I a a Q a ii 0 CI

e a cw rc 0 L w c 0 a +.r + .I c0 c a ;i=a v a c0 a is a v) 3 E“rn cn c .- a 5 .. v) E .I a L rcis L .I Ia Q .-e a W L: e I- E

161 'CI a C U Q W cn ~ t I a 4 0 >

0 0 0 0 0

162

. '. W

0t 0 A z n W w L 3 e I- K CI 0 2 cn 3.

0 0 0 0

163 0 W x W W J

6K e V

164 h

0 0 0 0 c\1 e 0

0 e 0

165 L 0

166 .I a8 v) a

167 168 .Y0 c, 0 .I m.. 8 0 P m Q) m A 3 Q 0 c .-v) CI .I LI 0 LI e Q) 2E .. m c.. Q) f 0 0

170

...... , , . . , . 171 REXX IN THREE DIFFERENT ENVIRONMENTS

April 261h, 1990

Mason Kelsey

172 Table of Contents MOVING TOWARDS SAA ...... 1 STORAGE ...... 3 CLEARlXG SCREENS ...... 5 ADDRESSIXG Ehl'1RON"S ...... 7 FUNCTIOXS NOT AVAILABLE ON ALL SYSTERlS ...... 9 QUEUES (STACKS) ...... 11 REXXIIO ...... 32 HOW CAS WE JSCREASE REXXPORTABILITY? ...... 55

Table of Contents 173 THANKS

SpeciaI thanks are due to Charlie Fowler, AVP of Systems Training, Fireman’s Fund Insurance Company, for access to the resources necessary to write this paper.

Table of Contents 174 MOVING TOWARDS SAA

175 MOVING TOWARDS SAA ARE WE ACHIEVING SAA? 1. REXX has been SAA Product since 1987 2. Supplants CMDs (BATS) on OS12 3. Can co-exist with OS/2 Command Files in OS/2 4. IBM OS/2 REXX uses CMD.EXE, just like Command Files 5. Supplants CLIST and JCL (Subset?) on MVS 6. Runs in TSO Space or Non-TSO Space (Batch) on MVS 7. Can co-exist with CLIST in MVS 8. Supplants EXEC and EXEC2 on VM 9. Can co-exist with EXEC and EXEC2 in VM 10. Learning curve much lower than C 11. Compilers or Run-Time Modules Available

HOWEVER 1. Incompatibility of file state determination, clearing screen, and other gen- eral utility type commands in 3 systems. Not REXX's problem, but REXX portability suffers because of it 2. Over 38 commonly used REXX functions do not work in all 3 environments 3. Stacks are handled differently in all 3 environments MVS and OS/2 have multiple stack capabilities; VM does not MVS and VM have multiple buffer capabilities; OS12 does not OS/2 stacks can be shared with other tasks; MVS and VM can not

4. FILE I/O is handled differently in all 3 environments MVS EXECIO (except for DISKRU) is a subset of VM EXEC10 No FINIS command in MVS Environment (operand of EXECIO) Issues over Record I/O vs. Stream I/O clouds portability to OS/2 No EXEC10 command in OS/2 versions; instead has 7 functions 5. Display capture is different in all three environments MVS uses OUTTRAP() VM uses (STACK, (FIFO, or (LIFO operands on CPKMS commands OS/2 usesredirection to QUEUE: device

176 MOVISG TOWARDS SAA STORAGE

STORAGE 177 STORAGE

VM

0 VM REXX Execs are stored with a file type of EXEC.

0 EXEC2EXECs alsohave a filetype of EXEC. This is thereason why a comment is required in the first line; to tell the two languages apart.

MVS

0 Store in EXEC PDS allocated under SYSEXEC.

0 MVS REXX Execs mayalso be stored in a CLIST PDS allocatedunder SYSPROC. They mayalso be stored in an EXEC PDS allocatedunder SYSPROC or SYSEXEC.

0 If allocated under SYSPROC, EXEC must have “REXX” in first line comment; otherwise the CLIST interpreter is used during implicit execution.

0 The dataset name can be anything, but UserlD.EXEC or UserlD.REXX.EXEC are highly recommended. Duringimplicit execution, EXEC librariesare not currently found if allo- cated under SYSEXEC ddname unless the following command is executed:

EXECUTJL SEARCHDD(YES) which causes the SYSEXEC files to be inserted in the search path ahead of SYSPROC files. When REXX Execs outnumber CLIST, sometime in the future, this search order can be made automatic. os12 * Store 16”s OS2 REXX Execs with an extension of CMD. Command Language files also have an extension of CMD; but EXECs begin with a comment.

0 Both CTC’s OS/2 REXX2 Source Code Execs andMansfield’s 092 REXX Execs can be stored with any extension,if explicitly executed with that ex- tension. If explicitly executed without an extension, the Execs must have a REX extension. This is the design recommended by C %ishaw.

STORAGE 178 CLEARING SCREENS

179 CLEARING SCREENS CLEARING SCREENS

1. MVS:

UTYTCLERTSO Command

Aliases: K and CLEAR

Syntax: CLEAR[BEEPINOBEEP] [SAVEINOSAVE] [IMMEDIATE]

9 Defaults: NOBEEPNOSAVE

SAVE causes a paging conditionunder VTAM so thecurrent screen can be seen; NOSAVE inhibits the paging condition

IMMEDIATE clears the screen immediately under VTAM. If not coded the screen is not cleared until the next TPUT (from 110 commands). Should be coded with any Dialog Application.

Not an IBM TSO command

2. OSl2: CLS Internal 092Command No Operands

3. VM:

VMFCLEAR or CLRSCRNCMS Commands

Both clearthe screen immediatelywhen screen in RUNNING status.

VMFCLEARhas no operands and no help.

Although VMFCLEAR has always been on the CMS/SP S-disk, it is notan IBM command. Andthere is no HELP file, and no documentation.

CLRSCRN MORE causes a MORE ... message to appear. When the user presses CLEAR or PA2, then the screen is cleared.

CLRSCRN ? displays the help for CLRSCRN.

CLEARING SCREENS 180 ADDRESSING ENVIRONMENTS

181 ADDRESSING ENMROKMENTS ADDRESSING ENVIRONMENTS

1. MVS Environments: Non-TSO/E address space MVS (default), LINK, and ATTACH TSOlE address space (TSOlE) TSO (default), MVS, LINK, and ATTACH TSOlE address space (ISPF) TSO (default), MVS, LINK, ATTACH, ISPEXEC, and ISREDIT 2. OS/2 Environments:

CMD (default) Default OS/2 Command Environment SPF2 (CTC Only) PDF Look alike by CTC ISPCIR DM/DTL Environment 3. VM Environments: CMS normal command processing; Exec, load module, CMS, or CP command will go through normal search. Default Environment. XEDIT commands received by XEDIT COMMAND commands issued are handled via SVC 202; put 'EXEC' in front of execs and 'CP' in front of CP commands (null); same as COMMAND; this is not the same as no operand no operand switch back to previous environment ISPEXEC ISPF Environment ISREDIT ISPF Edit Macro Environment MVS Environs if MVS is running under CP, any MVS environment is available Use the ADDRESS command to direct a host command to other than the de- fault host environment.

ADDRESSING ENVIROKMENTS 182 FUNCTIONS NOT AVAILABLE ON ALL SYSTEMS

183 FUNCTIONS NOT AVAILABLE ON ALL SYSTEMS * BEEP(frequency,duration) IBM OS12 B2X(binarystring) IBM and CTC OS12 * CHARIN([name][,start][,length]) IBM and CTC OS12 * CHAROUT([name][,start][,length]) IBM and CTC OS12 * CHARS([name]) IBM and CTC OS12 CMSFLAG(f1ag) CMS CtATE([option(julian)]) MVS and VM D~TE([option(l)]) IBM andCTC OS12 DlAG[rc]( .....) CMS * DIRECTORY([newdir]) IBM OS12 * ENDLOCAL() IBM and CTC OS12 EXTERNALS() MVS, VM, and CTC OS/2 FILESPEC(option,filespec) IBM OS12 FIND(phrase,word) MVS, VM, and CTC OS12 JUSTIFY(string,length,[pad]) MVS, VM, and CTC OS/2 * LINEIN() IBM and CTC OS12 * LINEOUT() IBM and CTC OS12 * LINES() IBM and CTC OS12 LINESIZE() MVS, VM, and CTC OS12 * LISTDSI() MVS LOADFUNCLIBO CTC OS1.2 * MSG(”0N”I”OFF”) MVS * OUTTRAP(”var.”,rnax-lines,”CONCAT”j“NONCONCAT”) MVS PROMPT() MVS RXFUNCADD(name,module,procedure) IBM OS12 RXFUNCDROP(narne) IBM 092 RXFUNCQUERY(narne) IBM OS12 RXQUEUE(control,[queuenarne]) IBM and CTC OS/2 * SETLOCAL() IBM and CTC OS/2 SHARE() CTC OS12 STORAGE([addr,length,data]) MVS and VM * STREAM() IBM and CTC OS12 * SYSDSNO MVS * SYSVARO MVS * USERID() MVS, VM, and CTC OS12 * VALUE(ext-var,new-vaI,’OS2ENVIRONMENT’) IBM OS/2 VALUE(ext-var,new-vaI,’CMD’) CTC OS/2 X2BO CTC OS12 1. FIND() and JUSTIFY() are available on all systems, except IBM OS/2. 2. EXTERNAL() is available on all systems,except IBM OS/2, but it is only useful on CMS, which has a terminal buffer. 3. USERID() is available on all systems, except IBM OS/2, but it is only useful on MVS and VM.

FUNCTlOSS NOT AVAILABLE ON ALL SYSTEMS 184 QUEUES (STACKS)

QUEUES (STACKS) 185

. ,. DATA QUEUE OR PROGRAM STACK

Program Stack in somesystems iscalled an "ExternalData Queue", "Data Queue" or, simply, "Queue". MVS manuals also refer to it as the "Data Stack". In REXX, Queue and Stack are synonyms.

Used to receive data from a command or to pass data toone

In MVS and OS/2, additional stacks can be created although only one is active. In MVS, use the NEWSTACK, DELSTACK, and QSTACK commands, and the QUEUED() function. In OS/2, use the RXQUEUEO function.

LIFO (PUSH) Next record to be read from the stack

FIFO (QUEUE) . I record n 1 Program Stack

QUEUES (STACKS) 186 UFFERS

A buffer is a subdivision of a stack. This capability is available on MVS and VM only. It is controlled with the MAKEBUF, DROPBUF, QBUF, and QELEM commands, and the QUEUED() function. The command, DESBUF, is available on VM only.

(PULL)

1 I LIFO (PUSH) Buffer 2; Record1 Next record Buffer 2; Record 2 to be read from the stack

FIFO (QUEUE) Buffer 2; Record n Buffer 1; Record 1 Buffer 1; Record 2 Buffer 1; Record 3 Buffer 0; No Records - Program Stack

187 QUEUES (STACKS) MAKEBUF

For MVS and VM only. The current data queue starts with buffer 0. Executing MAKEBUF divides the current data queue into a two buffers, only one active.

The return code is equal to the stack number. MAKEBUF returns a non- zero RC if the command works properly. Do not use SIGNAL ON ERROR while executing MAKEBUF. How many buffers with contents can be created depends upon your Re- gion. When youexceed storage, you may geta REXX error message: ”Failure in System Service”.

If a buffer is created in a higher or lower EXEC, a function, or subroutine, it is still active upon return to the other level. Data left in the stack is exe- cuted at exitfrom highest level EXEC, unlessyou do a DESBUF or DROPBUF. The message ”UNKNOWN COMMAND’’ will appear if a line in the buffer is not a valid command. QBUF returns the number of the currently active buffer. QELEM returns the number of records of the currently active buffer. QUEUED() returns the number of records of all buffers in the currently ac- tive data stack. If a PULL command exhausts the contentsof an active buffer in stack,a the next time the PULL command is executed, it does.an automaticDROPBUF and gets the top record of the next buffer, if the next buffer is not empty. If it is not empty, no DROPBUF occurs.

MAKEBUF RC = 1

’STACK 1 STACK 1

188 QUEUE§ (STACKS) DROPBUF AND DESBUF

SYNTAX: DROPBUF [N] (MVS and VM Only)

ACTION: Will release one or more buffers

DROPBUF will eliminate a buffer and the contents of it if any remain.

N, when specified, will eliminate the buffer number specified. If a buffer exists that has a higher number, it will also be eliminated.

SYNTAX: DESBUF (VM Only)

ACTION: Deletesthe contents of theconsole and program stacks

189 QUEUES (STACKS)

, -,. . MAKEBUF AN ROPBUF. VM EXAMPLE

Example from VM/CMS EXEC: LINKTO address command ’MAKEBUF’ address command ’SET CMSTYPE HT’ address command ’EXEC10 * DISKR‘ mdisk-name ’$DISKID$’ fm ’0 ( FINIS’ saverc = rc address command ’SET CMSNPE RT’ IF saverc \= 0 .. then do IF \quiet then say ’Error’ saverc ’reading’ mdisk-name, ’$DISKID$ file’ address command ‘DROPBUF’ exit end PARSE PULL mdisk description PARSE PULL lib ders PARSE VARLIB-DEFS global . ’START=’ pgm-name . address command ’DROPBUF’ etc. The excessive ”ADDRESS COMMAND” prefix was done for performance. How does this improve performance?

QUEUES (STACKS) 190 SENTRIES UEUEDO SYNTAX: QUEUED() (MVS and VM Only)

ACTION: Returns the number of lines in all the buffers of the active stack

The return code will. be0 if there is nodata in the current stack

SYNTAX:SENTRIES (VM Only)

ACTION: Returns the number of lines in all the buffers of the active stack to RC

The return code will be 0 if there is no data in the current stack

Example /* SENTRIES VM EXEC “I /* QUEUED MVS EXEC */ MAKEBUF MAKEBUF SAVERC = RC SAVERC = RC ’LIST ONE EXEC C (STACK’ X = OUTTRAP(”H0LD.”) SENTRIES ’LISTDS EXEC’ LIMIT = RC LIMIT = QUEUED() ‘DO I = 1 TO LIMIT DO I = 1 TO LIMIT PULL LINES.1 PULL HOLD.1 END I END I DROPBUF SAVERC DROPBUF SAVERC EXIT EXIT

191 QUEUES (STACKS) UFFERS EXAMPLE /* REXX EXEC TO DEMO MAKEBUF, QELEM, QBUF, DROPBUF, and QUEUEDO */ /*trace a*/ /*"QBUF"*/ /* What would happenthese if */ /*queue'Line @ ofBuffer' RC*/ /* 2 lines were not commented?*/ "MAKEBUF" say 'Number ofbuffers created is' RC queueLine 1 of Buffer' RC queue ' Line 2 ofBuffer' RC callsubrutl say

do until queued() = 0 say 'Number of lines in most currentstack is ' queued( ) "QELEM" say 'Number of lines in most recently made buffer is' RC "QBUF" say 'Number of currentbuffer is' RC pull var say var s aq! end

say 'Number of linesin most current stack is' queued() "QELEM" say 'Number of lines in most recently made buffer is' RC "QBUF" say 'Number of current buffer is' RC "DROPBUF" say 'Now a buffer was dropped' "QBUF" say 'Number ofcurrent buffer is' RC say exit

subrut 1: "MAKEBUF" say 'Number ofbuffers created is' RC push ' Line A of Buffer' RC push 'Line B of Buffer' RC push'Line C of Buffer' RC return

192 QUEUES (STACKS) BUFFERS EXAMPLE OUTPUT Number of buffers created 1is Number of buffers created 2is

/* Note that the lines in Buffer2 are PULLed LIFO because they */were /* PUSHed into the buffer */ Number oflines in most current stack 5 is Number of lines in most recently made buffer 3 is Number ofcurrent buffer is2 LINE C OF BUFFER 2

Number of lines in most current stack 4 is Number oflines in most recently made buffer2 is Number ofcurrent buffer is2 LINE B OF BUFFER 2

Number of lines in most current stack 3 is Number of lines in most recently made buffer1 is Number of current buffer is2 LINE A OF BUFFER 2

/* Note that the lines in Buffer1 are PULLed FIFO because they */were QUEUEd into the buffer the into /* QUEUEd */ Number of lines in most current stack 2 is Number of linesin most recently made bufferis 0 Number of current buffer 2is /* As the current buffer hasno more lines; the nextPULL essentially */ /* performs a DROPBUFand starts popping records of the next buffer*/ LINE 1 OF BUFFER 1

Number of lines in most current stack 1is Number of lines in most recently made buffer1 is Number of current buffer is1 LINE 2 OF BUFFER 1 /* Note that because there were no records in the stack, the DO ”/ /* loop ended without another PULL to do an automatic DROPBUF */ Number of lines in most current stack0 is Number of lines in most recently made buffer0 is Number of current buffer 1is Now a buffer was dropped Number of current bufferis 0

193 QUEUES (STACKS) THE CONSOLE STACK

Not available on MVS, where keyboard is typically locked until command just entered is finished executing. On VM or OS/2, data is placed in the console stack by ”typing ahead”.

On OS/2, the console stack may be called the terminal input buffer, default in- put stream, or the external event queue.

VM PARSE PULL searches the program stack, first, then console stack, sec- ond, then a VM READ on the terminal, if the stacks are empty

IBM’s and CTC’s OS/2 PARSE PULL searches the data queue, first, then, if empty, searches the default input stream, then prompts at the console.

CTC’s OS/2 PARSEEXTERNAL searches theconsole stack, then, if empty, prompts at the console. It behaves like the VM PARSE EXTERNAL.

I Pulisfrom 1

next Program Console stack stack

I 2

PULL varl

QUEUES (STACKS) 194 YNTAX: EXTERNALSO (Onlyuseful in VM)

ACTION: returns the number of fines in the console stack, also called the terminal input buffer or sys- tem external event queue

If there are no lines in the stack, zero is returned

In MVS, the EXTERNALS() function always returns a zero

Example

lines = EXTERNALS() 303.55 IT1100.999 H$1,304.23 o What is lines equal to in this example?

QUEUES (STACKS) 195 MAKING NEW MVS STACKS * MVS data queues start with Stack 1. Each time you execute NEWSTACK a new stack with the next higher number is created. Only 1 stack is active.

0 Reasons forusing NEWSTACK:

1. Protect elements placed on data stack on one level from another level 2. Preventelements already on stack from being used as prompts to a TSO Command; i.e., isolate TSO Command with NEWSTACK DELSTACK 3. Pass datastack elements to amodule executed froman MVS batch EXEC executed with PGM = IRXJCL

0 HOWmany stacks with contents can be created depends upon your Region. When you exceed storage, you may get a REXX error message: ”Failure in System Service”.

0 If astack is created in a another EXEC, function, or subroutine, it is still active upon moving to other levels. Data left in the stack is executed at exit fromhighest level EXEC, unlessyou do a DESBUF or DELSTACK. The message ”UNKNOWN COMMAND” appears if a line in the buffer is not a valid command.

196 QUEUES (STACKS) MVS STACK COMMANDS

0 QBUF returnsthe active buffer number of theactive stack to RC. Ifno MAKEBUF has been executed after a NEWSTACK, QBUF returns a zero. e QELEM returns the number of records of the currently active buffer in the active stack to RC. Use the QSTACK command to return to RC the current stack number.

@ QUEUED() returns the number of records of all buffers in the currently ac- tive data stack only,

0 DELSTACK deletesthe most recently created stack, createdwith the NEWSTACK command; otherwise, deletes contents of original stack.

0 If a PULL command exhausts the contents of an active stack the next PULL command prompts the terminal. If there is another non-empty stack, its contents can not be accessed before a DELSTACK.

Stack 1 NEWSTACK -1 -1 QSTACK RC = 1

197 QUEUES (STACKS)

, ,... . NEWSTACK EXAMPLE /* REXX EXEC TO DEMO NEWSTACK, QSTACK, DELSTACK, and QUEUEDO */ push "SENX 'PUSHed before first NEWSTACK' USER(STR1AAA)" push "SEND ' PUSHed before first NEWSTACK'USER(STR1AAA)" "NEWSTACK" "QSTACK" say 'A NEWSTACK hascreated Stack* RC say queue'Line 1 of Stack' RC queue'Line 2 ofStack' RC call subrutl call subrut2

Y&ACK'* doforever do until queued() = 0 say 'Number of linesin Stack' RC ' is' queued() say'Pulling from Stack' RC if queued() \= 0 thendo pull var say var end elsesay 'Nothing in Current Stack' end "DELSTACK" "QSTACK" say say 'A DELSTACK hasbeen done; returned toStack' RC say if RC = 1 then exit end exit

subrut 1: "NEWSTACK" "QSTACK" say 'A NEWSTACK hascreated Stack' RC say push'Line X of Stack' RC push'Line Y of Stack' RC push'Line Z ofStack' RC return

subrut2 : "NEWSTACK" "QSTACK" say 'A NEWSTACK hascreated Stack' RC say'Nothing will be put in it' return

QUEUES (STACKS) 198 NEWS MPLE

A NEWSTACK has created Stack 2

A NEWSTACK has created Stack 3

A NEWSTACK has created Stack 4 Nothing will be put in it

Number of lines in Stack 4 is 0 Pulling from Stack 4 /* Note that PULL does */ Nothing inCurrent Stack /*, drop down to Stack 3 */

A DELSTACK hasbeen done; returned to Stack 3

Number oflines in Stack 3 is 3 Pulling fromStack 3 LINE 2 OF STACK 3 /* Note reverseorder */ Pulling from Stack 3 /* Due to PUSHcommand */ LINE Y OF STACK 3 Pulling from Stack 3 LINE X OF STACK 3

A DELSTACK has beendone; returned to Stack 2

Number of linesin Stack 2 is 2 Pulling from Stack 2 LINE 1 OF STACK 2 Pulling from Stack 2 LINE 2 OF STACK 2

A DELSTACK hasbeen done; returned to Stack 1

PUSHED BEFORE FIRST NEWSTACK STRlAAA /* Execution as Commands */ COMMAND SENXNOT FOUND /* of Text left in Stack */

QUEUES (STACKS) 199 REDIRECTING TSO COMMAND OUTPUT TO DATA QUEUE BACKGROUND: Just as the &SYSOUTTRAP and &SYSOUTLINEn system variables in CLIST al- lowed the capture of any terminal output created with a WTO macro, you can also do the same in an EXEC with the OUTTRAP() function.

SYNTAX: OUTTRAP(”cv.”,max-lines,”CONCATI”NONCONCAT”)

ACTION: ,Captures output sent to terminal’with WTO macro

OPERANDS:

cv. is the name of the compound variable, including period, that will receive lines of output

max-linesmaximum number lines that are captured; default is 999,999,999

CONCAT subsequentcommands or modulesappend display output; CONCAT is the default

NONCONCAT subsequent commands or modules overlay previous output

After the funtion has executed, three special variables can be used: cv.max Maximum lines that can be captured e cv.trapped Number of lines captured e cv.con CONCAT or NONCONCAT. whichever set

200 QUEUES (STACKS) UTTRAPO EXAMPLE /* REXX EXEC THAT DISPLAYS ALL FILES ALLOCATEDUNDER DDNAME PASSED */ arg filedd debug if debug= 'debug' then trace i x = OU?TRAP("catch.",55) /* Capture <= 55 lines in compound variable*/ "listdd" /* Commandthat output will capturedbe */

DO line = 1 until line= catch.trapped queue catch.line /* Put captured lines in data queue */ END

DO until QUEUEDO = 0 /* Scan to bottom or until filename found*/ parse pull ddname DD dsn volser disp . if ddname= filedd then leave END

if QUEUED() = 0 & ddname \= filedd, then do say 'No files allocated under' filedd exit end say "DATASETSsay ALLOCATED UNDER "filedd"VOLSER DISP" say ''------?I DO until ddname \= f iledd & ddname \= "" spacel = 11 space2 = 11 do until length(dsn) + length(space1) > 45 spacel = spacel I I end do until length(vo1ser) + length(space2) > 10 space2 = space21 1' end say dsn spacel volser space2 disp parse pull ddname DD dsn volser disp . end "DELSTACK"

If I enter "EXECNAME ispplib", it displays, for example:

\ DATASETSALLOCATED UNDER ISPPLIBDISPVOLSER ------_____^______------SYS8.ISR.ISRPLIB IGLE91 SHR SYS9.SDSF.ISPPLIB SDD032 SHR SYSE.COB2PLIB ZTSOCO SHR

QUEUES (STACKS) 201

.. XQUEUEO YNTAX: RXQUEUE(”action” ,queuename])

ACTIONS: Control Private Queues in OS12

ACTION OPERANDS: Create Creates a queue with name, queuename. If no name is coded, REXX provides a name. Returns queuename.

DeleteDeletes named queue. Returns 0 if successful. RC = 9 means queue does not exist.

Get Returns name of queue currently in use.

Set Sets name of current queue to operand queuename. Returns name of previous queuename.

Exits Checks for existance of named queue. Returns 1 if queue exists, 0 if it does not exist. Only available with CTC’s OS/2 REXX.

The RXQlUEUE() function is used to controlOS/2 Private Queues by name. The PUSH, QUEUE, and PULL commands are used to perform Queue I/O. RXQUEUE can also be called.

Private Queue names must be unique across the entire OS/2 system. Any lower level external process inherits asits default queue the queue in use bythe parent process. Private Queuescontinue to exist until explicitly de- leted.

In OS/2, if no RXQUEUEO function has been executed, the OS/2 Session Queue is automatically provided and controlled by OS/2. Its name is SESSION. All processes in a session can access the session queue.

Private Queues are not owned by any specific process and the synchronization of requests that update any Queue is the responsibility of the programmer.

No queue element can be less than 64 bytes or more than 64K.

QUEUES (STACKS) 202 RXQUEUEO EXAMPLE /" REXX EXEC TO DEMO RXQVEVE() */ /* "/ /" PUSH/PULL WITHOUT multiprogrammingsupport */ /" */ pu sh data() time0data() push date/* push and time */ do 1000 pass/* lets some time "/ noP nothing /* doing */ end /* end of loop "/ pull a b /* pull them "/ say'Pushed at ab I, Pulledat ' date()time() /* say now and then */ /* "/ /* PUSH/PULL WITH multiprogrammingsupport */ /* No recovery,error or unsupported Env tests */ /* "/ newq = RXQUEUE('Create') /* Create a private queue */ oldq = RXQUEUE('Set',newq) /* Establish new queue */ push date() time()date() push /* Push date and time */ do 1000 nop end pull a b say 'Pushed at a b ', Pulled at ' date()time() /* telluser */ call RXQUEUE 'Delete' ,newq /* Destroyunique queue created */ call RXQUEUE ' Set,.oldq /* Resettodefault queue (optional) */

QUEUES (STACKS) 203

. . ., OS/2 REDIRECTION WI[TH 'QUEUE:

4S/2 providesa default input and output stream of STDIN: and STDOUT:, which are from and to the console. Redirection allows you to override the default streams with file names. The input/output streams can also be redi- rected to reserve device names by using:

STDERR: Standard error output CON: Display screen input and output. If input, an F6 - Enter Key sequence will generate an EOF, terninating CON as input. KB D: Keyboard Input LPTl: and LPT2: Parallel Printer Devices PRN: Current default printer output (Same as LPTl:) COMl: and COM2: Asynchronous Communication Ports AUX: Current Async Comm Port (Same as COMl:) NULL: Dummy Device. If input, immediate EOF. QUEUE: REXX external data queue It is the last item that is of interest to us here. QUEUE: gives us the capabilityof direct input/ouput to/from the REXX External Data Queue and an OS/2 Command or load module. For example:

'DIR > QUEUE:' puts the output of the DIR command in the queue, line by line.

QUEUES (STACKS) 204 CMS CQMMANDS WITH STACK OPERAND

QUERY, IDENTIFY, and LIST are a few of the CMS commands that can put data into the data stack. Data can be put into the stack in either FIFO or LIFO order The option STACK may be used and denotes FIFO order

Examples 'QUERY DISK (STACK'

'QUERY CMSTYPE (FIFO'

'IDENTIFY (LIFO'

'LISTfile fn ft fm (STACK'

QUEUES (STACKS) 205

.. REXX 110

REXX !/O 206 EXECIO ACCESS (MVS and VM)

SYNTAX: EXEC10 nl* function [operands] [(options]

n is the number of lines or records; * means all

Functions:

RDRPRT PUN

CARD PRINTPUNCH

DISKRU /ApPLEEXECl DISKR DISK "EXECIO ..." CON

CP

CP

FUNCTIONS AVAILABLE ONLY ON VM: CARD, PRINT, PUNCH, CP, EMSG

REXX I/O MVS EXECIO DISK 1/0

Read from disk, DISKR:

EXECIQ nl* DISKR ddname [LN] [(options E)] ]

0 n is number of lines read; * means all 0 LN isthe starting line number * Optionson next page If no "LN", .sequential from record 1 e RC = 2 means End-of-File @ Data read into the stack or REXX variable(s) (based on options)

Write to disk, DISKW:

EXEC10 nl* DISKW ddname [(options [)] ]

6 n is number of lines written; * means all 6 File allocated by ddname and must be allocated before EXECIO. * Data written from the stack or REXX variable(s). 0 Writing from stack continues until null line found or null entry made from console, if stack exhausted. Writing from a compound variable continues until null value or uninitialized variable found.

Update disk, DISKRU:

EXECIQ nl* DISKRU ddname [LN] [(options f)] ]

* m is number of lines read; means all 0 LN should notbe set to a value lessthan current position without closing and reopening the file; can cause errors

REXX I/O 208 VM EXEC10 DISK 1/0

* Read from disk, DISKR:

EXEC10 nl* DISKR fnft [fm [LN]] [(options]

n - Numberof lines (* means all) fn - Filename ft - Filetype fm - Filemode(default: *) LN - Starting LineNumber

If no "LN", sequential from record 1 Data read into the stack or REXX variable(s) (based on options)

Write to disk, DISKW:

EXEC10 nl* DISKW fnft fm [LN [FIV [Irecl]]] [(options]

FIV - Record format, Fixed or Variable fm - Requiredbut may be * lrecl - Logical record length; default for F= 80

If "LN", over-writes from that record onward If no "LN", appends to End-of-File Data written from the stack or REXX variable(s) (based on options)

209 REXX 1/0

). .. EXEC10 OPTIONS

0 STEM name.Lines readlwritten to/from stem variables "narne.1" to "name.n" ("narne.O"= lines read) * STRING data Data foroutput, instream on VM EXEC10 crnd

0 FINISClose afterfiie DISKR, DISKRU, or DISKW (aliso available as VM command) VAR name VM lineread/written to/drornvariable

* SKIP Skips overcoded number lines;of * skipsto EOF * LIFOIFIFO Order of linesread into the DataQueue

0 NOTYPE SuppressVM I/O errormessage

0 BUFFER IncreasesVM CP ops areafrom 8K to 32K VM editing options: FIND, LOCATE, AVOID, MARGINS, STRIP, CASE

IF VAR and STEM are not coded, records are read from or writtento the Data Queue.

In MVS, only STEM, FINIS, SKIP, LIFO, and FIFO can be coded. If STEM and FINIS are coded, FINIS is coded after. Atso, you code SKIP, LIFO, or FIFO only if you are accessing theData Queue.

RESX 110 210 MVS STEM AND FINIS EXAMPLES

EXEC(R0YROGER) ”ALLOC DA(’ROY.ROGERS.BOOTS’) F(OUT1) SHR” LINE1 = ’Pardon me, Roy, is this the cat that ate your new shoes?’ ”EXEC10 1 DISKW OUT1(STEM LINE1”

EXEC(JESTER) lines Whichfile of the ”ALLOC DA(JEX.DATA) F(PUNNY) SHR” willbein LINE.1 and .2? ”EXEC10 1 DISKR PUNNY 8 (STEM LINE.” ”EXEC10 1 DISKR PUNNY(STEM LINE.”

EXEC(DICKENS) ”ALLOC DA(ATALEOF.TWO.CITIES) F(DICKENS) SHR” QUEUE ’It wasthe best of times,’How many recordswill QUEUE ’it was the worst of times,‘ written?willbe QUEUE ’it was the age of wisdom,’ QUEUE” ”EXEC10 * DISKW DICKENS (FINIS’’

EXEC(PUNS) QUEUE ’I leftmy harp in SamClam‘s disco’ Can you tell how many QUEUE ’Repaintandthin more!’no lines will be written? QUEUE ’Hangover: The wrath of grapes.’ ”ALLOC DA(DARK.STORMY(NlGHT)) F(ST0RY) SHR” ”EXECIO * DISKW STORY (FINIS’’

EXEC(HUXLEY) ”ALLOC DA(’6RAVE.NEW.W’) F(FID) SHR” Explain what is ”EXECIO * DlSKR FID, herehappening (STEM” LINE. ”FINIS”

211 VAR dk ,STEM-OPTIONS

Fi:CCULLER EXEC FIB = 'HEARTISA LONELY H' o If thisis a newfile, LINE = 'Therewere two deaf-mutes,' what willthe RECFM be? "EXECIO 1 DISKW"FID "(VAR LINE"

H ELLER EXECHELLER o linesWhich fileof the FID = 'CATCH 22' be will in L-A and L-B? "EXECIO 1 DISKR"FID "8(VAR L-A" "EXECIO 1 DISKR"FID "(VAR L-B" o Howlong is value in L-A?

DICKENS EXEC FIB = 'ATALEOF 2CITIES A' LN.1 = 'It was thebest of times,' o Howmany records will LN.2 = 'it was theworst of times,' willwritten?be LN.3 = 'it was the age of wisdom,' o What willthe LRECLbe?

LN.99 = '/ "EXECIO * DISKW" FID "F 120", "(STEM" LN.

HUXLEY EXEC FID = 'BRAVE NEWW' o Explainwhat is "EXECIO * DISKR" FID, happening here "(STEM" LINE. "FINIS"

REXS 1/0 212 !

VM UNIT RECORD 1/0

* Read from virtual reader, CARD:

- E.g. EXEC10 CARD (STEM DECK.

* Punch to virtual punch, PUNCH:

E.g. EXEC10 1 PUNCH (VAR CARD

* Print on virtual printer, PRINT:

E.g. EXEC10 * PRINT

Special option: CC DATAIcode CC DATA means Carriage control is 1st byte in line Actual CC character (e.g., 0, -, 1) Without CC, it defaults to single spacing

REX4 1/0 213 VM EXAMPLES

Print all lines in the array PRINTME.n, the first byte in each lineis the car- riage control character.

0 Write the data in variable LETTUCE to the file SALAD DAYS 15 as record 27. Close the file after this write.

* Test if there is a device at vaddr 183. insure no CP response appears on the screen.

4 Readfrom the file MASON WHYME onsome disk. The startingrecord number is in variable X. Read until EOF into array E3ECAUSE.n. Close the file when done.

* Create a new variable length file with a maximum length of 133. File ID is OHSAY CANYOU C. Data is in the program stack. Number of rows in stack is in variable STACK-NUM.

KEXX 110 214 VM FINIS SYNTAX:

FINIS fn ft [fm] fn - Filename (can be *) ft - Filetype (can be *) fm - Default is A1 (can be *) ACTION: Closes one or more open fifes If not executed, all files closed automatically by CMS command handler at R; message.

RESX 1/0 215

.. RECORD vs. STREAM 1/0

MVS and VM Files usually use RECORD 110.

RECORD I/O ATTRIBUTES

1. FixedLength Fields 2. Stored with No Delimiter between Fields 3. Fixed or VariableLength Records 4. Stored with No Delimiter between Records But in the micro world, it is just as common to see an alternate (and older) method of storing data, STREAM I/O.

STREAM I/O ATTRIBUTES

1. VariableLength Fields 2. Fields Separated by a Delimiter (comma is common) 3 VEriableLength Records 4. Records Separated by a Delimiter (CRLF is common) 5. Or File may be One Long String of Fields or Characters With STREAM 1/0 so common, there is no EXEC10 command for 092 RE%. Instead you workwith files, whether they were created with RECORD or STREAM I/O techniques, as a "Stream" of Data using functions.

REXX I/O 216 WHAT ARE OS/2 I/O STREAMS?

A Stream may be:

Streams may be accessed a character at a time using: CHARIN(), CHAROUT(), CHARS() or a line at a time using:

LINEIN(), LINEOUT(), LINES()

or explicitly determine and control the state of the stream with:

STREAM()

Which way you code it depends on the way the data was created or how it will be received.

REXX 1/0 217 LINEOUT() SYNTAX: LINEOUT( [stream] [,[linedata] ,line#])

ACTCON: If not open? implicitly opens stream first time executed, for read or write. Appends a CRLF to the end of the ’’linedata” and writes it to the st ream. * The only valid value for lineiff in 16”s REXX is 1. * The stream can be written to a file, data queue, or output device. Returns a 0 if write successful, 1 if unsuccessful. If called as a subroutine, returned value is in RESULT.

REXX l/O 218 LINEOUT() EXAMPLES

X = LINEOUT() /* Opens STDOUT: and writes a null string, CRLF */

X = LINEOUT(, 'Look, Ma, no stream! ' ) /* Writesstring-CRLF toconsole (STDOUT:) */ X = LINEOUT( 'QUEUE: ' , 'First Time') /* Opens Data Queue and writes string-CRLF */ X = LINEOUT('C:\PATH\OLD.TXT', 'Overlay It' ,I) /* Opens 0LD.TXT file and overlaysline 1, positionsto line 2 */

X = LINEOUT( ' OLD. TXT' , Change Rates ' ) /* Writesstring-CRLF over second line, positions to line 3 */

X = LINEOUT( ' OLD. TXT' , , 1) /" No Writeoccurs, repositions to line 1 for next LINEOUT() write */ x = LINEOUT('OLD.TXT') /* If open,positions at endof file and closes 0LD.TXT */

Call LINEOUT 'DONG.XI','Li Bai',l /* Writes string over first line of DONG.XI, returns 0 to RETURN */ Call LINEOUT 'LPT1: ','Du Fu' /* Writesstring to printer 1 (LPTl:),returns 0 to RETURN */

219 REXX 1/0 LINEIN() YNTAX: LINEIN( [stream] [,[line#] ,count])

CTION: If not open, implicitly opens stream first time executed, for read or w-ite. Returns the next line from the stream and strips any CRLF from the end of the line.

The only valid value for line#, if coded in 16”s OS/2, is 1. However, CTC’s REXX allows repositioning to any valid line number in the stream. A count of 0 returns a null string and no characters are read. Not coding countor coding a 1 meansread one string. After read occurs, updates ”count” with 0 if no lines read, 1 if one line read.

The stream can be read from a file, data queue, or input device.

Available as operand in ”PARSEVALUE LINEIN() WITH template”com- mand to perform parsing with stream VO input.

NEXX I/O 220 LINEIN() EXAMPLES

X = LINEIN() /* Opens STDIN: and reads a line */

x = LINEIN( 'QUEUE: ' ) /* Opens Data Queueand readsstring; if Queue is empty, function */ /* goesinto wait state until a line is putinto the DataQueue. */ /* Remember thatData Queues can be updated by otherprocesses. */

x = LINEIN('C:\PATH\OLD.TXT') /* If open,returns next line of file */

X = LINEIN('C:\PATH\OLD.TXT',5,0) /* CTC's OS/2 REXX ONLY */ /* ReturnsNull Value, positions to line 5 fornext LINEIN() read */ x = LINEIN('c:\PATH\oLD.TXT',I,~) /* Repositions to line 1 and returns it, positions to line 2 */

X = LINEIN( 'Am: ' ) /* reads string from default communication port,if line not complete */ /* andno error, then function goes into wait state until finished */

REXX I/O 22 1

I. SYNTAX: LINES( [stream] )

AcYloN: Returns 1 if any data remains between the current read position and the end of the stream; returns if no data remains. The function is used to determine if an EOF condition exists.

e If you explicitly specify aDevice as the stream, the function will always

return a 1 e

Examples x = LINES() /* Return a 1 ifdefault input stream, STDIN:, containsdata beyond */ /* currentread position; 0 if at EOF */ x = LINES('QUEUE:') /* Returns a 1 regardlessof contents of Data Queue. */ x = LINEs('C:\PaTH\oLD.mxr') /* Returns 0 if at end of file,otherwise, a 1 is returned */

REXX 110 222 CHAROUT() SYNTAX: CHAROUT( [Stream] [,[String] ,Start])

ACTION: If not open, implicitly opens stream first time executed, for read or write, positioned at the end of the Stream. After each write, the write posi- tion is incremented by the number of characters written. If Stream not coded, the character string is written to STDOUT:, default output stream. If Start is coded, and the Stream is persistent, it adjust the write position to a positive increment from the beginning of the Stream, and writes the String. A 1 is the first position. If String is not coded, the write position is set to the value of start, but nothing is writtenand a 0 isreturned. If Stringand Start are both not coded, the Stream is closed. The Stream can be written to a file, data queue, or output device. Returns acount of charactersremaining after attempting to write String to the Stream. If called as a subroutine, returned value is in RESULT.

RESS 110 223 CHAROUT() EXAMPLES

X = CHAROUT() /* Opens STDOUT: and writes a null string*/

X = CHAROUT(, 'Look, Ma,no stream! ') /* Writes string to console (STDOUT:) */

X = CHAROUT( 'QUEUE: ' , 'First Time') /* Opens Data Queue and writes stringat bottom of Queue */

X = CHAROUT('C:\PATH\OLD.TXT','Overlay It',l) /+c Opens 0LD.TXT file and overlays starting the in first position*/

X = CHAROUT('OLD.TXT','Change Rates') /* Writes string over 11th position thru 22nd position*/ x = CHAROUT('OLD.TXT',,S) /* No Write occurs, positionsto position 5 for next CHAROUT() write */

X = CHAROUT('OLD.TXT') /* If open, closes 0LD.TXT */ Call CHAROUT 'DONG.XI','Wo de Bei Da de pongyou xihuan Zhongguofan.',l /* Writes string over first CHARof DONG.XI, returns0 to RETURN */ Call CHAROUT 'LPTl:','Annata no namae desuka?' /* Writes string to printer (LPTl:), 1 returns 0 to RETURN */

224 REXX 1/0 CHARIN() SYNTAX: CHARIN( [Stream] [,[Start] ,Length])

ACTION: If not open, implicitly opens stream first time executed, for read or write. Returns the next Length Characters from the Stream.

If Stream is not coded, it defaults to STDIN:.

8 Like CHAROUT(), aread-write position is maintained and updated auto- matically as reads or writes occur. You can override the read position by coding the Start operand, if the positive value is within the range of char- acters remaining in the persistent Stream. A Length of 0 returns a null string and no characters are read. Not coding Length or coding a 1 means read one character. The stream can be read from a file, data queue, or input device.

REXX 1/0 225

.. EXAMPLES

X = CHARIN() /* Opens STDIN: andreads one character entered at the keyboard */ x = CHARIN('QUEUE:') /* Opens Data Queue and reads a character,if Queue'sempty, function "/ /* goesinto wait state until a character is putinto the Data Queue. */ /* Remember that Data Queues canbe updated by otherprocesses. ;'r / x = CHARIN('AUX:',,~O) /* Reads 80 bytes fromcommunication port,if 80 not available and */ /* no error,then function goes into wait state until 80 received. ;': / x = CHARIN('C:\PATH\OLD.TXT') /* Opens 0LD.TXT file and readsfirst record, positions to 2nd byte "/ x = CHARIN('C:\PATH\OLD.TXT') /* Ifopen, returns next character from Stream,updates read position "1

X = CHARIN('C:\PATH\OLD.TXT',5,0) /* ReturnsNull Value, positions to 5th position for next CHARIN()

X = CHARIN( ' C : \PATH\OLD. TXT' , 1, 2) /* Repositions to position 1, returns 2 bytes,positions to 3rd byte "/

226 CHARS() SYNTAX: CHARS( [Stream] )

ACTION: Returns 1 if any data remains between the current read position and the end of the stream; returns if no data remains. The function is used to determine if an EOF condition exists. e Ifyou explicitly specifya Device as the stream, the function will always return a 1.

Examples

X = CHARS( ) /* Return a 1 ifdefault input stream, contains data; otherwise, 0 */

x = CHARS('QUEUE: ' ) /;: Returns a 1 regardless of contentsof Data Queue. */

X = CHARS( 'C: \PATH\OLD.TXT' 1 /;: Returns 0 if at end of file,otherwise, a count-of the number of */ /+: charactersremaining in the Stream. If the Stream is transient, */ /" that is the total number of characters. Ifthe Stream is per- */ /;'; sistent, it is theremaining bytes from theread-write position. */

REXX 1/0 227 EAMO

(StrmName [J S 1 D I C, StrrnCrnd I])

CTIQN: Returns a stringdescribing the state of, or result of operation on, the ”StrrnName” Operands S - State Returns a message string indicating the stateof the Stream. Default.Messages include:

ERROR An error has occurred NOTREADY Normal I/O not possible READY Normal I/O possible UNKNOWN Stream is closed D - Description Also returns state of Stream followed by a colon and more info about ERROR and NOTREADY states C - Command Executes StrmCmd against Stream. Commands include: OPEN Explicitlyopens Stream forread and write OPENREAD Opens forread only OPENWRITE Opens forwrite only CLOSE ClosesStreamthe andreturns ”READY”, or null string if unsuccessful SEEK offset Movesread-write position relative to cur- rentposition, the start or the end ofthe Stream. Offset can be prefixed with: = Offset frombeginning of Stream. Default. 0 < Offset fromend of Stream. f Offset forward from current position. * - Offset backwardfrom current posi- tion. QUERY EXISTS Returns full path of Stream, if it exists; null if not. QUERY SIZE Returnssize bytesin of persistenta Stream. QUERY DATETIME Returns the date/time stamp of a Stream. The 3 QUERY command are not available with CTC’s OW2 REXX.

HEXX 110 228 HOW CAN WE INCREASE REXX PORTABILITY? WISH LIST

1. Provide a prepro e:-essor capability; modelled after C. 2. Provide BAT or CMD to REXX.CMD Convert Utility. 3. Provide EXEC2 to REM EXEC Convert Utility. 4. Provide CLlST and JCL to EXEC(REXX) Convert Utility. 5. Providesimi tar methods of determiningfile states, etc. (Must put pres- sure on Environment Support People; Not REM’s problem). 6. Provide multiple stack capability to VM environment. 7. Provide NEWSTACK et a/ commands for OS/2. 8. Provide OUTTRAP() function on VM and OS/2 for capturing displays. 9. Provide EXEC10 command (as subroutine?) on OS/2 for Record 110. 10. Expand on the EXECIO operands (STRING, VAR, SKIP, LIFOIFIFO, and ed- iting options) for MVS and OS/2. 11. Provide FINIS command on MVS and OS/2; to ease conversion from VM to MVS or OS/2. 12. Provide DISKRU on VM and 092version of EXECIO. 13. Provide a SAYNR command that displays text without a carriage return, to ease conversion from CLlST (with WRITENRs) to EXEC. 14. Provide the ability in MVS of inserting High/Non-Display/Normal Attributes in SAY text as can be done in VM with ’1DOx’X. Provide simular capabili- ties on OS/2. 15. Eliminate synonyms for Data Queue: Program Stack, External Data Queue, Queue, Stack, etc. in documentation. 16. Add Binary String type to MVS and VM, along with a function to convert Binary to Hexadecimal. 17. CTC might create synonym of OS2ENVIRONMENT for their CMD operand of the VALUE function to be compatible with IBM 092. On the other hand, it would make more sense if IBM made the synonym of CMD available. 18. Providea LINESIZE(),EXTERNALS(), FIND(), JUSTIFY(), and USERID() function on IBM’s OS12 REXX. 19. Provide a julian date function on 092 REXX (IBM and CTC). 20. Provide a language date function on MVS and VM. 21. Provide a beep function on MVS and VM. 22.Establish a REXX User’s Group that will maintain a library of programs, functions,and subroutines outside of Mansfield, CTC, IBM, SHARE, or GUIDE.

230 HOW CAN WE ISCREASE REXX PORTABILITl? Ackerman, Alan Dept. 3477. P.0. Box 37QOO San Francisco, CA 91137 675-4358 BAY on VMSHARE ADSE, Bank of America Agui3.a~-, Ben 1555 Berger Dr. Bldg.11-3rd Floor, San Jose CA 95112 405-299-4381 Sr. Prog. Analyst, Santa Clara County Aitken, David 18311 Baylor Ave., Saratoga, CA 95070 408-866-8334 Staff Systems Programmer, Amdahl Aston, David SLAC, 2575 Sand Hill Road, Menlo Park, CA94025 920-2457 DYAEE@SLACVMPhysicist-, SLAC Bailey, Tom 41.1 Tumey St. I Sausalito, CA 94965 332-8495 Programmer, Log.i.ca1Condusion.s Bakcr, Mark 482 Gaviota, Long Beach, CA 90802 213-593-8838 Computing Engineer, McDonnellDouglas Baldwin, Chuck 1327 Corte De Los Vecinos, Walnut Creek, CA94598 256-1195 V. P. Yfktg., Taliesin, Inc. Barnett, Mark 451 Alger Drive, Pah Alto, CA 94306 494-8074 WB(_§LAW Programer, SLAC Berger , Ramon STLAC, Bin 71, 2575 Sand Hill Road, Menlo Park, CA94025 926-3446 RAMON@SLACVM Programer, SLAC Boeheim Chuck Bin 97, SLAC, 2575 Sand Hill Rd,&!enlo Park CA 94-25 926-4640 BOEHEIM@S~-~~TJIProgramser , SuC Bowlby, Gavin 2304 Wooster Ave., Belmont, CA 94002 592-0808 Staff Design Engineer, Amdahl Brink, Ed 1240 Hobart St., Menlo Park, CA94025-5517 322-8113 MCI:EBRINK,ConpuServe:76555,422 Brink and Associates Buder, Pat PO Box 3408, San Jose CA 95156 408-251-2108 Section Mgr., Safeway Cava, Phil 1250 E. Arques MS/201, Sunnyvale, CA 94086 408-746-8544 Sr. Systems Programmer, Amdahl Cholar, Craig 99 Pacific St.Suite 155A, Manterey, CA 93940 408-655-4000 [email protected] Sys.Prog,Defense Manpwr-Data Ctr. Cif onelli, John 6300 N. River Rd., Rosemont, IL 60018 708-696-4800 uunet.!wrkgrp!jac Software Mgr, Workstation Grp. Clancey, Patrick PO Box4349 #50, Stanford, CA 94309 926-2339 CLANCEY@SLA~ Systems Programmer,SLAC Coffee , Peter 4131 Michelle Dr., Torrance, CA 90503 213-371-8096 MC1:Peter Coffee Compuserve:76344,3161 Analyst,PCWeek Cole, Creswell 1260 E. Arques, MS/205, Sunnyvale, CA 94086 408-746-4877 Software Engineer, Amdahl Corp. Coussens, Irene Bin 97, SLAC, 2575 Sand Hill Rd., Menlo Park, CA94025 926-2842 IRENQSLACVM Programmer, SLAC Cowlishaw, Mike IBM Hursley Park, Winchester,UK +44-962-844433 [email protected] IBM Fellow, IBMUM Laboratories Dager , Cathie SLA? Bin 97, 2575 Sand' HillRd, Menlo Park, CA94025 415-926-2904 [email protected] Scientific Programmer, SLAC Dager , Terry 150 Spear St, San Francisco, CA 94105 415-543-9320 Tesseract Daney , Charles 19567 Dorchester Dr, Saratoga, CA 95070 408-257-3697 Quercus Systems Downey , Teresa SLAC, Bin 97, 2575 Sand Hill Rd. Menlo Park, CA94025 926-2903 [email protected] Programmer Analyst, SLAC Dunkel, Daniel 1040 Marina Village Pk~,Alameda,CA 94501 748-5244 Director, Mktg./Sales, Command Technology Corp. Erickson, Bruce 857 Serra St, Stanford, CA 94305 725-1785 AS.BAE@stanford Micro Support, Stanford Univ. Estes, Will 12301 DeSanka Ave. Saratoga, CA 95070-3150 408-446-0387 sUn!p~rtal!cup.portal.com!willProg, U.S. Computer Faracchio, Joe CCS , 26 1 Evans, IJC Berkeley, Berkeley, CA947 20 642-,?638 SPGSAF@ucbcmsa Prog. Arlalyst IV, UCB Feller, Bok: 10 W. Orange Ave, So. San Francisco, CA 94030 867-1472 Systems Progranmer: Guy F Atkinson Fitch, Joel 1804 Vacca Dr, San Jose, CA 95124 408-264-6839 JMFIC@SLACVM Eng. Asst, SLAC E'raatz, Dave Bldg. 220-3W-01, St. Paul, MN 55144 612--736-5650 Specialist, 3M Franklin, Ray 1214 Paru St, Alameda, CA 94501 543-9320programmer, Tesseract Gambelin, Mike 1555 Berger Dr,3rd Floor,Bldg.2, San Jose, CA 95112 299-4301System Programmer, County of Santa Clara Garnett, Forrest 5600 Cottle Rd, San Jose, CA 95193 408-997-4089 GYSLIVES@LSG\"B System Programmer, IBM Giguere, Suzanne 1260 E. Arques M/S 205, Sunnyvale, CA 94086 408-746-6279 Software Eng., Amdahl Corp. Ginevich, Rost 4000 N. Mingo Rd. MD 348, Tulsa, OK 74158 918-832-5375 Sr. Prog. Analyst, American Airlines Goldberg, Gabe 1604 Spring Hill Road, Vienna, VA 22182 703-506-0500 VMG on VMSHARE V.P. VM Systems Group Gomberg, Dave 7 Gateview Ct. San Francisco, CA 94116 GOMEiERG@UCSFVMUCSF Graff, Michael 4652 Piper St, Fremont, CA 94538 770-1312IBM WET GRAFF@MLPVM2Programmer, IBM Green-Suskind,Linda G92lGC14PC Box 8009, Endicott,NY 13760 601-752-1172 SAA Procedures Lang. Interface Owner, IBM Gunning, Randy 1755 Grant St,2nd Floor #5863, Concord, CA 94520 675-4148 ADSE, Bankof America Hall, John662 Canyon Dr., Pacifica,CA 94944 477-5049Technical Analyst, Wells Fargo Bank Hassenplug, Sandra 1117 N. 15, Philadelphia, PA 19102 215-246-6273 Supr. Systems Programming, Towers Perrin Hawes, Bill 533Gleasondale Rd, Stow, MA 01775 508-568-8695 BIX:WAWES Heidenreich, Karen SLAC, 2575 Sand Hill Rd, Menlo Park, CA 94025 926-3962 KAREN@rsICVMProg. Analyst, SLAC Helffrick, Boone 1649S. Main St, Milpitas, CA 94053 408-265-1483 Software Developer, HPL Holland, Ray IBM ARC, 650 Harry Rd, San Jose, CA 95120 927-2637HOLLAND@ALMADEN IBM Jenkins, Jonathan 1250E. Arques Ave M/S 201, Sunnyvale, CA 94088 408-737-5019 AMDAHL!JUTS!JW50 Systems Prog., Amdahl Jenkins , Ted SLAC Bin 48, 2575 Sand Hill Rd, Menlo Park, CA 94025 926-4325 TMJRP@LACNM SLAC Johnson, Bill SLAC Bin 97, 2575 Sand Hill Rd, Menlo Park, CA 94025 326-2660WBJ@SLACVM SLAC Johnson, Tony PO Box 4349 Bin 71, Stanford, CA 94309 926-2278 TONYJ@LACVM Physicist,Boston Univ. Johnson, Vern 1250 E. Arques M/S 249, Sunnyvale, CA 94086 408-746-6993 Staff Design Engineer, Amdahl Corp. Johnston, Ted SLAC Bin 97, 2575 Sand Hill Rd, Menlo Park, CA 94025 926-2689TYJ@SLACVM Mgr,SLAC Kaminski, Peter 159 Los Trancos Circle,Portoh Valley, CA 94028 851-0927B1X:kaminski Software Designer, self Kearney, Kevin PO Box 532, Storrs, CT 06268 203-429-8402 President, Mansfield Software Keller , Bob 39861 Wyatt Lane, Fremont, CA 94538 770-1479System Programmer, Motorola Kelse-y, Mason 1121C Porter St, Vallejo, CA 94590 707-645-7195 C.S.E., Bank of America Kiesel, Peter 250 E. Fifth St, 4th Floor, Cincinnati, OH 45202 513-762-2618 Staff Instructor, IBM Munz, Paul SLAC, 2575 Sand Hill Rd, Menlo Park, CA 94025 y 1 I a6-2884 PL"KER(aSWOJML Physicist, SLAC

232 I,nngeveld, t4illy SLiC Bin 97, 2575 Sand Hill Rd, Menlo Park, CA 94025 327-4610 WGLPO9@SLACVM SUC Lt:ty I Hank 10420 Castine Ave, Cupertino, CA 95014 408-257-9076 HZlf.!KLFvrS' MzPVM2 Programmer, IBM Lichtenthal, Marvir: 4 Captain Dr., Emeryville, CA 94608 653-5211 Lichter, Stephen 65 E 55 St: New York, NY 10022 212-230-5132 DEVNYS@DALVMNYl Instr./Developer, IBM LC~:;;~ Conr,ie SLAC, 2575 Sand Hill Rd, Menlo Park, CA 94025 92c '2879 CAI.@SL,ACVM Mathematician, SLAC T,u !e-::.::I m , i?eter 447 Claremont Way, Menlo Park, CA 94025 358- 3050 [email protected] ludemann@mlpvm Adv. Analyst,IBM Luoh, Harry 1555 BergerDr, 3rd Floor GSA/DPC SanJose CA 95112 408-299-4301 System Programmer, Countyof Santa Clara Mantino, Mike 1442A Walnut St. Suite 412, Berkeley, CA 94709 523-2616 Mar, Dennis WR Church Computing Ctr, Code 0141, Monterey,CA 93943 408-646-2672 [email protected] S.tat./Prog. Naval PostGrd. School Marks, Brian IEM UK Laboratories, Winchester, England 44-962-841122 FAX 962-840092 Sr. Programmer, IBM Martin, Charlie SLAC Bin 97, 2575 Sand HillRd, Menlo Park, CA 94025 926-2260 CwM@sLAcV" System Programmer, SLAC Maru , Ken ji 1250 E. Arques, Sunnyvale, CA 94088 408-746-3299 Sys . Programmer, Amdahl NcClennan, John 1520 Page Mill Rd, MS33G, PaloAlto, CA 34304 855-3722 Programmer, IBM McGrath, Sean 638 66th St, Oakland, CA 94609 653-8387 [email protected]' Consultant, URSA MINOR McGuire, Rick G19/21A-l-E5 PO Box 9008, Endicott, NY 13760 607-752-1865 Advisory Programer, IBM Endicott Mehl, Jim PO Box 632,Los Gatos, CA 95031 408-927-1879 mehl@.com Programmer, IBM Meyer, Mike 3657 Ramona Circle, Palo Alto, CA 94306 853-6507 [email protected] Syst. Programmer, Digital Milsted, Neil 6300 N. River Road, Rosemont, IL 60018 708-969-4800 met!wrkgrp!NFNM Developer, Workstation Group Moraes, Roger 1555 Eerger Dr, GSA/DPC San Jose, CA 95112 408-299-4301 System programmer, Countyof Santa Clara Morrow, Mike 533 Parnassus Rm. U76, San Francisco, CA 94143 476-4525 Syst. Programmer, UCSF Nee, €hi-Mei 1555 Berger Dr.3rd Floor,Bldg.#2, San Jose CA 95112 408-299-4301 System Programmer, Countyof Santa Clara Ng, May CCS, 253 Evans, UCB, Berkeley, CA 94720 642-5025 CSVMN@UCBCMSA User Services Consult., UC Berkeley Nguyen , Xuan 1555 Berger Dr, San JQSe, CA 951.12 408-299-4381 Programmer AnalystIV, Santa Clara County Noakes, Michael 99 Pacific St. Suite 155A, Monterey, CA 93940 408-655-4000 3547PFNAVPGS.BITNET Sys.Prog,De€. Manpower DataCtr. 0' Hara, Robert 1 Rogers St, Cambridge,MA 02142 617-252-5275 [email protected] Sys. Arch., Lotus Dev. Corp. Oppenheim, Larry 236 W. Portal, Ste. 347, San Francisco, CA 94127 585-1.009 Consultant, Penguin Computing Orr, Sid 405 El Camino REal #411,, Menlo Park, CA 94025 856-5405 SORR@SLACVM Software Engr, SLRC Pachl, Walter IBM Austria,00/705 Cobdenq.2,-. ViennaA 1010 43-1-222-211454420 PACHLVABWl Developer, IBM Payton, Brian 5104 Westmont Ave. #9, San Jose, CA 95130 408-357-9004PAYTON@MLPVM2 Programmer, IEM Phillips, Russell. 4558 Osai Loop, Union City, CA 94587 471.-0215System Programmr, Tesseract Schlage Lock Robin, David 100 Half Da.y Rd, Lineolnshire, IL 60069 708-295-5000 Consultant, Hewitt Associates Rockowitz, Sanford 1373 S. Mayfair Ave, Daly City,CA 94015 755-4570 ROCK@SUCV~., mer, MinaretSoftware Rogers, Sara PO Box 532, Storrs, CT 06268 203-429-8402 Srqqort Staff, Mansfield Software Fmthacker, Frank SLkC. Bin 88, 2575 Sand Hill Rd, Menlo Park, CA 94025 926--2624 r;'RrzrrJI<@LAC\?~I SLAC Schmidt, Denise 3118 S. 15th St, Omaha, NE 68130 402-333-4385 MC1:362-2229 Independent Ccnsultant Snawder, Paul 1555 Berger- Ex, Bidg.2, San Jose,CA 95112 408-299-4301 Sr. Syst-ems Prog. County of Santa Clara Spadafora, John 29 Hartwell P;iie, Lexington, MA 02173 517-860-6241 BIX,JSPADAFO%(A Programter Analyst, BIX Spencer, Randal 2728 Sheldon Dr., El Sobrante, CA 94803 222-7595 spence.r@bix Stevens , Kevin 160 Caldecott Lane #124, Oakland, CA 94618 649-0479 BIX Icevinestevens Network Admin, Heals Health Plan Sturak , Tamara CCS, 271 Evans, UC Berkeley, Berkeley, CA 94720 642-9123 tamara@ucbcmsa User Svs. Coord, UCB Style, Bernie 1800 Alexander BellDr, Reston, VA 22091 703-264-8362 Sr. Syst. Arch., Systems Center Thompson, Marshall SGC, 2575 SardHill Rd, Menlo Park, CA 94025 926-4231PJIT@LACW Financial Analyst , SLAC Tsai, Raymond 1250 E. Arques Ave M/S 201, Sunnyvale, CA 94086 408-737-5123 Staff Systems Programmer, Amdahl. Corp. Tunkel , Jay fEM Corp.3600,lCOCI W' 51st St,Boca Raton FL 33432 407-443-5955 Advisory Proyra.mmer: IBN Corp. Tyree, Scott 125Q E. Arques M/S 201, Sunnyvale, CA 94088 408-746-4634 AMTI on WSHAKE Systems Programmer, Arndahl Van Herwijnen, Eric CERN, AS Division, Geneva, Switzerland CM-1211 41-22-7675087 ERIC@CERI*S\%. CERN . CH CERN Vigil, Peter 1250 E, Arques Ave. M/S 249, Sunnyvale, CA 94086 408-746-3493 Design Engr., Amdahl Corp. Vul,Alex Arndahl Corp,Slunnyvale, CA 94086 408-746-8596 amdahl!agv Software Engr, Amdahl Corp. Warnett, Martin 1420 Harbor Bay Pkky, #200, Alameda, CA 94501 769-4900Software Engineer, Software Pursuits, Inc. Watanabe, Gerry 5600 CottPe Rd A6O-029, SanJose, CA 95193 408-997-4279 Mgr, TRM Watts, Keith 1945 Washington St, #410, San Francisco CA 94109 775-8360Proprietor, Kilowatt Software Weeks, Bill SLhC Bin 97, 2575 Sand Hill Rd, Menlo Park, CA 94025 926-2909 WCW@SLACln4 Sys Prog . , SLAC Weinstein, Marvin SUC, 2575 Sand Hill Rd, Menlo Park, CA 94025 926-2214 NITf@STLIACWi SLAC Weissman, Jim 59 Echo Ave, Oakland, CA 94611-4307 396-6979 MCI-MAIL Wells FargoBank White, Beho SLAC Bin 97, 2575 Sand Hill Rd, Menlo Park, CA 94025 926-2907 BEB(?(SSUWA SLAC Winson, Alan 6 Admiral Dr. #437, Emeryville, CA 94608 653-2695 TDA on VMSHARE IndependentConsultant Winters, Joan SLAC Bin 97, 2575 Sand Hill Rd, Menlo Park, CA 94025 924-2530 [email protected] ScientificProgrammer, SLAC Witthaus, Ken SLAC Bin 61, 2575 Sand Hill Rd, Kenlo Park, CA 94025 926--2468KEN@LACVM Mathematician, SLaC A conference for velopers and users

All in the relaxed atmosphere of the Calvomia coas;

TO teceivefurther iqformation send a sev-adclressed stamped envelope to the address below. To make your reservation, sen

235