我经常编写和使用ISPF编辑宏。但是,在前台调用它们非常耗时。我可以使用Rexx程序通过批处理对PDS的所有成员或选择成员运行编辑宏吗?
答案 0 :(得分:1)
您可以使用图书馆管理功能。
您使用 LMINIT 获取要编辑的数据集的 DATA ID ,然后使用 LMOPEN < / strong>函数打开数据集。
尽管REXX可能是最简单的,但是上述操作可以用多种编程语言完成。
答案 1 :(得分:0)
这是一个编辑宏,它将针对PDS的所有成员运行另一个宏:
/*REXX - Edit macro to invoke the same macro against all members */
/* in the data set being edited. */
/* Syntax: */
/* ALLMEM macro prefix */
/* macro is the name of a macro to execute. If it */
/* is a program macro, remember to specify the */
/* exclamation point before the name. */
/* */
/* prefix is an optional prefix to use when selecting */
/* members to process. for example, ISR will */
/* process all members starting with ISR. */
/* */
/* Note that the macro which this calls can have an */
/* ISREDIT END or ISREDIT CANCEL in it to avoid the display */
/*------------------------------------------------------------------*/
Address 'ISPEXEC'
'ISREDIT MACRO (WORKMAC,PREFIX)'
'ISREDIT (DATA1) = DATAID'
'ISREDIT (THISONE) = MEMBER '
Address 'ISPEXEC' 'LMOPEN DATAID('data1') OPTION(INPUT)'
parse upper var prefix prefix .
member1=''
Do Until lmrc\=0
Address 'ISPEXEC' 'LMMLIST DATAID('data1') OPTION(LIST)',
'MEMBER(MEMBER1) STATS(YES)'
lmrc = rc
If lmrc = 0 ,/* if member name returned */
& member1\=thisone ,/* and it isn't this member */
& ( ,/* and prefix check is ok... */
prefix='' ,/* No prefix specified */
| substr(member1,1,length(prefix))=prefix,/* or prefix match*/
) Then
Do /* invoke edit with specified initial macro*/
Address 'ISPEXEC' 'CONTROL ERRORS CANCEL'
Address 'ISPEXEC' 'EDIT DATAID('data1')',
'MEMBER('member1') MACRO('workmac')'
Address 'ISPEXEC' 'CONTROL ERRORS CANCEL'
End
End
Address 'ISPEXEC' 'LMMLIST DATAID('data1') OPTION(FREE)'
Address 'ISPEXEC' 'LMCLOSE DATAID('data1')'
'ISREDIT DEFINE 'workmac' MACRO CMD'
If prefix='' ,/* No prefix specified */
| substr(thisone,1,length(prefix))=prefix, /* or prefix match*/
then
'ISREDIT 'workmac /* perform macro for this member */
可以在ISPF查看或编辑下使用,但可以批量使用,但你也可以在它对所有PDS运行宏时将其关闭并坐下来,这样就可以避免手动在每个成员上运行它。