15 pts.
 Free format subdur minutes from a time
I am trying to search for the correct syntax for subtracting a minute from a time.

I have a 6 numeric time field in HHMMSS format.  I am trying to use free format to subtract a minute.  Having trouble.

Using:

@atime=%dec((%time(@atime:*hms)- 1 *min) :6:0)                                   

Getting compile error saying "The name or indicator minis not defined"  tried *mm, *m. 

 tried -%min(1)  says "token is not valid"

I can't find an example of this code.  any help would be appreciated



Software/Hardware used:
rpg free
ASKED: May 2, 2011  6:39 PM
UPDATED: May 4, 2011  7:03 PM
  Help
 Approved Answer - Chosen by carlosdl

Try this:

/free
   @atime=%dec((%time(@atime:*hms)- %minutes(1) ) ) ;
/end-free

Tom

ANSWERED:  May 2, 2011  8:22 PM (GMT)  by carlosdl

 
Other Answers:
Last Wiki Answer Submitted:  June 28, 2012  1:41 pm  by    0 pts.
Latest Answer Wiki Contributors: 
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

thanks that worked!

 15 pts.

 

You’re welcome. I hope that comparing the code to the reference manual can provide some clarity to IBM’s documentation. Sometimes seeing an example explains details that haven’t quite clicked yet.

Tom

 107,735 pts.