×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Would you really need an SQL database?  Many people use the 'dummy' file 
method when they don't need to.  For example

select current time into :myvar
from sysibm/sysdummy1

When they could do

values current time into :myvar

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/ic2924/info/db2/rbafzmstvalinto.htm#valinto

Granted, the example for RAND does use the dummy file method.

However (and I would use your own multiplication factor!) this works:
     D myRandNum       s             10i 0

     C/exec sql
     C+ values (rand() * 1000) into :myRandNum
     C/end-exec
      /free
       *inlr=*on;
       return;
      /end-free


Rob Berendt
-- 
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





Peter.Colpaert@xxxxxxxxxx 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
03/10/2005 08:34 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: AW: Random number in VARPG






Hi Brigitta,

I guess it is possible, but that brings me to a different problem, namely 
that I'd need an SQL database of some sort on his PC.

But I'll keep your suggestion in mind.

Thanks,

Peter Colpaert
Application Developer
Massive - Kontich, Belgium
-----
Yoda of Borg are we.  Futile is resistance, assimilated will you be.
-----




"HauserSSS" <Hauser@xxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
10/03/2005 14:22
Please respond to RPG programming on the AS400 / iSeries

 
        To:     "RPG programming on the AS400 / iSeries" 
<rpg400-l@xxxxxxxxxxxx>
        cc: 
        Subject:        AW: Random number in VARPG


Hi Peter,

is it possible to use embedded SQL in VARPG?
If so you could determine a random number with embedded SQL.

Birgitta



-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.