|
I took your SQL and RPG source and created the file and program.did not have any problems. What version IBM i OS?
FTRANYYMMDDIF E K DISK rename(TRANYYMMDD:TRANYMDR)
D TRANYMD_I DS likerec(TRANYMDR:*input)
/free
read TRANYMDR TRANYMD_I;
*InLR = *On;
/end-free
Stepped through in debug (stopped after read), displayed TRANYMD_I. I
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mike Wills
-Eric DeLong
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [
Sent: Wednesday, July 13, 2011 9:30 AM'' ,
To: RPG programming on the IBM i / System i
Subject: DDL, likerec DS, and Problems...
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 NULLDEFAULT '' ,
CUSTOMERADDRESS2 FOR COLUMN CUSTADDR2 VARCHAR(50) CCSID 37 NOT NULLDEFAULT '' ,
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 NULLDEFAULT '' ,
PAYMENTDATE FOR COLUMN PAYDATE DATE NOT NULL DEFAULT CURRENT_DATE ,usropn
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)
D TRANYMD_I DS likerec(TRANYMDR:*input)list
/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
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxxlist
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.