× 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.



For those who have yet to discover it, _the_ place for VARPG advice is the
IBM newsgroup for VARPG.  You can link to it from within the product I
think.

Great developer support and many very experienced users.  Lots of examples
of coding to Windows APIs for a variety of functions.


Jon Paris


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of
rpg400-l-request@xxxxxxxxxxxx
Sent: Friday, March 11, 2005 11:17 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: RPG400-L Digest, Vol 4, Issue 286


Send RPG400-L mailing list submissions to
        rpg400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.midrange.com/mailman/listinfo/rpg400-l
or, via email, send a message with subject or body 'help' to
        rpg400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
        rpg400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of RPG400-L digest..."


Today's Topics:

   1. Re: Random number in VARPG (Booth Martin)
   2. RE: UDATE question (Fisher, Don)
   3. RE: AW: Random number in VARPG (Booth Martin)
   4. RE: UDATE question (Bob Cozzi)
   5. RE: UDATE question (Wilt, Charles)
   6. Re: Dates in POI Sql2Xls (Beppe Costagliola)
   7. RE: UDATE question (JFeador@xxxxxxxxxx)
   8. RE: UDATE question (JFeador@xxxxxxxxxx)


----------------------------------------------------------------------

message: 1
date: Fri, 11 Mar 2005 10:01:46 -0600 (Central Standard Time)
from: "Booth Martin" <booth@xxxxxxxxxxxx>
subject: Re: Random number in VARPG

I understood the issue and was trying to stay with a VARPG-only solution as
I felt that you wanted this to be a learning exercise for you, too.

As I read the question I sensed, probably wrongly, that you were duplicating
my early algorithm of trying to use the green screen cycle for an event
driven program.



---------------------------------
Booth Martin
http://www.martinvt.com
---------------------------------
-------Original Message-------

From: RPG programming on the AS400 / iSeries
Date: 03/11/05 00:19:11
To: RPG programming on the AS400 / iSeries
Subject: Re: Random number in VARPG

Booth,

the randomization needs to be done _before_ he starts answering questions.
  This is the program flow I'm trying to create:

1-select which multiplication tables he wants to treat (presently 1
through 10) via check boxes
2-create all questions & answers in an array
3-randomize the array so that the questions are not ordered anymore
4-read through the array, ask questions & store the results
(correct/wrong)

As I said earlier, step 2 is so quick that the array is filled within a
few milliseconds, resulting in many duplicate timer values.

Thanks anyway,

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




"Booth Martin" <booth@xxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
10/03/2005 16:49
Please respond to RPG programming on the AS400 / iSeries


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


VARPG has a timer part.  Perhaps you could use the timer?  The timer
sample
has a bouncing VARPG, but if you made that an image and he clicked the
image
to get a new question....  Then use the timer value???  I think the timer
value is 1000 ticks per second.



---------------------------------

Booth Martin

http://www.martinvt.com

---------------------------------



--
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.


.

------------------------------

message: 2
date: Fri, 11 Mar 2005 11:02:54 -0500
from: "Fisher, Don" <Dfisher@xxxxxxxxxxxxxxxxx>
subject: RE: UDATE question

Easiest way to subtract a certain number of days from the current date is
the following:
EVAL OneTwentyDaysAgo =
     %DATE() - %DAYS(120)

OneTwentyDaysAgo would be a date field in this case.

UDATE doesn't give you today's date all the time.  It gives you the date on
which the job began.

Hope that helps.

Donald R. Fisher, III
Project Manager
Roomstore Furniture Company
(804) 784-7600 extension 2124
DFisher@xxxxxxxxxxxxx

<clip>
List:
        This should be easy, but I can't figure it out. I checked the RPGILE
.PDF with no luck. I am getting an error when I put UDATE into a field I've
defined as a date data type. I then want to do a   SUBDUR  120:*D on it.
What I need to be able to do is subtract 120 days from today's date. How
would you do this? I know this is probably a common thing to do.
<clip>


------------------------------

message: 3
date: Fri, 11 Mar 2005 10:05:18 -0600 (Central Standard Time)
from: "Booth Martin" <booth@xxxxxxxxxxxx>
subject: RE: AW: Random number in VARPG

One thought I had is that if he decides to build the project as a Java
project, will these Windows-only add-ons travel well?

---------------------------------
Booth Martin
http://www.martinvt.com
---------------------------------
-------Original Message-------

