What about the filepool? And, ADDRESS COMMAND without CMDCALL makes that
MODIFY USER would not display any error message in case it fails.
Finally a real general REXX remark: when the user specifies extra
parameters, you throw them away, I always leave them. Even if I don't test
explicitely for an unexpected parameter, I think it is better to keep the
value and let a command called later complain, as opposed to letting the
end-user think his parameter was used. In your case:
SFSMODFY USER1 +100 VMSYS:
would make sense for a user of your exec, but VMSYS: is thrown away
So, instead of
ARG fspace blocks . '(' options
I'd code:
ARG fspace blocks '(' options
Here my brewing:
/* This exec is a frontend to MODIFY USER
+-----------------------------------------------------------+
! format: ! SFSMDFY filespace +nnn!-nnn <filepoolID> !
+-----------------------------------------------------------+
Parameters can be enetered in any order IF the filepoolID ends with a :
else the optional filepoolID must be placed later than filespace.
Written by: Kris Buelens IBM Belgium; KRIS at VMKBBR01 26 Nov 2008*/
address command
parse upper arg args '(' options '' user blocks pool
do while args<>''
parse var args arg args
select
when verify(left(arg,1),'+-')=0 then
if blocks='' then blocks=arg
else call ErrExit 5,'Duplicate value for blocks:' blocks 'and' arg
when right(arg,1)=':' then
if pool='' then pool=arg
else call ErrExit 5,'Duplicate value for filepool:' pool 'and' arg
when user='' then user=arg
when pool='' then pool=arg
Otherwise
call ErrExit 5,'Extraneous or duplicate parameter:' arg
end
end
if blocks='' then
call ErrExit 6,'Missing blocks, must be +nnnn or -nnnn'
if user='' then
call ErrExit 7,'Too few parameters: userid missing'
rc=0;say 'CMDCALL MODIFY USER' blocks 'FOR' user pool '('options
exit rc
ERREXIT: /* general errorexit routine */
parse upper source . . myname mytype . syn .
do i=2 to arg() /* give errormessages (if any) */
say myname':' arg(i)
end
Say 'Syntax:' myname 'filespace <filepool> +nnn!-nnn'
exit arg(1)
2008/11/25 Shimon Lebowitz <[EMAIL PROTECTED]>
> I agree, but since we are stuck with what we have, how about
> Alan's suggestion, a front end:
>
> SFSMODFY EXEC:
> /* REXX exec to front end MODIFY */
> /* Syntax: SFSMODFY <filespace> <blocks> */
> ARG fspace blocks . '(' options
> ADDRESS COMMAND 'MODIFY USER' blocks 'FOR' fspace '(' options
> EXIT RC
>
> Would that be easier to remember? :-)
> As a matter of fact, I think I will download it at work
> tomorrow ! (I hope I haven't made any mistakes in the syntax here)
>
> Shimon
>
--
Kris Buelens,
IBM Belgium, VM customer support