13.07.2015 Views

IBM Flex System x240 w

IBM Flex System x240 w

IBM Flex System x240 w

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

** create a random numeric string, of random length between lo and* hi and place them in designated buffer. Routine returns the actual* length.** parameters* ----------* lo end of acceptable length range* hi end of acceptable length range** output* ------* actual length* random numeric string*****************************************************************************/int create_random_n_string( char *out_buffer, int length_lo, int length_hi ){int i, actual_length ;actual_length = rand_integer( length_lo, length_hi ) ;for (i = 0; i < actual_length; i++ ){out_buffer[i] = (char)rand_integer( 48,57 ) ;}out_buffer[actual_length] = '\0' ;return (actual_length);}/***************************************************************************** NUrand_val** create a non-uniform random numeric value of type integer, of random* value between lo and hi. Number is NOT placed in BUFFER, and IS* simply RETURNED.** Routine RETURNS the VALUE.** parameters* ----------* lo end of acceptable value range* hi end of acceptable value range** output* ------* random integer value RETURNED*****************************************************************************/int NUrand_val ( int A, int x, int y, int C ){return((((rand_integer(0,A)|rand_integer(x,y))+C)%(y-x+1))+x);}/***************************************************************************** create_a_string_with_original** create a random alphanumeric string, of random length between lo and* hi and place them in designated buffer. Routine returns the actual* length.** the word "ORIGINAL" is placed at a random location in the buffer at* random, for a given percent of the records.** percent_to_set must be an integer value from 0 to 100.* if 0, no records will be set. If 100, all records will be set.** CANNOT USE ON STRINGS OF LENGTH LESS THAN 8 ! LOWER LIMIT MUST BE > 8 !** parameters* ----------* lo end of acceptable length range* hi end of acceptable length range* percentage of records to set to ORIGINAL** output* ------* actual length

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!