Search code examples
ibm-midrangerpgle

How to get 6 Digit Numeric Time in RPG-Free?


I am trying to get the system time from my iSeries in a 6 digit numeric format. The time would be in a HHMMSS format.

I have tried using:

CDBRVWTM = %Dec(%Time(): *ISO); 

and

CDBRVWTM = %DEC(%CHAR(%TIME()):6:0); 

The field CDBRVWTM is a 6 digit numeric field in the table.


Solution

  • **free
    ctl-opt main(mainline);
    
    
    dcl-proc mainline;
    
       dcl-s CurTime packed(6:0);
    
       curTime = %dec(%time():*HMS);
       dsply %char(curTime);
    
       return;
    
    end-proc;