On Nov 17, 2012, at 08:50, Adrian Stern wrote:
> Well I don't know that allocate, free is necessarily a problem for a batch
> job - but could be perhaps
>
And here I have to differ. Here's an EXEC that creates 20
UNIX members, then 20 PDS members by allocating and
freeing each. (Is there any way to do the latter in Rexx
outside ISPF?)
/* Rexx */ signal on novalue; /*
Doc: compare PDS with UNIX file performance.
Doc: Likely limited by ALLOCATE/OPEN/CLOSE/FREE overhead.
*/
trace N
RC = SYSCALLS( 'ON' )
address 'SYSCALL'
DIR = 'TEMP.PERFORM'
'umask 022'
call time( 'R' )
'mkdir' DIR 777
say 'RETVAL from mkdir is' RETVAL
do J = 1 to 20
MEM = DIR'/MBR'right( J, 3, 0 )
'open (MEM)' O_WRONLY+O_CREAT+O_TRUNC 666
Desc = RETVAL
L.1 = 'This is file ' MEM'15'x
'write' Desc 'L.1'
'close' Desc
end J
say 'Elapsed time for HFS is' time( 'R' )
trace N
DSN = userid()'.TEMP.PERFORM'
address 'MVS'
call time( 'R' )
RC = BPXWDYN( 'alloc rtddn(DD) space(1000) block(1000) dir(50)' ,
'new catalog dsn('DSN') msg(WTP)' )
RC = BPXWDYN( 'free dd('DD') msg(WTP)' )
do I = 1 to 20
MEM = 'MBR'right( I, 3, 0 )
RC = BPXWDYN( 'alloc rtddn(DD) shr dsn('DSN'('MEM') msg(WTP)' )
L.1 = 'This is member' MEM
'EXECIO 1 DISKW' DD '(finis stem L.'
RC = BPXWDYN( 'free dd('DD') msg(WTP)' )
end I
say 'Elapsed time for PDS is' time( 'R' )
The results (most favorable to PDS of a handful of tries):
Elapsed time for HFS is 0.075489
Elapsed time for PDS is 12.067157
An overhead factor of 150 or so is a powerful argument against
allocating individual PDS members. (Or an argument for using
z/OS UNIX files rather than legacy data sets.)
(Is there any way to get CPU time in Rexx?)
-- gil