Hi,
When I'm writing to a Fixed Width File I'm getting the Following Warning.
MedPxiProcessJob.953.MedPxiOut1_Seq.PXI_OUT_1_Lnk: put_fixedwidth() - data for column MED_NON_COVD_REAS_CD exceeds column width (4), row 39711 (approx), data = T42
The Column is Of type VarChar and length is 4 . But when i checked the data its only 3 char long.
I am getting similar error for another column of dataype VarChar and length 6 .
The only thing which is common is that the data for the above types is of length 3. So does that mean that when the length is specified as 4 or 6 or more the data should contain 3 or more characters.
Problem When Writing to Sequential File
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am
Could you add a dummy column to your output with the derivation of LEN(PXI_OUT_1_Lnk.MED_NON_COVD_REAS_CD ) to make 100% certain that this string is of length 3 and doesn't contain padded spaces and/or non-displayable characters? The length limitation given in DataStage server jobs will not truncate a string that is longer - for instance, if your source data reading from a sequential file contains "Hello World" while the definition is VarChar(5) it will keep the full string in DataStage, and potentially give an error message when writing to a fixed-length field smaller than 11.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am
Force a length by using a derivation like In.ColName[1,3] to limit it to 3 chars regardless of source length. Does the error still occur?
And I am quite confused by you saying that in some cases you found an extra character but the file was perfect.
It is never wise to mix CHAR and VARCHAR types and relying on implicit conversions in Server jobs. Explicitly TRIM and PAD your strings when you output to a fixed length file.
You can change your file format to variable length to help you debug your problem - you can then use an editor to see the file line 39711 and it's contents. Best to use a binary editor to see unprintable characters instead of the normal vi.
And I am quite confused by you saying that in some cases you found an extra character but the file was perfect.
It is never wise to mix CHAR and VARCHAR types and relying on implicit conversions in Server jobs. Explicitly TRIM and PAD your strings when you output to a fixed length file.
You can change your file format to variable length to help you debug your problem - you can then use an editor to see the file line 39711 and it's contents. Best to use a binary editor to see unprintable characters instead of the normal vi.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 112
- Joined: Mon Jul 11, 2005 7:54 am