Page 1 of 1

HOW TO GENERATE RANDOM SEQUENCE NO

PostPosted: Wed Oct 22, 2014 9:25 am
by Alan1208
H Team can you please help me in below requirement -->

Requirement ==>

Need to generate Random sequence no of 8 digits.

Constraints ==>
1. Every generated random seq no. should be greater than previous generated no (No duplicates as well).
2. It will not be one time run program, it will keep running every day to generate few random seq nos. Sequence no generated on any particular day should be greater than sequence no generated on previous days.

Can you please tell me if it possible by any function or 100% full proof is not there to generate random seq no with this constraint.

Thank you very much.

Re: HOW TO GENERATE RANDOM SEQUENCE NO

PostPosted: Wed Oct 22, 2014 10:29 am
by enrico-sorichetti
NO.
better review the whole approach.
what if at some time You get 99999999 ???

Why random? just use a sequence

Re: HOW TO GENERATE RANDOM SEQUENCE NO

PostPosted: Wed Oct 22, 2014 10:50 am
by Alan1208
Hi Enrico, Thanks you for your reply.
99999999 is the biggest no possible so if it will generate then it will be problem for us.

As of now we are generating this no sequentially only but recently one requirement came that is it possible to generate random seq nos. for different run. As this no is key for one of the KSDS file, we want to generate unique and in ascending order, something like this -->

XXXXXXXX00001237 --> May be on 21st OCT 14
XXXXXXXX00003456 --> May be on 21st OCT 14
XXXXXXXX00007891 --> May be on 22nd OCT 14
XXXXXXXX00234567 --> May be on 23rd OCT 14
I think it's not possible to keep random nos in sequence along with no duplicates. Can you please give me your view as well.

Thanks
Alan

Re: HOW TO GENERATE RANDOM SEQUENCE NO

PostPosted: Wed Oct 22, 2014 10:55 am
by enrico-sorichetti
I guess that my previous post expressed my point of view ;)

also from a logic point of view RANDOM clashes wit SEQUENCE

we want to generate unique and in ascending order,


so since sequence numbers are unique, and up to now You used sequence numbers
WHY CHANGE ?

Re: HOW TO GENERATE RANDOM SEQUENCE NO

PostPosted: Wed Oct 22, 2014 11:27 am
by Alan1208
Haha..Thanks again...yes I checked your "NO".. :) :)
Actually these nos are encryption of some other no. now if we keep it in sequence, main no can also be easily tracked..

But no problem I have got a work around for this.. :) :)

Re: HOW TO GENERATE RANDOM SEQUENCE NO

PostPosted: Wed Oct 22, 2014 11:46 am
by BillyBoyo
Random Numer 1
Random Numer 2
Random Numer 3


Known to be unique and ascending (trhough understanding on inspection). If someone wants to treat it as an ordinary sequence number, it is very, very easy.

To do work for something that can be "cracked" in 4/9th of a second, even without computer aid, is absurd, as enrico has been indicating.