Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Convert Date

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Convert Date

    Ron, Maybe this example will help D iso_date s d D date80 s 8 0 D date60 s 6 0 D* C eval date80 = 1001229 C* now date80 = 01001229 C *cymd move date80 iso_date C* now iso_date = '2000-12-29' C *mdy move iso_date date60 C* now date60 = 122900 C* C eval *inlr = *on The field 'eddate' having the value 20000703 is different that the *cymd date formats I have been used to working with. I thought *cymd date formats were cyymmdd. Even though the value may be in a 8 position field.

    Comment


    • #17
      Convert Date

      Ron, make sure that only one copy of the program exist on your library list. You may be running the wrong program.

      Comment


      • #18
        Convert Date

        Joe, When I break at c *ISO move eddate workdate Values are: *IN10 = '0' EDDATE = 20000713 Workdate = 01/01/40 Then I press F10 to step It bypasses the 'z-add 1 to X' line and brings me to the 'MOVe *ON *INLR' line. The values there are: *IN10 = '0' EDDATE = 20000713 Workdate = 01/01/40 The joblog below doesn't show any problem. CHGJOB LOG(4 00 *SECLVL) LOGCLPGM(*YES) strdbg testdate call testdate dspjoblog

        Comment


        • #19
          Convert Date

          Alan's suggestion is a good one. Do a DSPJOB and an option 11 to check your call stack and make sure you're calling the program you think you are. There is no reason a line should be skipped when stepping unless, as Barbara suggested, your program is not compiled. Do a DSPPGM on "test" and make sure it's been compiled recently. Check the source date to the date of the source in WRKMBRPDM. Joe

          Comment


          • #20
            Convert Date

            I checked. The pgm TESTDATE only lives in one library RKPGM30. I did a DSPOBJD and it was compiled on 12/29/00 at 12:30. I checked the stack & it is calling the one TESTDATE pgm that exists, as it shows in debug. RON

            Comment


            • #21
              Convert Date

              Ron, Don't be offended by this question but I think we've covered everything else! Is your "c z-add 1 x 1 0" actually commented out? Sometimes it's easy to overlook the * in column 7. Is your debug pointing to the correct source code? I don't know why your date logic is not working. It looks fine to me. Copy the date logic to another very simple RPG IV program and lose the file read and z-add and see if just the date logic works by itself. Chris

              Comment


              • #22
                Convert Date

                I tried a new program, same results. FEDCMON IF E DISK * D workdate S D datfmt(*MDY) c read edcmon c z-add 20000713 EDDATEX 8 0 c *ISO move eddateX workdate c move *ON *INLR When I stop debug on th "move *ON *INLR" line, I get the same results. WORKDATE= '01/01/40' EDDATEX=2000713.

                Comment


                • #23
                  Convert Date

                  One more for the mix! This worked for me: D DATE1 S D D DATE2 S D datfmt(*MDY) C *ISO MOVE 20000713 DATE1 C MOVE DATE1 DATE2 C EVAL *INLR = *ON C RETURN Result in DATE1 is 2000-07-13. Result in DATE2 is 07/13/00. Julie

                  Comment


                  • #24
                    Convert Date

                    I still get 01/01/40 in date2 ... ???

                    Comment


                    • #25
                      Convert Date

                      I just signed on to another AS/400 using the exact same code and the date works fine converting to mmddyy format. This sister company of ours is also in V4R3. Can there be anything in my system values that is set incorrectly??? Ron

                      Comment


                      • #26
                        Convert Date

                        I've added one line of code to yours. Compile with DEBUG specified in the "H" specs.
                         D workdate S D datfmt(*MDY) c read edcmon 10 c *ISO move eddate workdate c DUMP c z-add 1 x 1 0 c move *ON *INLR 
                        On the resulting dump, take a look at *IN10, EDDATE, and WORKDATE. Let us know what the values are. I have a gut feeling that *IN10 may equal '1'. Dave

                        Comment


                        • #27
                          Convert Date

                          I tried the dump but *in10 "was" = to off. However, I discovered the convert date is working, just the results in debug don't match up. Here is my code: 1 fprinter o F 132 Printer * 2 D date1 S D 3 D date2 S D datfmt(*MDY) 4 c *ISO Move 20000713 DATE1 5 c move date1 date2 6 c except prt 7 c move *ON *INLR 8 c return 9 OPRINTER E PRT 2 01 10 O DATE1 10 11 O DATE2 20 When I put break point on line 5, date1 says 0001-01-01, date2 says 01/01/40. I then single step, and the next line goes immediately to line 9, where date1 now says 07-13-00 and date2 still says 01/01/40. I then single step to line 10 and date2's value is now 7/13/00. It then steps to line 11 and then 8. I know you must be thinking I must be executing a different version of the program but I am POSITIVE I am executing the correct program. I have no idea why the step skips line 6 & 7 and doesn't display the correct value at the next line after the field is populated. I tried this program on another AS/400 and I did get the expected results in debug. I don't know what is wrong with my debug. I don't have this problem with other programs.

                          Comment


                          • #28
                            Convert Date

                            Rename the module you think you are executing and run the thing again. JAT bobh

                            Comment


                            • #29
                              Convert Date

                              I renamed the source & compiled, Then called the renamed program & still got the exact same bazaar results. RK

                              Comment


                              • #30
                                Convert Date

                                I would document the whole deal and go to IBM. Something is wrong. bobh

                                Comment

                                Working...
                                X