Pilotscript - rand function

Found something interesting when trying to generate a series of random integers using pilotscript: ceiling(rand()*@z). It sits within a component sitting in a subprotocol that is set to run to completion for each record. When I run this in test mode, so running the subprotocol with 1 record repeatedly I found that the same integers were being generated every time. This seems to be improper functioning of the rand() function. Any help would be appreciated with this