I am trying to learn something new with doing DDL files. I have the
file defined as:
CREATE TABLE LIBRARY.TRANYYMMDD (
ID INTEGER NOT NULL WITH DEFAULT 0,
TRANSACTIONID FOR COLUMN TRANSID CHAR (40 ) NOT NULL WITH DEFAULT '' ,
SYSTEMKEY1 VARCHAR(50) CCSID 37 NOT NULL DEFAULT '' ,
SYSTEMKEY2 VARCHAR(50) CCSID 37 NOT NULL DEFAULT '' ,
SYSTEMCODEID FOR COLUMN SYSCODEID CHAR(10) CCSID 37 NOT NULL DEFAULT '' ,
TRANSACTIONTYPE FOR COLUMN TRANTYPE INTEGER NOT NULL DEFAULT 0 ,
AMOUNTPAID FOR COLUMN AMTPD DECIMAL(10, 2) NOT NULL DEFAULT 0 ,
CUSTOMERNAME FOR COLUMN CUSTNAME VARCHAR(50) CCSID 37 NOT NULL DEFAULT '' ,
CUSTOMERADDRESS1 FOR COLUMN CUSTADDR1 VARCHAR(50) CCSID 37 NOT NULL DEFAULT '' ,
CUSTOMERADDRESS2 FOR COLUMN CUSTADDR2 VARCHAR(50) CCSID 37 NOT NULL DEFAULT '' ,
CUSTOMERCITY FOR COLUMN CUSTCITY VARCHAR(50) CCSID 37 NOT NULL DEFAULT '' ,
CUSTOMERSTATE FOR COLUMN CUSTSTATE CHAR(2) CCSID 37 NOT NULL DEFAULT '' ,
CUSTOMERZIP FOR COLUMN CUSTZIP CHAR(10) CCSID 37 NOT NULL DEFAULT '' ,
CUSTOMERPHONE FOR COLUMN CUSTPHONE VARCHAR(20) CCSID 37 NOT NULL DEFAULT '' ,
CUSTOMEREMAIL FOR COLUMN CUSTEMAIL VARCHAR(100) CCSID 37 NOT NULL DEFAULT '' ,
PAYMENTDATE FOR COLUMN PAYDATE DATE NOT NULL DEFAULT CURRENT_DATE ,
PAYMENTTIME FOR COLUMN PAYTIME TIME NOT NULL DEFAULT CURRENT_TIME ,
HASMULTIPLE FOR COLUMN HASMULTI CHAR(1) CCSID 37 NOT NULL DEFAULT '',
PRIMARY KEY( ID ));
Also, I am trying to use data structures for the file IO.
FTRANYYMMDDIF E K DISK rename(TRANYYMMDD:TRANYMDR) usropn
D TRANYMD_I DS likerec(TRANYMDR:*input)
/free
read TRANYMDR TRANYMD_I;
/end-free
Now for the problem. Fields aren't coming in right as shown in this
image (
http://goo.gl/SFz27). It looks like the fields don't all line
up properly but I don't understand why. Here is what the DS looks like
when it is brought into the program (
http://goo.gl/EM1BI).
What might I be doing wrong?
--
Mike Wills
http://mikewills.me
As an Amazon Associate we earn from qualifying purchases.