20 pts.
 Decimal data error
For testing an RPG program, I changed the CL program which submits the RPG program to a “call”. The change was to include a new parameter (numeric) to the RPG program. After testing, the Call was changed back to SBMJOB, but when tested again, the RPG program bombed with ‘decimal data error’. What could the be the probable reason for it.

Software/Hardware used:
ASKED: December 12, 2008  6:35 PM
UPDATED: December 15, 2008  6:20 PM

Answer Wiki:
The most likely cause is that the numeric value is being passed as character, you need to pass the data as a hexdecimal value eg x'12345f' it is often easist to pass to the rpg as char & convert to numeric in there When you use SBMJOB, it converts the command to a character string that is passed to the new job to run. In this case, it is converting the numeric parameter to a character string resulting in a decimal data area. You have several options - the easiest are to either pass the parameters as character strings and convert them in your program, or create a user command to call the program and it will format the parameters properly when it is submitted.
Last Wiki Answer Submitted:  December 15, 2008  6:20 pm  by  BigKat   7,185 pts.
All Answer Wiki Contributors:  BigKat   7,185 pts. , Markpg   155 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Doesn’t RPG expect any numeric parameter to be a 15.5 packed decimal? It seems like I have had success in the past by defining my numeric parameters as 15 P 5 on a D-spec.

 4,990 pts.

 

hi Koohiisan

RPG doesn’t expect 15,5 the OS does. It takes the character string received from the SBMJOB command and converts it to a packed 15,5 when it sees a numeric string. If you code the RPG to match, then it will work to.

 7,185 pts.