Then perhaps use the Retrieve SQL DDL API [or the, IMO less obviously 
named] Generate DDL API, which the iNav interface utilizes [apologies 
for the v5r4 reference; the v6 and v7 InfoCenters have been far from 
functional for me, at least sporadically]:
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/qsqgnddl.htm
_i Generate Data Definition Language (QSQGNDDL) API i_
"  Required Parameter Group:
 1  Input template               Input   Char(*)
 2  Length of input template     Input   Binary(4)
 3  Input template format name   Input   Char(8)
 4  Error code                   I/O     Char(*)
  Default Public Authority: *USE
  Threadsafe: No
The Generate Data Definition Language (QSQGNDDL) API generates the SQL 
data definition language statements required to recreate a database 
object. The results are returned in the specified database source file 
member.
Database physical files or logical files that were created using an 
interface other than SQL may be specified. For example, files created 
from DDS and the CRTPF or CRTLF commands may be specified. Even if the 
object was created using SQL, the Standards option may restrict what can 
be generated. In either of these cases:
    * the operation may succeed with warnings that are generated in the 
SQL statement source, or
    * the operation may fail for certain non-relational files or 
objects not supported by the specified Standards option.
If a database object was created using an SQL interface, the resulting 
SQL statements may be slightly different than the SQL statements that 
created the object originally. ...
 ..."
  DSPFFD plus DSPFD invocations, and the information in QADBIFLD [or an 
LF listed in DSPDBR QSYS/QADBIFLD; similarly QADBXREF] are often times 
sufficient for generating the DDS or DDL [the latter are not for files 
residing in QTEMP nor /non-relational/ files, and a PF QADB* in QSYS is 
not publicly authorized for use], and the Retrieve Database File 
Description (QDBRTVFD) API should be an option as well [and more 
thorough than either of the prior two mentioned], and ¿others? possibly 
as well.  Specifically if the "file object" is not specifically a 
database *FILE, there are a List Fields (QUSLFLD), List Record Formats 
(QUSLRCD), Retrieve Display File Description (QDFRTVFD) API, and a 
Retrieve Printer File Attributes (QDFRPRTA) API.
Regards, Chuck
On 08 Apr 2013 23:45, Nisha Ramesh wrote:
I want to do that via program
On Apr 9, 2013 12:07 PM, "Chamara Withanachchi"<chamaraw@xxxxxxxxxx>  wrote:
From System i Navigator you can regenerate the CREATE Statement.
On Tue, Apr 9, 2013 at 10:58 AM, Nisha Ramesh wrote:
How can I create a source dds if I have the file object? I don't
want to use any third party tool for this.
As an Amazon Associate we earn from qualifying purchases.