In SQLRPGLE we use Sqlcode. But we do not declare this variable in our program. So my query is where do we get this variable from? How come this variable is available to the program without declaring it?
A SQLRPGLE needs to be pre-compiled with CRTSQLRPGI. The precompiler adds this variable and others in your source, and then compiles the new source See CRTSQLRPGI