13.07.2015 Views

IBM Flex System x240 w

IBM Flex System x240 w

IBM Flex System x240 w

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

create_random_a_string( ware_name, 6,10) ; /* create name */create_random_a_string( ware_street_1, 10,20) ; /* create street 1 */create_random_a_string( ware_street_2, 10,20) ; /* create street 2 */create_random_a_string( ware_city, 10,20) ; /* create city */create_random_a_string( ware_state, 2,2) ; /* create state */create_random_n_string( ware_zip, 4,4) ; /* create zip */strcat(ware_zip, "11111");ware_tax = rand_decimal(0, 2000,4);ware_YTD = 300000.00;numBytes = sprintf(Buffer, fmtWare,ware_name,ware_street_1,ware_street_2,ware_city,ware_state,ware_zip,ware_num);ware_tax,ware_YTD,rc = GenericWrite(&hnd, Buffer, numBytes);if (rc != 0) { goto ware_done; }} /* end for */rc = GenericClose(&hnd);ware_done:}timestamp2 = current_time();elapse = timestamp2 - timestamp1;if (rc == 0) {if (!quiet_mode) {fprintf(stdout,"\nWAREHOUSE table generated in %8.2f seconds.\n\n",elapse);fflush(stdout);}} else {fprintf(stderr,"\nWAREHOUSE table FAILED at (W %d) after %8.2f seconds.\n\n",ware_num, elapse);fflush(stderr);}/*----------------------------------------------------------------------*//* generate dist table *//*----------------------------------------------------------------------*/void gen_dist_tbl( void ){sqlint32 ware_num = 0 ;sqlint32 dist_num = 0 ;char dist_name[11];char dist_street_1[21];char dist_street_2[21];char dist_city[21];char dist_state[3];char dist_zip[10];double dist_tax;sqlint32 next_o_id;double dist_YTD;IOH_NUM numBytes;ioHandle hnd;char Buffer[1024];next_o_id = CUSTOMERS_PER_DISTRICT + 1;timestamp1 = current_time();rc = GenericOpen(&hnd, outtype1, outname1);if (rc != 0) { goto dist_done; }for (ware_num = ware_start; ware_num

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

Saved successfully!

Ooh no, something went wrong!