|
Sounds like %Dec requires literals for the length and decimal notation just like %EDITC requires a literal for the edit code. Not sure why IBM choose to require literals, but that's the way it it. Can you get away without using the length or decpos parameters? -Bob Cozzi www.RPGxTools.com If everything is under control, you are going too slow. - Mario Andretti -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dan Sent: Thursday, July 21, 2005 3:30 PM To: RPG400-L@xxxxxxxxxxxx Subject: %DEC problems Trying to figure out why the following /free code is blowing raspberries at me: cuPD = %dec( %char( %date : *ISO0 ) : %len( cuPD ) : %decpos( cuPD ) ); cuPD is defined as P(8,0) in a database file defined for output. The compiler errors I'm getting are related to the 2nd & 3rd parameters of the %dec BIF: RNF0328: The second parameter for %DEC or %DECH is not valid. The second parameter for built-in function %DEC or %DECH must be a numeric literal; a built-in function that has a value known at compile-time; or a numeric named constant. In addition, the value of the parameter must be between 1 and 30 with no decimal digits. A float literal is not allowed. The built-in function is ignored. RNF0329: The third parameter for %DEC or %DECH is not valid. The third parameter for built-in function %DEC or %DECH must be a numeric literal; a built-in function that has a value known at compile-time; or a numeric named constant. The value of the parameter must be between 0 and 30 with no decimal digits. Also, the value must be less than or equal to the value of the second parameter specified for this built-in function. A float literal is not allowed. The built-in function is ignored. I would have thought that these are "known values at compile-time" and, therefore, would have satisfied the second condition in the error messages. Previous to getting these errors, I had hardcoded the numeric literals 8 and 0 for the 2nd & 3rd parameters of the %dec BIF, respectively, and this compiled fine. I am still playing catch-up after my layoff. Is this the easiest/best way in /free to populate an 8-digit numeric with the current date? It seems there should be an easier way to do this. TIA, Dan
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.