Let's explore the nuts and bolts of using embedded SQL: file type, syntax, and compiling.
Written by Tom Snyder
In a previous article, "Why Use Embedded SQL Within RPG?," I talked about why you would use embedded SQL in RPG. In this article, I will talk about how you could use embedded SQL within RPG. We'll start with an existing RPG program that is written with CHAIN and READ, and then we'll convert it to use embedded SQL.
Now that we've figured out how to receive them, how do we remove them if we want to?
Written by Bruce Vining
Last month, in "The API Corner: More on Message Handling," we looked at how to receive diagnostic messages (such as CPF3213 – Members for file more than maximum allowed) using the Receive Program Message (QMHRCVPM) API. The diagnostic message was needed in order to determine the underlying cause of an escape message (in our example, CPF7306 – Member not added) and then take the appropriate corrective action. The recovery action for CPF3213 was to change the file's MAXMBRS attribute to *NOMAX by using the Change Physical File (CHGPF) command and then adding the required member using the Add Physical File Member (ADDPFM) command. Both of these commands were run by the RPG application program using the Process Commands (QCAPCMD) API. However, after successfully adding the member, we noticed that the job log still contained the CPF3213 diagnostic message along with the two completion messages (CPC7303 – File SOMEFILE in library xxxxxx changed and CPC7305 – Member yyyyyy added to file SOMEFILE in xxxxxx) that were related to our handling of the initial CPF7306 error. Today's "API Corner" article looks at various options of how we can, if we want to, remove these messages.