As far as I know, there isn’t a native CL command that will calculate durations. So you could do it the harder way and write your own logic in CL to do this. Or a more robust, reliable and flexible way would be to create a procedure in a service program that could be bound by reference to your CL program (which would need to be ILE CL). RPG IV has great native functions for date and timestamp handling such as durations. ILE COBOL also has these (and possibly C and C++).
The procedure in the proposed service program could receive the two timestamps as input and return the duration to your CL program. And by being in a service program, it would be available for use by other programs as well.