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



No he wants to do the following:

 /free

     wResults = CalcDiff(wDate1 : wDate2 : *DAYS);
     wResults = CalcDiff(wDate4 : wDate5 : *MONTHS);

 /end-free

p CalcDiff        b
d CalcDiff        pi              10i 0
d   date1                            d
d   date2                            d
d   fmt                             ??????????

 /free
    
    return %diff(date1:date2:fmt);

 /end-free


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 Peter Dow
> Sent: Tuesday, February 15, 2005 1:02 PM
> To: RPG programming on the AS400 / iSeries
> Subject: Re: PROTOTYPING - What type of data are values as 
> *MONTH, *DAY, *SYS
> 
> 
> Hi Igor,
> 
> It sounds like you want to pass the value "*MONTH" to your 
> procedure; if
> that's the case, put it in quotes like this:
> 
>     getInnerPeriodLength(d1,d2,d3,d4,'*MONTH')
> 
> If you don't, the compiler assumes that you are referring to 
> the keyword
> *MONTH which is the month from the job date and has a data type packed
> decimal, 2.0.
> 
> hth,
> Peter Dow
> Dow Software Services, Inc.
> 909 793-9050 voice
> 909 793-4480 fax
> 951 522-3214 cell
> 
> 
> 
> ----- Original Message ----- 
> From: <Igor.Beslic@xxxxxxxxxxxx>
> To: <rpg400-l@xxxxxxxxxxxx>
> Sent: Tuesday, February 15, 2005 1:59 AM
> Subject: PROTOTYPING - What type of data are values as 
> *MONTH, *DAY, *SYS
> 
> 
> Hello!
> 
> Please, can somebody explain me what are exactly *MONTH, *DAY, *SYS,
> *YEAR, *OMIT, *NOPASS etc. values?? Where are they stored when program
> runs??
> 
> I have subprocedure that does some time calculations. I would 
> like to pass
> optional parametar to it (*MONTH,*DAY,*YEAR) but if I pass it as in PI
> (10A) builtin function wont accept it because it has no same parametar
> type. I wonder is there any way to make call to 
> getInnerPeriodLength on
> this way getInnerPeriodLength(d1,d2,d3,d4,*MONTH).
> 
> Here is te code (for now I just *DAYS):
> 
> 
>      P getInnerPeriodLength...
>      P                 B                   EXPORT
>      D getInnerPeriodLength...
>      D                 PI             5P 0
>      D  dateZStart                     D
>      D  dateZEnd                       D
>      D  dateKStart                     D
>      D  dateKEnd                       D
>      D  resultUnit                   10A   OPTIONS(*NOPASS) VALUE
>      D  checkWildCard  S               N   inz(*off)
> 
>       /free
> 
>         If dateZEnd<dateZStart;
>            return 0;
>         EndIf;
> 
>         If dateKEnd<dateKStart;
>            return 0;
>         EndIf;
> 
>         If %Parms()>4;
>            checkWildCard=*ON;
>         EndIf;
> 
> 
>         Select;
> 
> 
>           WHen dateZStart>dateKStart AND dateKEnd>dateZStart
>                AND dateKEnd<dateZEnd;
>                return %Diff(dateKEnd:dateZStart:*DAYS)+1;
> 
> 
>           WHen dateZStart<dateKStart AND dateKEnd<dateZEnd;
>                return %Diff(dateKEnd:dateKStart:*DAYS)+1;
> 
> 
>           WHen dateZStart<dateKStart AND dateKEnd>dateZEnd;
>                return %Diff(dateZEnd:dateKStart:*DAYS)+1;
> 
> 
>           WHen dateZStart>dateKStart AND dateKEnd>dateZEnd;
>                return %Diff(dateZEnd:dateZStart:*DAYS)+1;
> 
>           Other;
>                return 0;
>         EndSl;
> 
>       /end-free
>      P                 E
> 
> Thank you!
> 
> Igor Bešlić, dipl. ing. rač.
> Zelinska 2, 10000 Zagreb
> tel: +385 1 6326422
> -- 
> 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.
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 2/14/2005
> 
> 
> 
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 2/14/2005
> 
> 
> -- 
> 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 ...

Follow-Ups:

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.