Decimal data error in batch job

2300 pts.
Tags:
RPGLE
SBMJOB
I have written an RPGLE program which was called from a CL with parameters. When I run this program interactively it gave me results as expected, but when I change the CL from direct call to Batch call via SBMJOB with parameters it doesn't give me any results. When I checked it in WRKACTJOB it was running there in Batch mod but when I saw its message it was saying that it has some decimal data error occured. Why it was running smoothly in interactive mod and not running in batch mod?

Answer Wiki

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

Sounds like there may be a problem with the library list when running in batch mode. You may have picked up another version of the file without any data. Check the JOBD for the profile. 

Discuss This Question: 7  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
  • hunshabbir7
    Thanks for replying. I finally resolved the issue for the time being. Actually as I mentioned that I was using SBMJOB command to submit command to batch processing. This command runs with its default behavior for Data Type. It can not differentiate between different data types. So it was only handling character data type correctly but not numeric. So for the time being I have passed my numeric data as character type and when receiving on the other end I am again parsing it to numeric value, so it started working fine, (Reference). I will surely test RQSDTA() later on. 
    2,300 pointsBadges:
    report
  • BigKat
    you can pass a packed numeric value if you code it properly.  For example, a 5,2 field with 123.45 in it is passed as x'12345F'  F is positive, D is negative.  No decimals in the passed string, they are interpreted.

    Note you must always have an even number of characters within the quotes, so you may need to add a leading 0.  4,0 field of -1234 is passed as x'01234D'
    8,350 pointsBadges:
    report
  • pdraebel
    When calling RPG or RPGLE programs from CL numeric parameters are passed with a fixed length of 15.5. You could make a command to do the call.
    3,100 pointsBadges:
    report
  • hunshabbir7
    Thnx BigKat for knowledgeable comments. That is interesting. I must try it but how can I make a string x'12345D' from calling program. Do I need to create it manually from calling program and pass it to CL?
    2,300 pointsBadges:
    report
  • BigKat
    yes, you would need to build the call command string in a character variable for the SBMJOB RQSDTA(&CMDSTRING)
    8,350 pointsBadges:
    report
  • saumisai
    You can convert it to char before passing to called program, and in called program receives as char and then convert it to Decimal.

    This issue arise may be due to sbmjob passes as numeric parm as 15,5.
    10 pointsBadges:
    report
  • WoodEngineer
    I have a CL which calls an RPG that needs two parms: Character 10,  Decimal 2,0.  The CL program includes a DCL &Num2 *Decimal 2,0 and uses it on the call of the RPG. That gets us around the 15,5 issue.
    6,765 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