I have a procedure I wrote in RPG that I would like to adapt to an EGL application I'm working on. The procedure I wrote takes a variable that is defined as packed(4:2) which contains a time element and rounds it up to the next quarter hour. The problem I am having is that some of the built in functions I am using in RPG don't exists in EGL such as converting a field to an integer with a half adjust (or at least I can't find such a function). How do I go about converting what I've written in RPG to an EGL function?
//--------------------------------------------------
// Procedure name: RoundHrs
// Purpose: Round hours to the next quarter hour
// Returns: Time rounded to the quarter hour
// Parameter: TimeIn => Time reported
//--------------------------------------------------
dcl-proc RoundHrs ;
dcl-pi *n packed(4:2) ;
TimeIn packed(4:2) ;
end-pi;
// Local fields
dcl-s TimeOut packed(4:2) ;
dcl-s Minutes zoned(2:0) ;
Minutes = (((TimeIn- %INT(TimeIn)) / .25) * 15);
TimeOut = (%INT(TimeIn) + (%INTH(Minutes / 15) * .25));
Return TimeOut;
end-proc ;
msoucy