Problem solve Get help with specific problems with your technologies, process and projects.

Spooky update statements and %NULLIND()

Update statement not showing up in the journal? Here's a workaround.

In one of my programs (free format RPG IV, I used the command UPDATE to update a record. The file I was working with was opened under Commitment Control, to be able to commit or rollback a transaction. But for some reason, the update statement didn't show any result in the table, and wasn't logged in the journal either. I tried all obvious situations, checked if the logical pointed at the correct physical, checked if the physical was journalled in the correct journal, etc. Nothing was in error. It cost me a whole day to find out the cause was the function %NULLIND(). I wrote the record initially with the %NULLIND() to *ON. This was the reason the new value I used in the update statement didn't show up in the file.

The lesson to be learned from this, you have to first change the fields %NULLIND() to *OFF, before you are able to change and update the value.

This doesn't change the fact, it remains spooky that the update statement didn't show up in the journal. This looks like an error/exception in RPG. The RPG program doesn't update any value when using the %NULLIND()-function, and it looks like the update statement isn't executed at all!

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


Dig Deeper on iSeries ILE programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close