Convert a DDS file into SQL Table and creates surrogate files.
It won't be 100% all of the time, but should get you 80% of the way there 80% of the time. This is intended to be a helper, not a flawless converter that you mindlessly run. Do not use this if you don't know what you're doing.
-
Clone the repo
git clone https://github.com/oceanskunk/dds-to-ddl.git
-
Compile the programs
CRTSQLRPGI OBJ(<your library>/CVTDDS) SRCSTMF('/home/<USER>/dds-to-ddl/qrpglesrc/CVTDDS.SQLRPGLE')
CRTSQLRPGI OBJ(<your library>/CRTDDS) SRCSTMF('/home/<USER>/dds-to-ddl/qrpglesrc/CRTDDS.SQLRPGLE')
-
Call CVTDDS first
CALL PGM(CVTDDS) PARM('LIBRARY' 'FILENAME' 'SQLTABLE')
- LIBRARY and FILENAME should point to the existing PF
- SQLTABLE is the name for the new SQL table
- This will generate DDL for your new SQL table.
- Review the source in QTEMP/QSQLSRC.
- RUNSQLSTM to create the new table.
-
Call CRTDDS next
CALL PGM(CRTDDS) PARM('LIBRARY' 'FILENAME' 'SQLTABLE')
- LIBRARY and FILENAME should point to the existing PF
- SQLTABLE is the name for the new SQL table
- This will generate DDS for new versions of the existing files.
- The PF will be converted into a LF.
- All existing LFs will be based on the new SQL table.
- Review all the source in QTEMP/QSQLSRC (yes, the DDS is in QSQLSRC).
DO NOT COMPILE ANYTHING YET
-
Copy your data from the PF into the new table
- You will need *MAP *DROP
-
Now you can compile the DDS
- Does not handle multi-format files.
- Does not (yet) handle select/omit.
- Probably many others...