Hi Mat, There was an issue either at V5R3 or V5R4 where the DDL was creating a file with a different Format Level Id. It had to do with Date and Time data types I believe. IBM fixed this in a PTF, because if the Record Format and fields definitions are the same, the Format Level Identifier should be the same. I currently build temporary tables in QTEMP using SQL. A typical statement might be... CREATE TABLE QTEMP/ABCDREP AS (SELECT * FROM ABCDREP)
WITH NO DATA INCLUDING COLUMN DEFAULTS
RCDFMT FADREAT This creates an identical Physical, except that it is has the SQL Type of TABLE. Logicals can be built over it that can then use existing 2E programs. When I was playing with the API I was given the following DDL to create the TABLE. DROP TABLE CBLIB/CCADREP ;
CREATE TABLE CBLIB/CCADREP (
ADADCD CHAR(3) CCSID 37 NOT NULL DEFAULT '' ,
ADABTX CHAR(25) CCSID 937 NOT NULL DEFAULT '' ,
ADACTX CHAR(20) CCSID 937 NOT NULL DEFAULT '' ,
ADADTX CHAR(25) CCSID 937 NOT NULL DEFAULT '' ,
ADAETX CHAR(17) CCSID 937 NOT NULL DEFAULT '' ,
ADAFTX CHAR(2) CCSID 37 NOT NULL DEFAULT '' ,
ADQMCD CHAR(3) CCSID 37 NOT NULL DEFAULT '' ,
ADAGTX CHAR(9) CCSID 37 NOT NULL DEFAULT '' ,
ADDBTX CHAR(9) CCSID 37 NOT NULL DEFAULT '' )
RCDFMT @ADREAT ;
LABEL ON TABLE CBLIB/CCADREP
IS 'Customer Physical file' ;
LABEL ON COLUMN CBLIB/CCADREP
( ADADCD IS 'Cust Number' ,
ADABTX IS 'Cust Name' ,
ADACTX IS 'Cust Street' ,
ADADTX IS 'Cust Extra Line' , ADAETX IS 'Cust City' ,
ADAFTX IS 'Cust State' ,
ADQMCD IS 'Cust Country' ,
ADAGTX IS 'Cust Zipcode' ,
ADDBTX IS 'DUNS ID' ) ;
LABEL ON COLUMN CBLIB/CCADREP
( ADADCD TEXT IS 'Cust Number' ,
ADABTX TEXT IS 'Cust Name' ,
ADACTX TEXT IS 'Cust Street' ,
ADADTX TEXT IS 'Cust Extra Line' ,
ADAETX TEXT IS 'Cust City' ,
ADAFTX TEXT IS 'Cust State' ,
ADQMCD TEXT IS 'Cust Country' ,
ADAGTX TEXT IS 'Cust Zipcode' ,
ADDBTX TEXT IS 'DUNS ID' ) ; This created a TABLE (PF) that was identical to my Physical. Anyway, I'm pretty sure that it is IBM's intent to cause the API to produce DDL that creates a PF/LF that is identical to the original. I have followed discussions of at least one site that has replaced all their PF/LF objects with DDL defined files, without having to recompile anything, so while my testing is just observations of what I have seen, I know that this has been done in the real world as well. Anyway, good luck with your endeavors. We're pushing for i 6.1, and I will be putting processing in place to replace the DDS compiled objects with DDL defined objects. So I'm up for phase 1 as soon as I get to 6.1 (we're even thinking about bring up a partition just to test this out). Thanks, Crispin. Message Edited by Crispin on 10-09-2009 09:47 AM [left]