I have a trigger program that writes the buffer to a file for later batch processing. I was just writing the whole buffer as one 3200 byte field. But I have had issues where Updates to a record were sometimes being processed before the inserts. So I want to write it with the header info and the the remainder of the data, so that I can process all inserts first.
But I am having trouble defining the file with SQL for the following fields. They don't seem to line up.
DPARM1 DS 3200
DFNAME 1 10
DLNAME 11 20
DMNAME 21 30
DTEVEN 31 31
DTTIME 32 32
DCMTLCK 33 33
DFILL1 34 36
DCCSID 37 40B 0
DFILL2 41 48
DOLDOFF 49 52B 0 <<-- These fields marked as binary
DOLDLEN 53 56B 0 <<-- These fields marked as binary
DOLDNULO 57 60B 0 <<-- These fields marked as binary
DOLDNULL 61 64B 0 <<-- These fields marked as binary
DNEWOFF 65 68B 0
DNEWLEN 69 72B 0
DNEWNULO 73 76B 0
DNEWNULL 77 80B 0
DRESV3 81 96
DRDATA 97 3200
I used the folowing SQL statement to build the table.
CREATE TABLE snpsas.tb4211a
(
FNAME CHAR (10),
LNAME CHAR (10),
MNAME CHAR (10),
TEVEN CHAR (1),
TTIME CHAR (1),
CMTLCK CHAR(1),
FILL1 CHAR(3),
CCSID BINARY(4),
FILL2 CHAR(8),
OLDOFF BINARY(4),
OLDNULO BINARY(4),
OLDNULL BINARY(4),
NEWOFF BINARY(4),
NEWLEN BINARY(4),
NEWNULO BINARY(4),
NEWNULL BINARY(4),
RESV3 CHAR(16),
RDATA CHAR(3104)
)
RCDFMT tb4211a
Should I double the length of the binary fields or use another data type?
But I am having trouble defining the file with SQL for the following fields. They don't seem to line up.
DPARM1 DS 3200
DFNAME 1 10
DLNAME 11 20
DMNAME 21 30
DTEVEN 31 31
DTTIME 32 32
DCMTLCK 33 33
DFILL1 34 36
DCCSID 37 40B 0
DFILL2 41 48
DOLDOFF 49 52B 0 <<-- These fields marked as binary
DOLDLEN 53 56B 0 <<-- These fields marked as binary
DOLDNULO 57 60B 0 <<-- These fields marked as binary
DOLDNULL 61 64B 0 <<-- These fields marked as binary
DNEWOFF 65 68B 0
DNEWLEN 69 72B 0
DNEWNULO 73 76B 0
DNEWNULL 77 80B 0
DRESV3 81 96
DRDATA 97 3200
I used the folowing SQL statement to build the table.
CREATE TABLE snpsas.tb4211a
(
FNAME CHAR (10),
LNAME CHAR (10),
MNAME CHAR (10),
TEVEN CHAR (1),
TTIME CHAR (1),
CMTLCK CHAR(1),
FILL1 CHAR(3),
CCSID BINARY(4),
FILL2 CHAR(8),
OLDOFF BINARY(4),
OLDNULO BINARY(4),
OLDNULL BINARY(4),
NEWOFF BINARY(4),
NEWLEN BINARY(4),
NEWNULO BINARY(4),
NEWNULL BINARY(4),
RESV3 CHAR(16),
RDATA CHAR(3104)
)
RCDFMT tb4211a
Should I double the length of the binary fields or use another data type?
Comment