This program is a wrapper for the QSQGNDDL API. It will retrieve the SQL source necessary to create a file. This includes DDS defined files created with the CRTPF command.
The program is called from the command line with the following parameters:
The program call looks like this:
call cp1150r (CPANDO CP1020F CPANDO SRC CP1020S)
The generated file looks like this:
-- Generate SQL -- Version: V5R3M0 040528 -- Generated on: 09/07/06 15:30:14 -- Relational Database: AS400 -- Standards Option: DB2 UDB iSeries CREATE TABLE CPANDO/CP1020F ( -- SQL150B 10 REUSEDLT(*NO) in table CP1020F in CPANDO ignored. -- SQL1509 10 Format name CP1020 for CP1020F in CPANDO ignored. -- SQL1506 30 Key or attribute for CP1020F in CPANDO ignored. AFRECTYP CHAR(10) CCSID 37 NOT NULL DEFAULT '' , AFFLDNAM CHAR(10) CCSID 37 NOT NULL DEFAULT '' ) ; LABEL ON TABLE CPANDO/CP1020F IS 'Generic File Merge' ;
The original DDS looks like this:
A R CP1020 A TEXT('Generic File Merge') A AFRECTYP 10 A AFFLDNAM 10 A K AFRECTYP A K AFFLDNAM
The following link takes you to the source code, written in beautiful /free ILE/RPG. The source is
distributed under a creative commons license.