Link to home
Start Free TrialLog in
Avatar of mustish1
mustish1

asked on

Physical File

How do I create a physical file?

User generated image

Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

1) Create DDS source code for the file.  Traditionally, DDS source is stored in a source physical file called "QDDSSRC", though you can name yours anything you like.

2) Compile the file using CRTPF command.

You can also create a "flat file" without DDS source and only one field the same length as the record by just specifying a record length.

IBM provides comprehensive documentation:  https://www.ibm.com/docs/en/i/7.2?topic=programming-setting-up-database-files
Avatar of mustish1
mustish1

ASKER

i got an error.
User generated image

User generated image
ASKER CERTIFIED SOLUTION
Avatar of Theo Kouwenhoven
Theo Kouwenhoven
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank You.
Theo brings up a good point:  SQL is a much better way to create a physical file than DDS.  DDS is a lagacy tool, and doesn't support all the reatures supported by SQL-defined physical files.

You can create physical files (which are the same thing as DB2 tables in IBM i) using the IBM i Navigator "Run SQL" interface.  Then you just use a DB2 SQL "CREATE TABLE" statement - a much more familiar interface for a lot of programmers from other platforms than IBM i DDS.