Hi,
The Problem is my application frontend has a long text box,
where a user can enter 254 characters... It may also contain a sample text like,
"Line1
Line2
Line3"
i.e the text in 3 lines.
Now when such a data is read in the DataStage, using DB2 stage ( in my case )
and is written to a sequential file using the Sequential file stage.
The same file when read, results in the below error message:
nls_read_fixedwidth() - row 17, column DESCR, column unexpectedly ended by EOR
I have tried to write the file in Delimited & Fixed Width.. but none helped...
Please suggest.
Thanks !
Error With Long Description containing EOR
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
Error With Long Description containing EOR
Share to Learn, and Learn to Share.
There are carriage returns in your data. You need to decide - do you want to preserve them or remove them from the data? Load it as is or keep it looking all purty and multi-line like?
Preserve? Changing things like fixed-width or delimited won't help. You need to let DataStage know that there are 'terminators' in that particulay field, data that looks like EOR markers but are really data.
Do this in your reader stage by moving the Columns tab in the Sequential File stage over to the right until you can see the Contains Terminators column. Change that to 'Yes' and you'll be able to read the data as is.
Remove? Before you write the data to the sequential file you need to remove those characters from the field. Use Convert or EReplace to accomplish this:
One example. That replaces all <CR><LF> pairs with an empty string, effectively removing them.
Preserve? Changing things like fixed-width or delimited won't help. You need to let DataStage know that there are 'terminators' in that particulay field, data that looks like EOR markers but are really data.
Do this in your reader stage by moving the Columns tab in the Sequential File stage over to the right until you can see the Contains Terminators column. Change that to 'Yes' and you'll be able to read the data as is.
Remove? Before you write the data to the sequential file you need to remove those characters from the field. Use Convert or EReplace to accomplish this:
Code: Select all
Convert(CHAR(13):CHAR(10),"",YourFieldName)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
Hi Chulett,
I was also thinking on the same lines... had thought of using Convert() to change remove the terminators.
But removal is not to be allowed as per the requirement in my case..I need to preserve.
Well I tried setting the Contains Terminators = yes on the columns tab of the Sequential File Stageat the time of reading...
But unfortunately am getting the below errors:
http://asit.agrawal.googlepages.com/Con ... nators.JPG
http://asit.agrawal.googlepages.com/Con ... Error2.JPG
Actually there are two such columns... one is 44th column and other is the last column...
Can I not have such a column as the last column ???
Please advice..
I was also thinking on the same lines... had thought of using Convert() to change remove the terminators.
But removal is not to be allowed as per the requirement in my case..I need to preserve.
Well I tried setting the Contains Terminators = yes on the columns tab of the Sequential File Stageat the time of reading...
But unfortunately am getting the below errors:
http://asit.agrawal.googlepages.com/Con ... nators.JPG
http://asit.agrawal.googlepages.com/Con ... Error2.JPG
Actually there are two such columns... one is 44th column and other is the last column...
Can I not have such a column as the last column ???
Please advice..
Share to Learn, and Learn to Share.
-
- Participant
- Posts: 4
- Joined: Fri Apr 09, 2004 12:25 pm
Asit, you can also try the following:asitagrawal wrote:Hi Chulett,
I was also thinking on the same lines... had thought of using Convert() to change remove the terminators.
But removal is not to be allowed as per the requirement in my case..I need to preserve.
Well I tried setting the Contains Terminators = yes on the columns tab of the Sequential File Stageat the time of reading...
But unfortunately am getting the below errors:
http://asit.agrawal.googlepages.com/Con ... nators.JPG
http://asit.agrawal.googlepages.com/Con ... Error2.JPG
Actually there are two such columns... one is 44th column and other is the last column...
Can I not have such a column as the last column ???
Please advice..
Convert new line character into some kind of control character. Something that you won't get it your text string, e.g. Oconv("1E","MY") meaning Ctrl^ and then in your next (or final) job change it back to new line before wrtting it to the database.
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto