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_n_string( dist_zip, 4,4) ; /* create zip */strcat(dist_zip, "11111");dist_tax = rand_decimal(0, 2000,4);dist_YTD = 30000.00;numBytes = sprintf(Buffer, fmtDist,next_o_id,dist_tax,dist_YTD,dist_name,dist_street_1,dist_street_2,dist_city,dist_state,dist_zip,dist_num,ware_num);rc = GenericWrite(&hnd, Buffer, numBytes);if (rc != 0) { goto dist_done; }} /* end for... */} /* end for... */rc = GenericClose(&hnd);dist_done:}timestamp2 = current_time();elapse = timestamp2 - timestamp1;if (rc == 0) {if (!quiet_mode) {fprintf(stdout,"\nDISTRICT table generated in %8.2f seconds.\n\n",elapse);fflush(stdout);}} else {fprintf(stderr,"\nDISTRICT table FAILED at (W %d D %d) after %8.2f seconds.\n\n",ware_num,dist_num,elapse);fflush(stderr);}/*----------------------------------------------------------------------*//* generate customer table *//*----------------------------------------------------------------------*/void gen_cust_tbl( void ){sqlint32 ware_num = 0 ;sqlint32 dist_num = 0 ;sqlint32 cust_num = 0 ;char cust_last[17];char cust_middle[3];char cust_first[17];char cust_street_1[21];char cust_street_2[21];char cust_city[21];char cust_state[3];char cust_zip[10];char cust_phone[17];char cust_credit[3];char cust_data[501];char cust_since[27];double cust_discount;double cust_balance;double cust_YTD_payment;double cust_credit_lim;IOH_NUM numBytes;ioHandle hnd;char Buffer[1024];int len, pos;timestamp1 = current_time();rc = GenericOpen(&hnd, outtype1, outname1);if (rc != 0) { goto cust_done; }strcpy(cust_middle, "OE");createTimestampString(cust_since);for (cust_num = 1; cust_num

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

Saved successfully!

Ooh no, something went wrong!