× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Random number ?
  • From: dmosley@xxxxxxxxxx
  • Date: Tue, 24 Apr 2001 15:43:34 -0400


Here's a simple service program I created for generating (up to) a 20 byte
character password, using the TIME opcode.
Just replace make the necessary mods, and it should work fine for you...

Hope it helps,
dav


h nomain
 *_______________________________________________________________*
 * -- Prototype descriptions...
 * ---- Generate Password...
d @genPassWord    pr            20a

 * ------------------------------------------------------------- *

 * -- Global Variables...
d nums            c                   '0123456789'
d logic#0         c                   'GH3IK4MN5P'
d logic#1         c                   'A9C8E7G6I5'
d logic#2         c                   '9B8D7F6H5J'
d logic#3         c                   'ZY1WV2TS3Q'
d logic#4         c                   'G1IJ2LM3OP'
d logic#5         c                   'MNB2CX3ZAL'
d logic#6         c                   'L7J6GFDS4Q'
d logic#7         c                   'PO08YT76WQ'
d logic#8         c                   'P4AOK9INUH'
d logic#9         c                   'QWSX1DC2FV'
 * -- Data Structures...
d password        ds            20    inz
d  password@14                  14a
d  password@06                   6a
 * ---- Time Stamp...
d time@stamp@a    ds
d  timestamp                    14s 0 inz
d   utime@hms                    6a   overlay(timestamp)
d    utime@sec                   1a   overlay(utime@hms:6)
d   udate@mdcy                   8a   overlay(timestamp:7)


 *****************************************************************
 * Module      : @genPassWord                                    *
 * ------------------------------------------------------------- *
 * Description : Generate a Password and return to caller...     *
 * ------------------------------------------------------------- *
 * Parm Description    Description            Size    Required   *
 * -- Pass In Parms  : *none                                     *
 * -- Pass Out Parms : *none                                     *
 * -- Return Value   : new Password            20a               *
 *****************************************************************
p @genPassWord    b                   export
d                 pi            20a

c                   clear                   password
c                   time                    timestamp
c                   eval      password@14 = time@stamp@a
c                   eval      password@06 = utime@hms

c                   select
c                   when      utime@sec = '0'
c     nums:logic#0  xlate     password      password
c                   when      utime@sec = '1'
c     nums:logic#1  xlate     password      password
c                   when      utime@sec = '2'
c     nums:logic#2  xlate     password      password
c                   when      utime@sec = '3'
c     nums:logic#3  xlate     password      password
c                   when      utime@sec = '4'
c     nums:logic#4  xlate     password      password
c                   when      utime@sec = '5'
c     nums:logic#5  xlate     password      password
c                   when      utime@sec = '6'
c     nums:logic#6  xlate     password      password
c                   when      utime@sec = '7'
c     nums:logic#7  xlate     password      password
c                   when      utime@sec = '8'
c     nums:logic#8  xlate     password      password
c                   when      utime@sec = '9'
c     nums:logic#9  xlate     password      password
c                   endsl

c                   return    password
p                 e
 *****************************************************************



David L. Mosley, Jr.
Systems Analyst
2000 CentreGreen Way
Suite 250
Cary, NC 27513




+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.