Results 1 to 6 of 6

Thread: How to validate date

  1. #1
    Code400 Newbie
    Join Date
    Mar 2006
    Location
    Delhi
    Posts
    19
    Rep Power
    0

    How to validate date

    How to validate date in RPG400? Is there any opcode, especially in RPG/400 not in ILE.

  2. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

  3. #2
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,416
    Rep Power
    12606

    Re: How to validate date

    there has always been the TEST opcode. But If your talking RPGIII and not RPG400 then this wont work.


    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  4. #3
    Analyst JonBoy's Avatar
    Join Date
    Jun 2005
    Location
    Mississauga, Ontario, Canada
    Posts
    392
    Rep Power
    1894

    Angry Re: How to validate date

    Quote Originally Posted by jamief
    there has always been the TEST opcode. But If your talking RPGIII and not RPG400 then this wont work.


    jamie
    Um - Jamie - RPG/400 _is_ RPG III.

    There is no native way to test (or do anything else with) real dates in RPG III (RPG/400) - iSeries network in it's previous guise of News/400 published a series of date routines by Paul Conte under the title "The last Date Routines You'll Ever Need" or something very similar. Try searching the www.iSeriesNetwork.com and see if they are still there. Google might find them somewhere too.

    Why on earth is ANYONE writing code in RPG III. What a total bloody waste of time and energy.

  5. #4
    Sr. Product Specialist FaStOnE's Avatar
    Join Date
    Nov 2005
    Location
    Phoenix, AZ
    Age
    51
    Posts
    2,611
    Rep Power
    3993

    Re: How to validate date

    He's BAAAAaaaaAAACK...

    -Rick

    _____________________________

    Need a Managed File Transfer Solution -OR- iSeries Encryption?
    GoAnywhere and Crypto Complete by Linoma Software


  6. #5
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,416
    Rep Power
    12606

    Re: How to validate date

    I didnt know that I thought RPG400 was with the extended factor one and factor two making the source files 112 instead of the RPGIII which was a length of 92. Im not saying thats correct Im just saying thats what I thought.

    I agree with the waste of time statement I cant even remember how to use a limits file.

    code would look something like this.....remember leap year......and youll have to add logic for # of days by month. I didnt do that this is just a very simple example
    PHP Code:
    RPG400/RPGIII

         I            DS
         I                                        1   80WKDAT8
         I                                        1   20WKCENT
         I                                        3   40WKYEAR
         I                                        5   60WKMNTH
         I                                        7   80WKDAY
          
    *
         
    C           WKDAT8    IFEQ *ZEROS
         C                     MOVEL
    'Y'       ERROR
         C                     
    ENDIF
          *
         
    C           WKCENT    IFNE 19
         C           WKCENT    ANDNE20
         C                     MOVEL
    'Y'       ERROR
         C                     
    ENDIF
          *
         
    C           WKDAY     IFGT 31
         C                     MOVEL
    'Y'       ERROR
         C                     
    ENDIF
          *
         
    C           WKYEAR    IFEQ *ZEROS
         C                     MOVEL
    'Y'       ERROR
         C                     
    ENDIF
          *
         
    C           WKMNTH    IFGT 12
         C                     MOVEL
    'Y'       ERROR
         C                     
    ENDIF
          *
         
    C                     MOVE *ON       *INLR
          
    *-----------------------------------------------------
          *  
    INDATE 8 CCYY/MM/DD
          
    *-----------------------------------------------------
         
    C           *INZSR    BEGSR
         C           
    *ENTRY    PLIST
         C                     PARM           INDATE  8
         C                     PARM           ERROR   1
          
    *
         
    C                     MOVE INDATE    WKDAT8  80
          
    *
         
    C                     ENDSR 

    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  7. #6
    Analyst JonBoy's Avatar
    Join Date
    Jun 2005
    Location
    Mississauga, Ontario, Canada
    Posts
    392
    Rep Power
    1894

    Re: How to validate date

    Quote Originally Posted by jamief
    I didnt know that I thought RPG400 was with the extended factor one and factor two making the source files 112 instead of the RPGIII which was a length of 92. Im not saying thats correct Im just saying thats what I thought.
    RPG400 was introduced with the AS/400 back in 1988. It was nothing more than RPG III from the S/38 with a couple of minor quirks.

    Between 1988 and V3R1 (whenever that was - 1994?) a small number of extra features were added to the langauge but nothing much.

    With V3R1 IBM introduced RPG IV (aka ILE RPG) which has the 112 spec length and the extended factor 2 etc. While it was stupidly referred to as ILE RPG/400 in some quarters of IBM those of us involved in the launch always favored RPG IV for the simple reason that RPG IV programs do not have to be ILE programs. In fact, the vast majority (compiled with PDM 14 and standard defaults) are not really ILE programs at all but rather they are fake OPM programs.

    V3R2 introduced subprocedures and off we went!


    End of brief history lesson

  8. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

Facebook Comments


Similar Threads

  1. Difference between *OMIT and *NOPASS
    By emo in forum RPG/RPGLE
    Replies: 4
    Last Post: May 10th, 2008, 12:00 PM
  2. Retrieve system date from stored procedure
    By keanhoo168 in forum ANY THING GOES
    Replies: 3
    Last Post: February 13th, 2007, 11:05 PM
  3. date procedure example
    By jamief in forum ANY THING GOES
    Replies: 0
    Last Post: February 13th, 2007, 09:40 AM
  4. Need SQL help to convert/check date
    By snufse in forum SQL
    Replies: 6
    Last Post: December 28th, 2006, 09:48 PM
  5. File and dates
    By DeadManWalks in forum DB2
    Replies: 5
    Last Post: December 7th, 2006, 09:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •