Advertisement

05.16.2008 at 02:49PM PDT, ID: 23409855
[x]
Attachment Details

Can anyone see an error on calculating the leap year days on my RPG program?

Asked by ststst in Programming for iSeries / AS400

Tags: ,

I have a subroutine to check if the day is leap year or not. OUr current program is not working.  Can someone read RPG and tell me why its not working?  The problem is, when it comes to the first day of the month, the program makes the date as the last date of the month +1.  IE  June 1, 2008 = May 32, 2008.

Here's what i can see regarding the leapyear.

 **************************************************
 * SUBROUTINE ... ##DATE                            
 **************************************************
C           ##DATE    BEGSR                        
 * Month 01..31  January                            
 *       02..28  February                          
 *       02..29  February -- every Leap Year        
 *       03..31  March                              
 *       04..30  April                              
 *       05..31  May                                
 *       06..30  June                              
 *       07..31  July                              
 *       08..31  August                            
 *       09..30  September                              
 *       10..31  October                                
 *       11..30  November                              
 *       12..31  December                              
 *                                                      
C           MO        LOKUPTABSMM    TABSDD         20  
C                     ADD  1         DA                
         
 * Leap Year                                            
C           *IN33     IFEQ *OFF                        
C           MO        IFEQ 02                          
C           YR        ANDEQ04                          
C           YR        OREQ 08                          
 C           YR        OREQ 12                
 C           YR        OREQ 16                
 C                     ADD  1         TABSDD  
 C                     MOVE *ON       *IN33    
 C                     ENDIF                  
 C                     ENDIF                  
  *                                            
 C           DA        IFGT TABSDD            
 C           DA        SUB  TABSDD    DA      
 C           MO        ADD  1         MO      
 C           MO        IFGT 12                
 C                     SUB  12        MO      
 C                     ADD  1         YR      
 C                     ENDIF                  
 C                     ENDIF                  
 C                     ENDSR                  

Thanks for your help!!!
ST                                                                                                            Start Free Trial
 
Keywords: Can anyone see an error on calculatin…
 
Loading Advertisement...
 
[+][-]05.16.2008 at 08:23PM PDT, ID: 21587872

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.17.2008 at 04:50PM PDT, ID: 21591125

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Programming for iSeries / AS400
Tags: IBM AS400, RPG
Sign Up Now!
Solution Provided By: _b_h
Participating Experts: 4
Solution Grade: A
 
 
[+][-]05.19.2008 at 03:32AM PDT, ID: 21596418

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 08:17AM PDT, ID: 21598519

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 11:39AM PDT, ID: 21600366

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.19.2008 at 01:17PM PDT, ID: 21601159

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 01:27PM PDT, ID: 21601268

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 01:51PM PDT, ID: 21601463

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 02:05PM PDT, ID: 21601596

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 02:15PM PDT, ID: 21601684

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 02:38PM PDT, ID: 21601845

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 02:45PM PDT, ID: 21601901

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 08:34AM PDT, ID: 21607174

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 09:43AM PDT, ID: 21607940

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 12:10PM PDT, ID: 21609271

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 12:46PM PDT, ID: 21609675

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 12:54PM PDT, ID: 21609747

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 01:48PM PDT, ID: 21610206

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 02:33PM PDT, ID: 21610570

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 03:06PM PDT, ID: 21610779

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 03:20PM PDT, ID: 21610864

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 03:45PM PDT, ID: 21610953

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 01:25AM PDT, ID: 21612974

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 09:12AM PDT, ID: 21616521

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 12:07PM PDT, ID: 21618036

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628