|
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
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.