I'm developing a code wherein my table structure is as follows --
CREATE TABLE TRANSACTION(
TRANSID CHAR(6) NOT NULL,
TRANSTIME TIME NOT NULL WITH DEFAULT,
TRANSDATE DATE NOT NULL WITH DEFAULT,
TRANSAMT DECIMAL(10,2) NOT NULL,
TRANSTYPE CHAR(2) CHECK(TRANSTYPE IN('DA','WA','AT')),
ACCOUNTNO NUMERIC(12),
TOACCOUNTNO NUMERIC(12),
CONSTRAINT TRANS_FKEY1 FOREIGN KEY(ACCOUNTNO) REFERENCES
ACCOUNTS(ACCOUNTNO),
CONSTRAINT TRANS_FKEY2 FOREIGN KEY(TOACCOUNTNO) REFERENCES
ACCOUNTS(ACCOUNTNO),
CONSTRAINT TRANS_PKEY PRIMARY KEY(TRANSID)
)IN db1.ts1 ;
TRANSID CHAR(6) NOT NULL,
TRANSTIME TIME NOT NULL WITH DEFAULT,
TRANSDATE DATE NOT NULL WITH DEFAULT,
TRANSAMT DECIMAL(10,2) NOT NULL,
TRANSTYPE CHAR(2) CHECK(TRANSTYPE IN('DA','WA','AT')),
ACCOUNTNO NUMERIC(12),
TOACCOUNTNO NUMERIC(12),
CONSTRAINT TRANS_FKEY1 FOREIGN KEY(ACCOUNTNO) REFERENCES
ACCOUNTS(ACCOUNTNO),
CONSTRAINT TRANS_FKEY2 FOREIGN KEY(TOACCOUNTNO) REFERENCES
ACCOUNTS(ACCOUNTNO),
CONSTRAINT TRANS_PKEY PRIMARY KEY(TRANSID)
)IN db1.ts1 ;
Now i m passing 2 values to the table as
Accountno and balance in jcl as
//SYSIN DD *
100000000001
0000005000
/*
100000000001
0000005000
/*
Th value is not getting inserted in the table . Sql code error -310 is displayed.
Please help.
The pic clause of accountno and balance is declared in cobol pgm as
01 WS-ACCOUNTNO PIC 9(12).
01 WS-WITHDRAW PIC 9(8)V99.
01 WS-WITHDRAW PIC 9(8)V99.
Please let me know where m I going wrong.