DataStage TX - Error Code 21

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
RRourke
Participant
Posts: 4
Joined: Thu Mar 13, 2003 3:00 pm
Location: Montreal

DataStage TX - Error Code 21

Post by RRourke »

Hi,

I have the following error message from TX:

IDR_CUSTOMER_ID = xxxxx
Starting time: Wed Nov 30 15:47:32 EST 2011 Map failed for IDR_CUSTOMER_ID = xxxxx The error code is 21 Ending time: Wed Nov 30 15:52:05 EST 2011

The pdf gives this as a description:
21* Input valid but unknown data found Enough of the input data to conform to the card definition was recognized, but there was more data at the end of the input stream. Enable the Trace Input setting, re-run the map and read the map trace file (.mtr).

I have done the trace (and it is huge) but nothing seems to be satisfy the error message. I have had problems like this with TX before but they usually occur at BUILD time, this problem only arises after that when the map is called and run.

Anyone had this before and how do your find the problem card/input?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Moved to the TX forum.
-craig

"You can never have too many knives" -- Logan Nine Fingers
RRourke
Participant
Posts: 4
Joined: Thu Mar 13, 2003 3:00 pm
Location: Montreal

Re: ..........

Post by RRourke »

Hi,

I was sure that I had done a scan for INVALID but to be sure I did it again - there are no rows with INVALID.

I tried looking for other key words and the only row that sticks out to me is the following:

Data at offset 166 ('|0|0|0|0|0|20116...') does not match TERMINATOR '<CR><LF>'

Could this cause the Error 21?
rep
Participant
Posts: 82
Joined: Tue Jun 19, 2007 8:04 am
Location: New York City

.....

Post by rep »

Yes, this could be the cause. It's expecting the terminator, but finding the data listed. It's not 100% that it's the problem, but it's worth looking at.

Let's say you have an input with 4 different record types, Header, detail 1, detail 2, detail 3. Each has an initiator, H, D1, D2, and D3. While the Header is required, none of the detail records are. There can be any number of any details record, i.e. record(S).

Let's say your input has the header record, one detail 1 and one detail 3 record.

HDATA
D1TEST
D3TEST1,TEST2

When the map goes to validate the data, it will first look for the header. Being there is only one allowed in the type tree, after the header is validated, it reads the next portion of data expecting the first field of Detail 1.

Being you have a a detail 1 record, it validates it. After it valides the first detail 1 record, it tries to validate the next record for detail 1 again because there can be any number of detail 1 records. In your file though, the next record is a detail3 record, so in the trace file, it will say something like;


(Level 1: Offset 29, len 0, comp 2 of 3, #2, DI 00000001:)
Data at offset 29 ('D3TEST1,TEST2<CR><LF>...') does not match INITIATOR 'D1'
of TYPE X'0005' (TestIniRecordD1 Data).

Now while it gives a message "does not match INITIATOR 'D1", just like you're getting a "doesn't match TERMINATOR", that doesn't mean it's the problem. It just means that because you can have any number of the detail 1 records, it has to make sure whether the data it is reading is a Detail 1 record.

The trace will then say;

(Level 1: Offset 29, len 0, comp 2 of 3, #2, DI 00000001:)
COMPONENT number 2 of TYPE X'0002' (TestIniFile Data):
occurrence 2 is optional and does not exist.

It will then try to valide the next record as Detail 2, but because your data doesn't have one, it will do that same thing for Detail 2, saying the record does not match initiator D2, then it will say D2 is optional and does not exist. It will finally read the next record as Detail 3 and pass validation.

The same thing goes for the does not match TERMINATOR <CR><LF>

Let's say you have the same file defintion, header, detail 1, detail 2, detail 3, BUT, you do not use an initiator, only on the header record has one. Instead, the map knows which record is which because Detail 1 only has one field, while Detail 2 has four field and Detail 3 has eight fields. Now let's say in your data you have a Header record and a Detail 2 record. Each record is comma delimited.


HtestData
Field1 of Detail 2, Field 2 of detail 2, Field 3 of detail 2, Field 4 of detail 2

When the map goes to validate, it reads the header record. This is the only record with an initiator, so it knows it's the header. Now, in your type tree, the next record is Detail one, which is not required, and it only has one field. The map will read; "Field1 of Detail 2" as if it were the first field of Detail 1. Now, it will expect to see the terminator of Detail 1, but, it's not a reading detail one record. The trace files will now give the error that you are getting;

Data at offset 166 (' Field 2 of detail 2, Field 3 of ...') does not match TERMINATOR '<CR><LF>'

Even though this looks like it can be the error, it's not, it's just saying that the data it's reading does not match the terminator of Detail 1, which it is expecting. The next thing the trace file will say is that detail 1 record is optional and does not exisit. It will then validate the same data as the Detail 2 record and pass validation.

So, while that message you are getting may be the problem, it doesn't mean it definitley is, it just means it is expecting a <CR><LF> at the data it is currently reading.
RRourke
Participant
Posts: 4
Joined: Thu Mar 13, 2003 3:00 pm
Location: Montreal

Re: .....

Post by RRourke »

Thanks for the great explanation.

If the rows in the trace following the previously mentionned message are:

(Level 2: Offset 166, len 0, comp 1 of 1, #1, DI 0000002B:)
Data at offset 166 ('|0|0|0|0|0|20116...') does not match TERMINATOR '<CR><LF>'
of TYPE X'0524' (Row WK_REGTOLL_Usage_DTL Data).

(Level 2: Offset 0, len 0, comp 1 of 1, #1, DI 00000001:)
COMPONENT number 1 of TYPE X'0523' (USAGE_KEY_GRP WK_REGTOLL_Usage_DTL Data):
occurrence 1 is optional and does not exist.

(Level 1: Offset 0, len 0, comp 1 of 1, #1, DI 00000001:)
COMPONENT number 1 of TYPE X'0522' (DBSelect WK_REGTOLL_Usage_DTL Data):
occurrence 1 is optional and does not exist.

INPUT 48 exists (5157 bytes) but has no content.

End of Validation messages for INPUT CARD 48.

Would the exist but no content let us know there is a problem?
jvmerc
Participant
Posts: 94
Joined: Tue Dec 02, 2003 12:57 pm

Post by jvmerc »

Start at the end of the file can count back 5157 bytes. the 1st byte before that point was the last one it could validate thru the end of a segment. After that it got lost.

If the file is 5157 bytes in total it could not identify the begining or end of segment/record/row.

It appears that it thinks your record should end at byte 166 with a carrage return line feed. "Data at offset 166 ('|0|0|0|0|0|20116...') does not matchTERMINATOR '<CR><LF>' "
Post Reply