OLAP functions : OnLine Analytical Processing functions Advantages- OLAP functions are specially helpful to create complex reports using a single SQL statement. OLAP functions provide multiple and very advance data grouping and ordering options which are not possible by simple “GROUP BY” and/or “ORDER BY” clauses.
If you need to run the same dynamic SQL statement more than once per job use the PREPARE – EXECUTE statements using EXECUTE IMMEDIATE incurs the unnecessary cost of re-preparing the SQL statement each time PREPARE is like a mini-compile of its own. If required info to PREPARE a statement is not available on COMPILE TIME than the [...]
Description This utility can write Subfile code for any given SQL select statement with little or no user interaction. It takes less than 20 seconds to write complete Subfile code. Check video at top/bottom of this page for more details.
Here is a sample code to add 2 number in Free Format RPG 0001.00 D Total S 10 0 INZ 0002.00 C *ENTRY PLIST 0003.00 C PARM Number1 5 0 0004.00 C PARM Number2 5 0 0005.00 /FREE 0006.00 Total = Number1 + Number2 ; // Get total for both input values 0007.00 DSPLY Total '*EXT' ; // Display value of Total 0008.00 *InLR = *ON; // End of program [...]
Free Format RPG was a major step towards the modernization of RPG language. This change in RPG syntax gave RPG programmers flexibility to write code which is easy to type, read and maintain. Technically Fix Format RPG and Free Format RPG are equally powerful and each one of them has its own pros and minor cons with respect to each other.
SQL is always much better than RPG for handling string data. Embedding SQL in RPG gives RPG the great power not only to handle database operations but also to perform string manipulation. For string manipulation, RPG provides some very basic functions, such as %TRIM, %SUBST, %SCAN, and %REPLACE. CISSP pdf The geology of the surrounding [...]
When you use COMMIT or ROLLBACK statements with CURSOR, the behavior of the CURSOR depends on whether or not it is declared using the WITH HOLD clause If the CURSOR is declared using the WITHOUT HOLD clause, all of its resources (cursor, locks, and large-object datatype, or LOB, locators) are released upon either COMMIT or [...]
When processing a CURSOR, DB2 SQL give option to update or delete data in base table based on current position of CURSOR in result table. This is called POSITIONED UPDATE or POSITIONED DELETE. Let say there is a table EXAMPLETABLE like CREATE TABLE EXAMPLETABLE (id numeric, name char(10), processedFlag char(1));