ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Generating random caracters or digits

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Generating random caracters or digits

    hi everyone,

    Is there a function in cobol that could generate random caracters or digits, so I can use these random numbers & caracters as PASSWORDS for example?

  • #2
    Re: Generating random caracters or digits

    Couldn't you use a random number and associate that random number with its ASCII representation?

    I know nothing about COBOL, but this is how I would approach it if there isn't something built in.
    Your future President
    Bryce

    ---------------------------------------------
    http://www.bravobryce.com

    Comment


    • #3
      Re: Generating random caracters or digits

      Short Answer: No. In fact, I have never heard or used a language that had this as a built-in function/ability.

      With that said, you could probably create a couple of routines to call the CEERAN0 API and convert the data to an integer within a given numeric range and then subsequently use the value to access a series of numbers/letters within an array ;-)

      Search for CEERAN0 on this forum and on IBM's site. Note, that the last letter of the API name is a zero.

      Terry

      Comment

      Working...
      X