Program works in debug but not run time

pts.
Tags:
AS/400
RPG
RPGLE
I have an RPGLE program that works when run in debug mode but will not update the file when run outside of debug. I have looked at the obvious, such as library list to ensure using same versions of programs. At a loss......

Answer Wiki

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

It seems like I ran into this once. However, my issue was that a copy of the file being updated was sitting in another libarary other than the one I was looking at.

=========================================================

If it is only “debug” that makes the difference, then the program is coded to work differently under debug. I’d say that’s pretty unlikely. But we don’t know what you think works differently.

Are there different values in variables? Is a different path taken in code? Does an I/O statement work differently?

The only time I’ve ever seen debug make a difference <i>when everything else was equal</i> was a case where an I/O statement only properly populated variables in debug and not in normal mode. It turned out that the input was coded to run without any wait. It would always have time to complete when the program ran in single-cycle mode under debug.

That could be something like your case, but I’d expect that to be very unlikely.

Far more likely is the suggestion that it fails in batch but runs correctly interactive, or some similar difference in how the program is called. The suggestion that the parm list is the culprit is a good possibility there.

Describe the circumstances under which it succeeds and those under which it fails. Something other than debug is where the problem is likely to be found.

Tom

Discuss This Question: 6  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
  • Taprovost
    Check your joblog for any errors that might have presented themselves. What release level is your i5 at?
    0 pointsBadges:
    report
  • Grinchly
    I have had this problem before and it was related to the fact that I was running the debug interactively, but the regular run of the program was run in batch. The problem was traced back to the way that parameters are passed on a sbmjob. This may be your problem, especially if you are passing in numeric parameters.
    0 pointsBadges:
    report
  • WaltZ400
    Is this an SQL RPG program? Reason I am asking is we have run into problems where a program was not created with COMMIT(*NONE) so it is assuming the program is being called under commitment control. Nothing was being written or updated in the program until we recreated it.
    655 pointsBadges:
    report
  • Walter47
    I agree with previous answer. Happened to me once. I was running debug interactive. While alone it was run in batch. I'd look at my library list in each situtation. Jack
    120 pointsBadges:
    report
  • JewelJose
    Is the file journaled? If so, check the journal entries to see what was updated after you run the program outside of debug. To further clarfiy some of the other answers posted - is this a batch job. If so, check the library list of the batch job. This should be in the job description. Also, look into the begining of the job log to see what library list it really used to run the job. If the job is using a different library list and you are making updates thru a logical file, the LF might be pointing to an entirely different PF, but you are querying the file what you believe is right. Another thing that I have come across is expecting new records at end of file, but the record was inserted elsewhere due to key sequence.
    0 pointsBadges:
    report
  • mcarpntr
    In debug you specify to update live files. Running live you have to be authorized to update the file in production. If not a library issue it could be an authorization issue, Run th job in batch and specify a log to print. This will tell you what is happening in batch.
    135 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