0 pts.
 SQLRPG and LVLCHK *no
We have numerous programs on our system (iSeries...V5R2) that are SQLRPG. We recently changed one of the large physical files that one of the SQLRPG's run over. We changed the physical via a compile of the with LVLCHK *no. (fields added to the end of the file) We started to experience some issues with this one program (SQLRPG) in particular. We did a recompile of the program and the issue seemed to go away. I guess my question is that I was not aware that when using SQLRPG, and you do a file change LVLCHK *no, you would still need to do a recompile of the programs. Have anyone experienced or heard of this issue?

Software/Hardware used:
ASKED: May 19, 2005  3:21 PM
UPDATED: October 25, 2009  11:41 AM

Answer Wiki:
Yes, you have to be very careful when using embedded SQL and fetching into an external DS. There is no level check on external data structures, Your program will run with out notification of a level change. You may get a SQL mapping error but it wont cause an error message.If you are updating files, your going to have a long night. ================================================== There will be lots of problems if the program isn't coded properly. Otherwise, it should be fine. You don't show any relevant code nor give any indication what errors were seen (or "issues"), so it can only be guesswork. One common mistake is to code SELECT * FROM... instead of a proper select-list. Tom
Last Wiki Answer Submitted:  October 25, 2009  11:41 am  by  Davisty   0 pts.
All Answer Wiki Contributors:  Davisty   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

I think that the concept of LVLCHK was the best thing that ever happened. I cringe at the thought that anyone would create a file with level check *no. The concepts prevents a programmer from shooting himself in the foot. Recompile the programs and you’ll sleep better at night.

 0 pts.

 

Whether a change in the file layout will affect your program is dependent on the fields being selected or the structures they are placed into.

If you are using the existing file layout as an external data structure or you are otherwise bringing every field into the program, you will need to recompile.

If your SQL is using a specific subset of the already existing fields, the field definitions have not changed, and you have a static defined structure to receive them that does not rely on the file layout, the program should continue to work without a recompile.

 0 pts.