We’ve been covering the topic of using SQL instead of DDS to define your database files for quite some time now. The benefits and possible problems and pitfalls have been documented in a number of articles, as have the various methods and approaches to actually making the move from DDS to SQL. To get you up to speed in case you missed any of the articles when they were initially published, I’ve included links at the end of this article. Please note that some of the articles require a ProVIP membership to access.
Reading these articles, you’ll notice that there’s an option of using iSeries Navigator to take existing DDS-defined database files and generate the SQL Data Definition Language (DDL) statements needed to create or re-create these objects as SQL file objects, such as tables, views, and indexes. This iSeries Navigator facility is based on an i5/OS API: Generate Data Definition Language (QSQGNDDL). And although iSeries Navigator continues to improve in performance and usability with every new release, in some cases using a CL command to get the job done is still faster and more convenient. With that reality in mind, I took advantage of the QSQGNDDL API to create a Generate SQL Data Definition Language (GENSQLDDL) command that offers the same reverse engineering services that iSeries Navigator offers.
Download the save file containing the source code.