Times spanning midnight in RPG/400 concatenation

5 pts.
Tags:
Concatenate
RPG/400
RPG/400 Field Concatenation
I have successfully converted time field to date/time. Now I need to find the total minutes between one field and another but cannot get it to show me any value. I am using DateDiff ('n',{@startdatetune}, {@startdatetime}) where n indicates minutes. I should be able to use any field where I have concatenated the date and time into one field. Right?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Vatchy
    Here is a simple example:
         D w@Date          S               Z
         D w@Date1         S               Z
         D w@Diff          S              5P 0
    
          /Free
            w@Date = %TimeStamp();
            w@Date1 = w@Date - %Minutes(35);
            w@Diff = %Diff(w@Date :w@Date1 : *Minutes);
    
            *INLR = *On;
          /End-Free
    
    This is a complete program. w@Diff has a value of 35 which, as you can see, is the difference I entered in the previous line.
    1,410 pointsBadges:
    report
  • TomLiotta
    I should be able to use any field where I have concatenated the date and time into one field. No. You need to use fields that are appropriately defined and that have appropriate values. Show us your variable definition, the actual values in the variables and the actual statements that do the calculation. In particular, we need to see the source for your DateDiff() procedure. Without seeing the source, we have no idea what it will do with different variables. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    I didn't notice at first that this is a RPG/400 question. In that case, you don't have procedures available. DateDiff ('n',{@startdatetune}, {@startdatetime}) So, what exactly is "DateDiff"? It's not part of RPG/400. Where did you get it and how are you using it? Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Two issues 1 - Are you using RPG/400 or RPGLE (RPG/IV)? 2 - Since DATEDiff is an SQL function - are you using SQL?. DateDiff is not part of the SQL standard and is not a built in function in DB2 However, if you've actually made SQL datetime fields (no you can't just concatenated the date and time into one field) then you could do something like this select Minutes(dateEnd) - Minutes(dateBegin) as elapsedTime from .... Phil
    49,850 pointsBadges:
    report
  • TomLiotta
    Ahh! I thought "DateDiff" seemed familiar. When I see questions where someone tries an operation from a different platform, I wonder if there is a Visual Basic forum somewhere that has a question like "I tried to use SETLL before a READE in my VB script, but I got this weird error message. Anybody know what I should change?" Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following