> -----Original Message-----
> Behalf Of Richard Troth
> Sent: Friday, March 21, 2003 2:49 PM
>
> > Dave Jones of Sine Nomine has written an EXEC that will do
> > just what you want, in the guest's CMS startup phase:
> > http://www.sinenomine.net/downloads/SWAPGEN.EXEC
>
> Mr. Nit Picky sez that Jones' EXEC does exactly the right thing.
> <snip>
> -- RMT
I humbly offer a minor code simplification/performance tweek to
SWAPGEN.EXEC. <ramble>It doesn't change the outcome one speck, and thus
probably isn't worth changing since it isn't an exec that's called a
zillion times a day. But it's all I've got to offer tonight - please
forgive if this is impertinent. In more frequently used code and/or
longer strings, this change would be more worthy of consideration.
Somewhat more consequential than my LCD-on-a-toaster idea.</ramble>
swap_blk = ''
do i = 1 to 1027
swap_blk = swap_blk || d2c(0)
end
can be replaced with...
swap_blk = left('',1027,'00'x) /* pad-->1027 */
and similarily:
do i = 1033 to 4086
swap_blk = swap_blk || d2c(0)
end
can be replaced with...
swap_blk = left(swap_blk,4086,'00'x) /* pad-->4086 */
And at this time of night, I haven't much self control, so I can't help
but offer...
swap_blk = ''
do i = 1 to 1027
swap_blk = swap_blk || d2c(0)
end
pages = trunc((blks * 512)/4096) - 1
swap_blk = swap_blk || d2c(1)
swap_blk = swap_blk || d2c(pages,4)
do i = 1033 to 4086
swap_blk = swap_blk || d2c(0)
end
swap_blk = swap_blk || sig
could be reduced (at great risk of obfuscation) to...
swap_blk = left(right('01'x || d2c(trunc((blks * 512)/4096) -
1,4),,
1032,'00'x),,
4086,'00'x) || sig
/* geez I hope I coded that right! */
-jcf
Code tweeked while-u-wait.
No charge for Rexx.