Decimal data error

20 pts.
Tags:
CL
CL programs
RPG
RPG Programs
SBMJOB
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.
ASKED: December 12, 2008  6:35 PM
UPDATED: December 15, 2008  6:20 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Koohiisan
    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.
    5,020 pointsBadges:
    report
  • BigKat
    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,565 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following