From: RPG programming on the AS400 / iSeries
Date: 03/11/05 08:50:51
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: AW: Random number in VARPG

download mysql....free is a good price =)

Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of
Peter.Colpaert@xxxxxxxxxx
Sent: Friday, March 11, 2005 12:22 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: AW: Random number in VARPG


Booth,

I've only got the DVD, but anyway, I doubt that DB2 will run smoothly on
his 350MHz machine...

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




"Booth Martin" <booth@xxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
10/03/2005 17:29
Please respond to RPG programming on the AS400 / iSeries


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


If you have the CDs for VARPG you probably also have the CD for DB2 for
PCs.




---------------------------------

Booth Martin

http://www.martinvt.com

---------------------------------

-------Original Message-------



From: RPG programming on the AS400 / iSeries

Date: 03/10/05 07:35:30

To: RPG programming on the AS400 / iSeries

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@midrange
com>

        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.





..
--
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.



--
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.
--
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.


.

------------------------------

message: 4
date: Fri, 11 Mar 2005 10:08:44 -0600
from: "Bob Cozzi" <cozzi@xxxxxxxxx>
subject: RE: UDATE question

UDATE? What's that? Isn't this 2005?

D  JobDate        S             D   Inz(*JOB)
Or
D  Today          S             D   Inz(*SYS)
D ThreeMonthsAgo  S             D

C          Today    SubDur      120:*DAYS    ThreeMonthsAgo




-Bob Cozzi
www.RPGxTools.com
If everything is under control, you are going too slow.
- Mario Andretti


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of John Furniss
Sent: Friday, March 11, 2005 9:23 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: UDATE question

List:
        This should be easy, but I can't figure it out. I checked the RPGILE
.PDF with no luck. I am getting an error when I put UDATE into a field I've
defined as a date data type. I then want to do a   SUBDUR  120:*D on it.
What I need to be able to do is subtract 120 days from today's date. How
would you do this? I know this is probably a common thing to do.
        Thanks,

John Furniss
Allied Machine & Engineering Corp.
iSeries Application Programmer
Phone (330) 343-4283 Ext. 8371
email: jfurniss@xxxxxxxxxxxxxxxxx

--
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.






------------------------------

message: 5
date: Fri, 11 Mar 2005 11:07:54 -0500
from: "Wilt, Charles" <CWilt@xxxxxxxxxxxx>
subject: RE: UDATE question

The problem is UDATE doesn't return a date data type.

Use %date() for the current system date.

Additionally, note that UDATE returns the job date, not the system date.
You probably want the system date, so use the %date() above.  If you really
want the job's date, which never changes even when the job runs after
midnight, use %date(UDATE:*MDY).

HTH,

Charles Wilt
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121


> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of John Furniss
> Sent: Friday, March 11, 2005 10:23 AM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: UDATE question
>
>
> List:
>       This should be easy, but I can't figure it out. I
> checked the RPGILE .PDF with no luck. I am getting an error
> when I put UDATE into a field I've defined as a date data
> type. I then want to do a   SUBDUR  120:*D on it. What I need
> to be able to do is subtract 120 days from today's date. How
> would you do this? I know this is probably a common thing to do.
>       Thanks,
>
> John Furniss
> Allied Machine & Engineering Corp.
> iSeries Application Programmer
> Phone (330) 343-4283 Ext. 8371
> email: jfurniss@xxxxxxxxxxxxxxxxx
>
> --
> 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.
>
>



------------------------------

message: 6
date: Fri, 11 Mar 2005 17:10:59 +0100
from: "Beppe Costagliola" <beppecosta@xxxxxxxx>
subject: Re: Dates in POI Sql2Xls

... but for Time fields we should use a different approach.

Excel cannot handle time alone, it converts the time
to a datetime format, so if we had, say, 12:01:00 PM
HSSF converts that into java.sql.time, 12/31/1899
12:01:00 using
double excelDate = HSSFDateUtil.getExcelDate((Time)cellValue);
theCell.setCellValue(excelDate);

Since HSSF does not handle dates prior to 1/1/1900 it
puts a bad date (-1).

Therefore convert the time to string and setting the
time format.

....
D usrFmtTime      S             24    Inz('h:mm:ss')
....
// ... Time
when  SQLTYPE = 388 or SQLTYPE = 389;
....
setCellValStr(cell:tstring);         // set cell value
setCellStyle(cell:styleTime);        // set to time
....


