Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Tips and Techniques: Date Values

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

  • Tips and Techniques: Date Values

    ** This thread discusses the article: Tips and Techniques: Date Values **
    ** This thread discusses the Content article: Tips and Techniques: Date Values **
    This is a discussion about Tips and Techniques: Date Values.

    Click here for the article.


  • #2
    Tips and Techniques: Date Values

    ** This thread discusses the article: Tips and Techniques: Date Values **
    No more ADDDUR! I know Bob has publicly announced his hatred of free format but you can use ADDDUR's replacement (The %DATE and %DAYS,%MONTH,%YEAR BIF's) just as easily in columnar RPG. It makes for more readable code and keeps everything looking nice.

    Comment


    • #3
      Tips and Techniques: Date Values

      ** This thread discusses the article: Tips and Techniques: Date Values **
      I prefer to write code that works back as far as possible when I do things for this column on other endevours. If IBM ever gets their act together with RPGIV and ships all enhances for a version verses a release, I will use the latest and greatest. But until then, I have to pick a reclease and stick with it.

      Comment


      • #4
        Tips and Techniques: Date Values

        ** This thread discusses the article: Tips and Techniques: Date Values **
        While I do applaud Bob for ecouraging people to write RPG modules to link with CL modules. I just wanted to point out one doesn't necessarily have to build RPG modules to do date manipulation. If the duration one is adding is calculable in days then one can use the CEExxx ILE date API's instead. I've been doing it for years and they work just as well. The only drawback is that CL can't yet deal with floating point numeric fields. A simple example follows:
        Code

        Comment


        • #5
          Tips and Techniques: Date Values

          ** This thread discusses the article: Tips and Techniques: Date Values **
          Bob Cozzi wrote: > I prefer to write code that works back as far as possible when I do > things for this column on other endevours. > > If IBM ever gets their act together with RPGIV and ships all enhances > for a version verses a release, I will use the latest and greatest. > But until then, I have to pick a reclease and stick with it. Why not just show both versions? Bill

          Comment


          • #6
            Tips and Techniques: Date Values

            ** This thread discusses the article: Tips and Techniques: Date Values **
            Good example Pete, I thought about using those APIs in this example, but they are bindable APIs and therfore require CLLE and do not work with regular CLP programs. The ADDDUR command works in both environments, hence my decision ot use the traditional CMD and CPP approach. Thanks! -Bob

            Comment


            • #7
              Tips and Techniques: Date Values

              ** This thread discusses the article: Tips and Techniques: Date Values **
              Bob- I installed and compiled on my AS400 running V4R5. i get the following result from the demo: Yesterday: 021705 Today: 021805 Tomorrow 021905 Next week: 021805 SBM: 02180 The next week is not working. I do not use RPGLE code that much so I am wondering if I messed something up. I did make a change to the RPGLE module name- my name is NSGADDDUR. I changed two lines in the code as I got a compile error- see below 0003.00 D NSGADDDUR PR 0007.00 D NSGADDDUR PI Is this causing the problem? thanks. Paul prohaska (paul.prohaska@northsafety.com)

              Comment


              • #8
                Tips and Techniques: Date Values

                ** This thread discusses the article: Tips and Techniques: Date Values **
                All this date manipulation can be done with SQL, albeit not designed for detail processing, almost anything outweighs a reason to write yet another RPG program or utilize an API. Not that I don't like RPG!

                Comment


                • #9
                  Tips and Techniques: Date Values

                  ** This thread discusses the article: Tips and Techniques: Date Values **
                  I think I had the same problem as you described when I tried this code. If you change the definition of the parm DURATION to *INT2 from *INT4 it works. I am still a little new so I don't know if this resolution will limit you with the number of days to use. For my purposes, I don't think it will. -Michele
                  Code

                  Comment


                  • #10
                    Tips and Techniques: Date Values

                    ** This thread discusses the article: Tips and Techniques: Date Values **
                    Oh so you appreciate "readable code". This means you are a non-guru like me. For it is more than obvious by now that Gurus absolutely hate readable code. All in the name of "backward compatibility". Atleast that is my conclusion this month. In my shop, only those colleague who are on other platform e.g. Cobol, C, or VB, appreciates my code because they think it is "readable". My RPG colleagues ... they hate it. They hate BIFs, they hate structured logic, they hate sub-procedure, they even hate short subroutines. In short they hate evrything that is not RPGIII. Fortunately my director etc are from the Oracle platform. Just venting ...

                    Comment

                    Working...
                    X