can anybody has c++ routine that takes total row count and generate random numbers in that range and should go to the output of the transformer. Or is there any other way to get it.....
for example: i got a total row count as 10000. I should be able to generate random numbers from 1 to 10000 which should be unique......should not be repeated. for example it may look
iam sorry......i donno regarding which stage u r talking. i cant see anything in the column metadata of this stage to select as random and to set the value.
No problem. It is a pain. I assume you have a Column Generator in your job? From the columns tab, highlight the field that is cycling. Using your mouse , double click the number to the right of the column name.
This should bring up the Edit Column MetaData window.
The bottom middle box should be properties. the Type List dropdown to the right of that should be set to cycle. Change it to random.
Add Limit as an available property. Set to 10000.
Select the help button if this is not as clear as an unmuddied lake.
one more thing.......i cant predict the row count.....i comes as an input to the column generator. so i cant set the limit manually.........how i solve this problem?
You can use a transformer to increment the value. Use initial value, rownum if it is server job, combination of partition number, initial value and rownum to get unique number in parallel job.
You have to provide the rowcount initially as a parameter to the job.
Pavan- The method you advised will create a sequential number. The OP is interested in random numbers.
May I ask why you need random numbers?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
If its just a few records, build a server job, load a hashed file and then re-load it into a flat file. Records are randomly distributed in a hashed file.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.