View Full Version : hexadecimal date math
11-14-2002, 09:30 AM
I think the reason for the strange result is that the x'10' is not a valid packed number. x'010f' or x'1f' would give a 10 day or 1 day difference respectively.
11-14-2002, 10:06 AM
No, <code>X'10'</code> should be valid anywhere a numeric literal can be coded. I expect Gene will report the defect to IBM through the usual channels, and a fix should be available in some future release. In the meantime, I hope coding a numeric literal isn't too big a hardship.
11-14-2002, 10:07 AM
When I run code like this on V5R1: <pre> H dftactgrp( *no ) datfmt( *usa ) D A S D inz( D'12/17/2002' ) D B S D D C S D /free B = A - %days( X'10' ); dsply B; C = A - %days( 16 ); dsply C; *INLR = *on; /end-free </pre>I am surprised to see the following: <pre>DSPLY 01/01/0001 DSPLY 12/01/2002 </pre> Doesn't RPG date math work with hexadecimal?
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.