When we last reorganized the iSeries Network forums, the sample source code that was posted in the DB2/SQL, RPG, and COBOL online communities was inadvertently deleted from the site. I've now reposted the sample source code listed below:
DB2/SQL Sample Source Code
http://www.iseriesnetwork.com/resources/code/misccode/sqlcode/
* Dynamic Cursor with Embedded SQL in RPG IV
* Dynamic Embedded SQL to Delete Selected Records from a Selected File
* Indicator Variables with SQL Fetch Statements
* Run SQL Commands Without IBM's SQL Software Product
* SQL Describe in RPG IV
RPG Sample Source Code
http://www.iseriesnetwork.com/resources/code/misccode/rpgcode/
* Calculating the First and Last Day of the Quarter
* Day-of-Week Service Program
* Determining Supported Display Width with Dynamic Screen Manager API
* Determining Whether a Job Is Running Interactive or Batch
* Getting the Name of the Program that Caused a Trigger To Be Fired
* Indentation Utility for RPG IV and RPG/400, by Dave Hickey
* Manipulating Packed Data Inside a Character Field
* QMHLSTM API
* Redisplaying the Same Subfile Screen Page
* Retrieving a Field Description
* Returning the Week Number for a Supplied Date
* SNTP - TCP/IP Socket Programming in RPG IV
* SQL Describe in an RPG IV Program
COBOL Sample Source Code
http://www.iseriesnetwork.com/resources/code/misccode/cobolcode/
* Bit Manipulation Routines
* Callable I/O Routines
* CGI in ILE Cobol, by Eduardo Murra Farrus
* Dynamically Allocating a Table
* Exclusive Or (XOR)
* Execute an iSeries Command with QCMDEXC
* Extracting Source Code from a Cobol Compiler Listing
* Finding Unused COBOL Variables
* Print Files in Cobol
* Return Locked Record Holder Information
* Returning the User ID
* Six SEU Line Commands
* Sockets Programming in Cobol, by Joerg Egger
* Standardizing and Colorizing Cobol Source
* Subfiles in Cobol
* Timestamp Fields in ILE Cobol
* User Space Calls
* Using a Procedure Pointer to Call a Procedure with ILE Cobol