----- Original Message -----
From: "Beppe Costagliola" <beppecosta@xxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Friday, March 11, 2005 1:10 PM
Subject: Re: Dates in POI Sql2Xls


Bob,
you can try to modify the sql2xls to handle dates in this way:

 * Style (date m/d/yy ) ----------------------------------------------
D styleDate       S               O   Class(*JAVA
D                                     :'org.apache.poi.hssf.usermodel-
D                                     .HSSFCellStyle')

D usrFmtDate      S             24    Inz('m/d/yy')
D styleFmtDate    S              5I 0

D Cell_Date       S               D
D Xls_StartDate   S               D   inz(d'1900-01-01')


// create Date Style
styleDate   = createCellStyle(wb);

// create a DataFormatter, a User Format and set the Style for Date
df = createDataFormat(wb);
usrformat = createString(usrFmtDate);
usrformat = trimString(usrformat);
stylefmtDate = getFormat(df:usrformat);
setDataFormat(styleDate:stylefmtDate);

// ... Date
when  SQLTYPE = 384 or SQLTYPE = 385;
  Cell_Alfa = *blanks;
  Cpybla(%addr(Cell_Alfa): SQLDATA: 10);
  if Cell_Alfa = *blanks and not wrt0cell;
    // do nothing
  else;
    cell = createCell(row:c-1);
    Cell_Date = %date(Cell_Alfa:*DMY);
    setCellType(cell:0);                 // type 0=Numeric
    cell_int = %diff(Cell_Date:Xls_StartDate:*D) + 2;
    setCellValNum(cell:Cell_Int);
    setCellStyle(cell:styleDate);        // set to date
  Endif;

Regards.
--
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.



------------------------------

message: 7
date: Fri, 11 Mar 2005 08:14:03 -0800
from: JFeador@xxxxxxxxxx
subject: RE: UDATE question

If you want to use UDATE in a date type field -- You can MOVE it in....

This works fine...

d ddate           s               d
c                   move      udate         ddate
c                   eval      *inlr=*on


Jerry L. Feador
Senior Programmer / Analyst
(HISNA) Hyundai Information
              Services, North America
(949) 595-5810


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of John Furniss
Sent: Friday, March 11, 2005 7:23 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: UDATE question


List:
        This should be easy, but I can't figure it out. I checked the RPGILE
.PDF with no luck. I am getting an error when I put UDATE into a field I've
defined as a date data type. I then want to do a   SUBDUR  120:*D on it.
What I need to be able to do is subtract 120 days from today's date. How
would you do this? I know this is probably a common thing to do.
        Thanks,

John Furniss
Allied Machine & Engineering Corp.
iSeries Application Programmer
Phone (330) 343-4283 Ext. 8371
email: jfurniss@xxxxxxxxxxxxxxxxx

--
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.


------------------------------

message: 8
date: Fri, 11 Mar 2005 08:14:29 -0800
from: JFeador@xxxxxxxxxx
subject: RE: UDATE question

Funny Bob!


Jerry L. Feador
Senior Programmer / Analyst
(HISNA) Hyundai Information
              Services, North America
(949) 595-5810


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Bob Cozzi
Sent: Friday, March 11, 2005 8:09 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: UDATE question


UDATE? What's that? Isn't this 2005?

D  JobDate        S             D   Inz(*JOB)
Or
D  Today          S             D   Inz(*SYS)
D ThreeMonthsAgo  S             D

C          Today    SubDur      120:*DAYS    ThreeMonthsAgo




-Bob Cozzi
www.RPGxTools.com
If everything is under control, you are going too slow.
- Mario Andretti


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of John Furniss
Sent: Friday, March 11, 2005 9:23 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: UDATE question

List:
        This should be easy, but I can't figure it out. I checked the RPGILE
.PDF with no luck. I am getting an error when I put UDATE into a field I've
defined as a date data type. I then want to do a   SUBDUR  120:*D on it.
What I need to be able to do is subtract 120 days from today's date. How
would you do this? I know this is probably a common thing to do.
        Thanks,

John Furniss
Allied Machine & Engineering Corp.
iSeries Application Programmer
Phone (330) 343-4283 Ext. 8371
email: jfurniss@xxxxxxxxxxxxxxxxx

--
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.




--
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.


------------------------------

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) digest 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.



End of RPG400-L Digest, Vol 4, Issue 286
****************************************




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.