Asking BOB to convert DDS PF to SQL TABLE

Importing DDS PF and converting to SQL TABLES is simple using BOB. Here is the magical phrase :

"convert all .PF to SQL .table and rename according to 'code for ibm-i' naming format using the description from the %METADATA. Once renamed - remove the %METADATA"
bob - about to import PF to SQL

It processes the first file and present for approval before continuing with the conversion. In my case we went from this DDS to this SQL:

DDS PF - Original

*%METADATA *
* %TEXT Auto Bill Release Log File *
*%EMETADATA *
*========================================================================*
* *
* Auto Bill Release Log File *
*========================================================================*
A UNIQUE
A R ABREC
* - -----
A ABORD# 7A COLHDG('Order Number')
A ABPODT 8S 0 COLHDG('Order Date')
*
A ABDATE 8S 0 COLHDG('Release Date')
A ABTIME 6S 0 COLHDG('Release Time')
*
A ABUSER 10A COLHDG('Released by')
A ABPGM 10A COLHDG('Program Name')
*
* - Key Data -- 15 Long
*
A K ABORD#
A K ABPODT
*========================================================================*

SQL TABLE - Converted by BOB

-- ----------------------------------------------------------------------------------------------------------
-- Table: ABRLOGFL - Auto Bill Release Log File
-- ----------------------------------------------------------------------------------------------------------
-- Purpose: Stores log entries for automatic bill release processing, tracking when orders are
-- automatically released for billing and by which user/program.
--
-- Key Features:
-- - Tracks order release history
-- - Records release date and time
-- - Identifies releasing user and program
-- - Maintains audit trail for billing automation
--
-- ----------------------------------------------------------------------------------------------------------
-- Change History
-- ----------------------------------------------------------------------------------------------------------
-- Date | Author | Description
-- -----------|---------------------|--------------------------------------------------------------------
-- 2013-10-15 | ABC | Initial creation
-- 2026-04-14 | System | Converted from DDS to SQL format
-- ----------------------------------------------------------------------------------------------------------
SET SCHEMA TITANDTA;


-- Drop existing table if recreating (use with caution in production)
-- DROP TABLE IF EXISTS ABRLOGFL;
CREATE OR REPLACE TABLE
ABRLOGFL (
-- Primary Key Fields
ABORD# FOR COLUMN ABORD# CHAR(7) NOT NULL
WITH
DEFAULT,
ABPODT FOR COLUMN ABPODT DECIMAL(8, 0) NOT NULL
WITH
DEFAULT,
-- Release Information
ABDATE FOR COLUMN ABDATE DECIMAL(8, 0) NOT NULL
WITH
DEFAULT,
ABTIME FOR COLUMN ABTIME DECIMAL(6, 0) NOT NULL
WITH
DEFAULT,
-- Audit Fields
ABUSER FOR COLUMN ABUSER CHAR(10) NOT NULL
WITH
DEFAULT,
ABPGM FOR COLUMN ABPGM CHAR(10) NOT NULL
WITH
DEFAULT,
-- Primary Key Constraint
CONSTRAINT ABRLOGFL_PK PRIMARY KEY (ABORD#, ABPODT)
);


-- Add column labels for documentation
LABEL ON COLUMN ABRLOGFL (
ABORD# IS 'Order Number',
ABPODT IS 'Order Date',
ABDATE IS 'Release Date',
ABTIME IS 'Release Time',
ABUSER IS 'Released by',
ABPGM IS 'Program Name'
);


-- Add table label
LABEL ON TABLE ABRLOGFL IS 'Auto Bill Release Log File';


-- Create indexes for performance
CREATE INDEX ABRLOGFL_IDX1 ON ABRLOGFL (ABDATE, ABTIME);


CREATE INDEX ABRLOGFL_IDX2 ON ABRLOGFL (ABUSER);


-- Grant permissions (adjust based on security requirements)
-- GRANT SELECT, INSERT, UPDATE, DELETE ON ABRLOGFL TO SPECIFIC_USER_GROUP;
-- Add comments for complex business rules
COMMENT ON TABLE ABRLOGFL IS 'Audit trail for automatic bill release processing';

Not only did the DDS code convert nicely to SQL - it also renamed the source member from abrlogfl.pf to ABRLOGFL-Auto_Bill_Release_Log_File.table

NOTE: Our friend Uncle BOB did have a few little mis-steps along the way. I had to say this twice "try again - and process any missed PF" as the first time it ran it process around 30% of the PF, and the second around 50% of what was left. Third time was a charm, and it did all the PF correctly updated to SQL TABLES. Perhaps in the future I will try something like "Check again for any PF that might have been missed. repeat until all have been processed."

Finally ending up like this:

bob - after import PF to SQL

I still have some minor issues with the SQL converted code, but BOB has converted several hundred PF to SQL in minutes. Saving me hours of work!

Happy Days!

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>