REXX Chi PDF
REXX Chi PDF
Script Language
高珍
g
gaozhen2005@gmail.com
@g
章节内容
9.1 系统脚本语言概述 9.3 高级REXX
9.1.1 CLIST语言简介 9.3.1 执行宿主命令
9.1.2 REXX语言简介 9.3.2 执行JCL作业
9.1.3 USS的SHELL简介 9.3.3 /
与ISPF/ISPF编辑器的交互接口
9.2 REXX详解 9.3.4 与MVS控制台的交互处理
9.2.1 REXX特性 9.3.5 与TCP/IP的交互处理
9.2.2 REXX调用 9.3.6 与USS交互处理
9.2.3 REXX基本语法 9.3.7 对ISPF会话的使用
9.2.4 函数和子过程 9.3.8 对ISPF编辑宏的使用
925
9.2.5 REXX数据解析 939
9.3.9 与其他的IBM产品
9.2.6 程序调试 9.4 总结
参考资料
IBM红皮书
皮书
z/OS TSO/E REXX Reference (SA22-7790-
05)
z/OS TSO/E REXX User’s
User s Guide (SA22
(SA22-
7791-01)
ISPF Services Guide (SC34-4819-03)
( )
ISPF Edit and Edit Macros (SC34-4820-03)
第一节 系统脚本语言REXX概述
本节目标
Designed
g by
y Mike Cowlishaw
1979-1982, IBM Hursley Labs, UK
Using feedback from over 300 users on VNET
Designed to make the act of programming easier
Intended uses:
Personal programming
Tailoring user commands
Macros
Prototyping
Applications
Now runs on many vendors platforms
运行平台
All of IBM's platforms:
VM - where REXX first appeared (1983)
OS/2
AIX
VSE
OS/390 TSO (1988)
z/OS TSO ISPF
Chosen as SAA Procedural Language in 1987
Also available on many non-IBM platforms:
Tandem,VAX,
Tandem VAX Amiga
Several UNIX versions (including Linux)
Windows (Object REXX from IBM)
NetRexx
N tR
REXX特点
特点
Command procedures
Personal programming
Application initiation
Application prototyping
Application programming
Common macro language for varied applications
ISPF Edit macros, ISPF Dialogs, NetView
CICS, DB2, QMF
Other vendor products
Interpreted
p d versus
sus Compiled
o p d
Interpreter:
Translates and executes each program statement as it
runs
Compiler:
Translates the entire program once into machine
language
Then could be link
link-edited
edited into load module
Then the user runs the program
学习
学习REXX
Lectures
L t
Checkpoint exercises
Labs - write programs and ask questions
Public domain program REXXTRY
Samples and interactive exercises
Manuals
Concepts
o p soof REXX
Readability
Natural data typing
Emphasis on symbolic manipulation
Dealing
D li with
ith reality
lit
Nothing
g to declare
System independence
一个简单的REXX程序
个简单的 程序
a = 'Cat';b = 'Dog';c = 17
Long instructions may be continued onto multiple lines by using a comma (,) as a
continuation character:
Indentation is supported for readability. REXX does not care about indentation:
If a = b Then
Say "a
a and b are equal.
equal "
Else
Say "a and b are not equal."
变量
A symbol which represents some value within a program. The
value is substituted in place of the variable when the program
executes.
A variable's value may be different each time the program runs.
The value may be changed during program execution.
In REXX, variable names:
May be up to 250 characters long.
May consist of letters, numbers, and some implementation
specific
ifi special
i l characters
h t (i TSO
(in TSO: @ # $ ! ? _ . c )).
May not begin with a number or a period.
Are not case sensitive.
Examples:
input
p _pparms tel@num
var1 name.a
a value$
line.1 zdate
变量
The size of the variable value is platform dependent, often
li it d only
limited l bby th
the amountt off available
il bl memory.
"28
28 f4 Ab 1C094710
1C094710"X
X
'C13487FFA3D'x
'10010010110111'b
"1100 0001 0111 1011"B
Examples:
Say 7 * 3 + 4 Say 2 ** 3 ** 2
Say 7 + 3 * 4 Say 2 ** (3 ** 2)
Say 7 - 3 + 4 Say -5 + 6
Say 7 + 3 - 4 Say -5 + 6 * 2
Say 3 ** 2 Say -(5 + 6) * 2
S
SAY指令
指令
Syntax:
Say expression
where expression is any combination of REXX literals,
variables, functions, or arithmetic.
Each Say instruction displays on a separate line
line.
Examples:
Syntax:
y
Trace option
where option is the trace option to put into effect.
Useful options:
N Normal (default)
O Off
R Results
I Intermediates
REXXTRY程序
程序
Having
g completed
p this unit,, you
y should be able to:
Execute REXX execs under TSO
Discuss REXX variables and constants
Understand how REXX performs arithmetic
Describe the REXX concatenation operators
Use basic REXX instructions
Learn basic REXX data parsing techniques
第三节 REXX程序逻辑
本节目标
Doubling
g an operator
p character forces strict comparison
p
Always character comparisons, never numeric
Just match the bytes, one by one
Leading/trailing blanks are included
Example:
A
Automatically
t ti ll performed
f d if b
both
th tterms can b
be
recognized as numbers
Within Numeric Fuzz value (default is 0)
Examples:
Syntax:
Do While logical
expression
p
..loop instructions..
End
Example:
var1 = 12
Do While var1 > 6
Say var1
var1 = var1 - 1
End /* Do While */
Do
o Until
U t 循环
Syntax:
Do Until logical expression
..loop instructions..
End
Example:
E l
var1 = 1
Do Until var1 > 6
Say var1
var1 = var1 + 1
End /* Do Until */
Controlled
o o d Repetitive
p Loop
oop
Syntax:
Do cntlvar = init To final By incr For maxloops
where:
cntlvar is the loop control variable name
init is
i th
the iinitial
iti l value
l assigned
i d tto th
the control
t l variable
i bl
final is the final value the control variable will accept
incr is the amount by which the control variable is
incremented
maxloops is the absolute maximum number of times the loop
will execute.
Example:
p
Do i = 1 To 100
/* these instructions will execute while
the value of the variable i changes
f
from 1 to 2 to 3 to 4 ... to 100 */
End
其他循环结构
Loop a specific number of times:
Do 5
..instructions..
End //* Do 5 */ /
Loop forever:
Do Forever
..instructions..
instructions
End /* Forever */
避免 GO TO
O 语句
After completing
p g this unit,, you
y should be able to:
Understand the differences between functions and
subroutines
Discuss REXX built-in
built in functions
Understand the differences between internal and
external routines
Code internal
inte nal and e external
te nal functions
f nctions
Code internal and external subroutines
函数的概念
A program or routine that returns a value to the calling
program
The returned value is a single string
The returned value replaces the function call, so functions
almost never stand alone
Syntax:
functionname(argument1,argument2,...)
Example:
parm = "This is the parameter."
n = Words(parm)
函数的种类
Internal
Built-in
External
TSO/E / external
Your own REXX code
Programs in other languages
Search order:
Internal
REXX Built-in
TSO/E External
Function Packages
Programs in other languages
External
E t lE
Execs and
d CLISTS
内置函数
Syntax:
Example:
x = Substr('abcdefg',3)
x = Substr('abcdefg',3,4)
x = Substr('abcdefg',3,7,'!')
比较函数
Center() / Centre()
Copies()
Format()
Justify()
L ft()
Left()
Right()
Space()
Strip()
转换函数
Easy:
y place
p as members of a PDS concatenated to
//SYSEXEC or //SYSPROC
Routine name limited to PDS member naming rules
Return keyword instruction same as Exit
External routines maintain separate variable pools
Internal routines can protect variables with Procedure
keyword instruction
子过程的返回值
Trace ?
Pauses at each instruction:
Press enter to continue
type
t " " to
"=" t re-execute
t llastt clause
l
type anything else - Like REXXTRY -
process line immediately
Trace n - skip n pauses (n is a whole number)
Other Debug
O ug Aids
ds
Having
g completed
p this unit,, you
y should be able to:
Discuss program design and coding style
Use the Trace instruction
Use the Signal instruction
Understand other debugging aids
Write error-handling routines
第六节 高级REXX I
6.1 执行宿主命令
6.2 复合变量和数据栈
6.3 高级数据分析
本节目标
Host command
Host command environment
Expression
F ilit tto switch
Facility it h environments
i t
宿主命令环境
TSO
ISPEXEC
ISREDIT
CONSOLE
MVS
LINK/ATTACH
APPCMVS
Can come with a product
Can write your own
TSO命令环境
TSO commands
From TSO Reference manual
From REXX/MVS Reference manual
IDCAMS commands
RACF commands
RMM (sub)commands
HSM commands
IPCS (sub)commands
TCP/IP commands
Start ISPF command
Other products commands
User written tools and programs
CLISTs and REXX execs
How to Create TSO Commands
For example:
If ddname = "SYSUT1" and dsn = "INPUT.DATA" and running
under userid DEES525 then:
"alloc dd("ddname") dsn(" userid() || "." ||dsn ") shr"
will produce
alloc dd(SYSUT1) dsn( DEES525.input.data ) shr
Note the imbedded blanks that are allowed by TSO
检查返回码
Compound
p variables
Arrays
OUTTRAP
Data stack
Reading and writing datasets
复合变量
Compound variable = stem.tail
Where
stem. corresponds to the array name
tail corresponds to the index
It is the p
period ... that matters
numeric tail > an array
stem. = default initial value for all
Variable substitution on the tail
Can have multiple tails
/* simple example of compound variables */
month. = "no such month" /* initialize month array */
month.1 = "January"
month.2 = "February"
month.3 = "March"
say month.1 January
say month.2 February
say month.99 no such month
say month.march no such month
循环语句中的复合变量
Arrays
do i = 1 to 999
say array_row.i
end i
Access information by key (tail)
Output from
Subroutine
OUTTRAP
EXECIO
SYMBOL("stem.tail")
SYMBOL( stem.tail ) tells you if exists
Tails
s as
s Indexes
d s
Tail does not have to be numeric
Lik the
Like th index
i d off a VSAM KSDS
Clever ways to store and access data
Potential for imaginative programming
Example:
population.Germany = 81000000
population.France = 58000000
population.Italy = 58000000
locale.Germany
l l = "De_DE.IBM-1047"
1047
localemodule.France = "EDC$FFEY"
if symbol("localemodule."country) \= "VAR" then
Say
y locale for this country
y not available
SYMBOL()
S O () 函数
state
t t = SYMBOL(
SYMBOL(name))
Pass to SYMBOL() the name of what might be a
variable(compound or not)
Returns:
BAD Name is not a valid symbol
LIT Literal, or unassigned variable
VAR Variable has value assigned
Remember that REXX does variable substitution on the
pa amete
parameter
OU
OUTTRAP
Trap
p TSO command outputp > compound
p variables
You choose the stem: for example, using LINE. (below)
Usually regarded as a function
CALL OUTTRAP "LINE
"LINE.""
"TSO command"
CALL OUTTRAP "OFF"
OU
OUTTRAP的使用
的使用
Turn trapping on, issue command, turn off
Then you have the following variables:
line.0 - "zero"th variable = number of elements/variables
in the
array
line.1 - contains the first line
line.2 - contains the second line ............
Example:
call outtrap "line."
"lista status" /* TSO command to list allocations
*/
call outtrap "off"
do i=1 to line.0; say line.i; end i
OU
OUTTRAP什么时候起作用?
什么时候起作用
"EXECIO
EXECIO * DISKR SYSUT1
SYSUT1"
"EXECIO * DISKR" ddname "(STEM LINE."
'EXECIO 1 DISKW FOGGY ((STEM record.'
'EXECIO 0 DISKW FOGGY (FINIS'
'EXECIO 0 DISKW FOGGY (OPEN FINIS'
Other Features
O u so of EXECIO
O
What is parsing?
Sources of data
Structure of the templates
Parsing
s g
Parsing
g templates
p work well with data in
columns
Data from COBOL programs
IDCAMS DCOLLECT output
RACF database unload utility output
Parse pull 5 dcurctyp +1 . //* record type */,
/,
13 dcutime +4 /* smf time */,
17 dcudate +4 . /* smf date */,
25 dcddsnam +44 . /* dataset name */
本节总结
Having
g completed
p this unit,, you
y should be able to:
Issue host commands from a REXX program
Use advanced data manipulation instructions
Understand parsing
第七节 高级REXX II
7.1 REXX与ISPF及ISPF编辑器的接口
7.2 REXX与MVS控制台的交互处理
73
7.3 REXX与MVS宿主命令环境
7.4 REXX与其他主机产品的交互
本节目标
ISPEXEC
ISREDIT
CONSOLE
LU62,
LU62 CPICOMM
CPICOMM, APPCMVS
MVS,, LINK,, ATTACH (7)
( )
ISPEXEC
S C 宿主命令环境
Application Programming Interface (API) to the services of
ISPF
Approximately 100 services to:
Display panels, pop-ups
Manipulate datasets and member lists
Similar to ISPF options 3.4, 3.3 and 3.2
Table services
Variables
File tailoring
ISREDIT宿主命令环境
S 宿主命令环境
API to the services of the ISPF Editor
Approximately 100 services to do everything the ISPF Editor
can do
Find, change
Insert data
Move lines
Shift data
Sort data
Submit it jobs
CO SO 宿主命令环境
CONSOLE宿主命令环境
Provides the ability to issue MVS operator (console)
commands,
d and d gett bbackk the
th commandd responses
MVS commands including:
DISPLAY commands, for example, D A,L
CANCEL
FORCE
MODIFY
SET,
SET VARY
START, STOP
MVS宿主命令环境
NetView
CICS
IMS
DB2
QMF
Q
REXX compiler
Pipes
REXX和NetView的交互
和 et e 的交互
REXXCICS Default
CICS CICS commands (for example: SEND, RECEIVE)
EXECDB2 DB2 commands (DISPLAY)
EXECSQL SQL statements (SELECT) to the CICS/DB2
interface
EDITSVR Edit session
FLSTSVR y
Commands for the File List Utility
RFS Commands for the REXX File System
RLS Commands for the REXX List System.
CICS Features
u s
Complements
C l t th
the IMS utility
tilit
Similar function to COBOL programs
PSB defined as Assembler or COBOL
The following example puts the segment into the variable
called Part_Segment:
PartNum = "250239"
250239
DB = "DBPCB01"
SSA = 'PARTROOT(PARTKEY =
'||L ft('02'||P tN
'||Left('02'||PartNum,17)||')'
17)||')'
Address REXXTDLI "GU DB Part_Segment SSA"
REXX Interface Support
uppo
The following
g functions are pprovided:
Call tracing of DL/I calls, status, and
parameters
Inquiry of last DL/I call
Extensive data mapping
PCB specification by name or offset
Obtaining and releasing storage
Messaging through WTO, WTP, WTL, and
WTOR
REXX 环境
Current environments:
MVS
Not available:
TSO
ISPEXEC
ISREDIT
New environments:
REXXTDLI
REXXIMS
REXX 编译器
Compiler for SAA REXX/370, 5695-013
Library for SAA REXX/370, 5695-014
CEXEC or load modules
Improved
p p
performance and reliability
y
Syntax check of all source
Code hidden from users
SH19-8160
SH19 8160 IBM Compiler and Library for SAA REXX/370
User's Guide and Reference
编译器的输出
|...+....1....+....2....+....3....+....4....+....5....+....6
----- Simple Variables -----
DELIBERATENOVALUE SIMP VAR 66
DIGITS SIMP VAR 7(s) 11 11(s) 15 21 30
ERROR SIMP VAR 66
FACTORIAL SIMP VAR 34(s) 38(s) 38 41 42
FIRST SIMP VAR 7(s) 8 8(s) 12 16 16(s) 16 18 39
HERE SIMP VAR 66
I SIMP VAR 37(s) 38 39 41 48
LAST SIMP VAR 7(s) 9 9(s) 13 16 19 37
LINE SIMP VAR 44(s) 45
OVER_LINES SIMP VAR 43(s) 46
PARM_WITH_PROBLEM SIMP VAR 62(s) 63 64 65
PARSENUMERIC SIMP VAR 31(s) 32
PARSESOURCE SIMP VAR 28(s) 29
PARSEVERSION SIMP VAR 22(s) 23 27
REQUESTED SIMP VAR 66
编译方法
%COPYRIGHT
%INCLUDE
%PAGE
Placed inside comments
解释和编译的区别
Hardly any problems
SOURCELINE() - use option SLINE
TRACE - use option TRACE
"PARSE VERSION" can be used to detect compiled/interpreted
P f
Performance testing:
t ti
SYSVAR("SYSCPU")
SYSVAR("SYSSRV")
SmartBatch
Stage
g commands are combined into a ppipeline
p
Pipelines usually included in REXX
New stage commands can be written using
REXX
BatchPipeWorks Stage Commands总结
The followinggp
pages
g contain a summary y of
BatchPipeWorks Stage Commands
A complete description and advice on use, can be found
in the reference manual and user's guide.
g
本节总结
8.1 REXX执行JCL作业
8.2 REXX程序与其他语言程序的交互
8 3 REXX与TCP/IP的交互处理
8.3
8.4 REXX与USS交互处理
本节目标
After completing this unit, you should be able to:
Customize the logon process and ISPF for REXX
Interface REXX programs with programs written in
other languages
Use REXX with TCP/IP
REXX and UNIX Services
More
o about
ou Rexx under
u d TSO
O
ALLOCATE,, FREE,
, LISTALC
PROFILE WTPMSG MSGID PREFIX
TIME, SEND, TRANSMIT, RENAME
CALL, TSOLIB
EXEC
EXECUTIL
PRINTDS, SMCOPY
Reference manual for these commands
TSO/E Command Reference
HELP command for online information
启动 S
启动ISPF 应用程序
ISPF applications
pp may
y require
q the following
g allocations:
Profile ISPPROF
Panels ISPPLIB
Messages ISPMLIB
Tables, input ISPTLIB
Tables, output ISPTABL
Skeletons ISPSLIB
File tailoring output ISPFILE
User link libraries ISPLLIB
Images ISPILIB
REXX Execs SYSEXEC
CLISTs SYSPROC
SYSEXEC & SYSPROC
Address ispexec
"SELECT CMD(rexxexec parms) NEWAPPL(appl)
PASSLIB"
使用REXX e
使用 exec启动ISPF程序
ec启动 S 程序
ALTLIB for the REXX exec library
LIBDEF for each ISPF library (as necessary)
Select service
Remove LIBDEFs
Remove ALTLIB
EXIT
Error recovery labels and code
ALTLIB DISPLAY和ISPLIBD
C
Can construct
t t th
the commands
d
Cannot trap the output: OUTTRAP does not work on HSM
commands
Can process HSM reports with Rexx
DCOLLECT provides HSM data
REXX和DFSMSrmm
和 S S
Full support
Construct commands
Do not need to trap the output: results come back in
variables
SYSAUTH EDGDATE = "E"
SYSAUTH.EDGDATE E
/* tell RMM to use variables */
REXX和CLIST的对比
和C S 的对比
WRITENR
Darsing and verification of parameters
Global variables
REXX提交JCL作业
提交JC 作业
TSO SUBMIT command
Editor SUBMIT command
EXECIO to internal reader
FTP to another system
C
Console
l command d tto submit
b it via
i start
t t
Other products have submit feature
Pass your constructed job to the ISPF Editor and let the user
submit it
it.
REXX创建JCL作业
创建JC 作业
Obvious method:
Construct JCL lines on data stack, or in REXX
variables
EXECIO to temporary dataset or internal
reader (INTRDR)
TSO SUBMIT command on temp dataset
Better method:
Use ISPF File Tailoring Services
REXX替换JCL作业
替换JC 作业
Can use:
Assembler, COBOL, PL/1, C, FORTRAN
Must support 31-bit addressing
Load
L d module
d l in
i standard
t d d MVS searchh order
d
Interfacing with REXX execs:
On entry:
Environment Block
External Function Parameter List
Before exit your program must:
R15 = 0
Result put in Evaluation Block
Many Assembler samples on the Web
函数包
Program
g in another language
g g can invoke REXX
Gives access to parsing from other
language
Exec can be declared in the program
Tighter change control
IRXEXEC - Exec processing routine
IRXRLT - get result routine
数据栈的访问
Applications
pp can have a mixture of REXX execs and
TSO CLISTs, even in the same PDS
Assist with conversion from CLIST to REXX
If CLISTs are performing the required function,
function there
is no need to convert
REXX和TCP/IP
和 C /
Netstat
FTP
Socket programming
NETSTAT
BSD UNIX
Server
Client
Socket
S k t API
REXX can participate!
p p
SOCKET()
O ()
Four ways
y to invoke REXX under UNIX System
y
Services
TSO/E
Native batch
Shell
From a program
Shell
S e 或 Program
og a
Default environment = SH
SYSCALL automatically available
TSO is not available
Runs as a UNIX process
In HFS file
TSO
SO 或 Native
at e Batch
atc
Having
H i completed
l d this
hi unit,
i you should
h ld bbe able
bl to:
Customize the logon process and ISPF for REXX
Interface REXX programs with programs written in
other languages
/
Use REXX with TCP/IP
REXX and UNIX Services
第九节 高级REXX IV
9.1 REXX对ISPF会话的使用
9 2 REXX对ISPF编辑宏的使用
9.2
本节目标
What is ISPF?
IBM courses
Dialog
g elements
Starting a dialog
ISPF services
Models
Return codes
Diagnostics
Batch
ISPF介绍
S 介绍
What is a Dialog?
Dialog elements
Dialog functions
Can
C b
be written
itt iin REXX
Not all ISPF applications
pp use p
panels
Dialog
og Elements
s of
o Interest
s
DISPLAY
DISPLAY, ADDPOP
ADDPOP, REMPOP
REMPOP, TBDISPL
For example: using REXXTRY
ADDRESS ISPEXEC
"DISPLAY PANEL(ISRUTIL)"
You may terminate this display with
Enter rc=0
PF3 rc=8
变量的支持
PDF 服务
FTOPEN
FTINCL
FTCLOSE
FTERASE
其他服务
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
ISPF Primary Option Menu
Option ===>
PGM
PGM=IKJEFT1A
IKJEFT1A
Requires many //ISP* allocations
Use temporary
p y datasets whereever you
y can
ISPSLIB, ISPPROF
Use:
ISPSTART ........ TRACE
//ISPLOG DD SYSOUT=*
Your exec can have parameters
Note continuation using - (hyphen) for TSO
Running COMPCAT in the Background
//ISPFFT EXEC PGM=IKJEFT1A,DYNAMNBR=128
//*
//SYSEXEC DD DISP=SHR,DSN=&PREFIX..ISPF.EXEC
//**** DD DISP=SHR,DSN=SYS2.COMMON.ISPEXEC
,
//ISPPLIB DD DISP=SHR,DSN=SYS2.COMMON.ISPPLIB
//ISPMLIB DD DISP=SHR,DSN=SYS2.COMMON.ISPMLIB
//ISPSLIB DD DISP=SHR,DSN=&&ISPSLIB
//****ISPLLIB DD DISP=SHR,DSN=SYS2.COMMON.ISPLOAD
//ISPTLIB DD DISP=SHR,DSN=&PREFIX..ISPF.ISPTLIB
DISP=SHR DSN=&PREFIX ISPF ISPTLIB
// DD DISP=SHR,DSN=SYS2.COMMON.ISPTLIB
//ISPTABL DD DISP=SHR,DSN=&PREFIX..ISPF.ISPTLIB
//ISPFILE DD DSN=&PREFIX..SCRATCH.TARGET.ISPFILE,
// DISP=(MOD,CATLG),UNIT=SYSALLDA,
// SPACE=(TRK,(5,10,20)),
// DCB=(LRECL=255,BLKSIZE=0,RECFM=VB)
//*
//ISPPROF DD UNIT=VIO,DISP=(NEW,DELETE),SPACE=(TRK,(1,5,5)),
// DCB=(LRECL=80,BLKSIZE=6160,DSORG=PO,RECFM=FB)
//ISPLOG DD SYSOUT=*,
// DCB=(LRECL=120,BLKSIZE=2400,DSORG=PS,RECFM=FB)
//*
//SYSTSIN DD *
PROFILE NOPREFIX
ISPSTART CMD(COMPCAT -
MASK=P%%% START=P020 NUMBER=20 STATE=NSW QLD) -
NEWAPPL(ISR) TRACE BDISPMAX(20)
//SYSTSPRT DD SYSOUT=*,DEST=P060
//SYSLBC DD DSN
DSN=SYS1.BRODCAST,DISP=SHR
SYS1 BRODCAST DISP SHR
//SYSPRINT DD SYSOUT=*
//SYSTERM DD DUMMY
//SYSIN DD DUMMY
ISREDIT
S 宿主命令环境
Recognized
g by
y the Editor,, on the Edit command line
Do not use the ISPF command TSO
Arguments are not received by:
ARG
PARSE ARG
ARG()
Editor has its own mechanism:
ADDRESS ISREDIT
"MACRO
MACRO (parm1
(parm1, parm2)
parm2)"
编辑宏举例
/* REXX exec to edit VPS printer definition members.*/
signal
i l on novalue
l
address isredit
"macro" /* parm does not work when initial macro from edit service */
"(memvar) = member"
if rc\=0
\ 0 then
h signal
i l error /* query member
b f
failed
il d */
address ispexec
"vget statlst shared"
if rc\=0 then signal error /* vget failed */
grpname = '?'
address isredit
upper statlst
"find ' grpname=' first"
if rc=4
4 th
then signal
i l cannot_do_it
t d it /* no group name */
if rc\= 0 then signal error
"(currow,curcol) = cursor"
"(line) = line .zcsr"
if rc\=0
\ 0 th
then signal
i l error
parse upper var line " GRPNAME=" grpname "," .
编辑宏命令