Error With Long Description containing EOR

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
asitagrawal
Premium Member
Premium Member
Posts: 273
Joined: Wed Oct 18, 2006 12:20 pm
Location: Porto

Error With Long Description containing EOR

Post by asitagrawal »

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 !
Share to Learn, and Learn to Share.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:?: 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:

Code: Select all

Convert(CHAR(13):CHAR(10),"",YourFieldName)
One example. That replaces all <CR><LF> pairs with an empty string, effectively removing them.
-craig

"You can never have too many knives" -- Logan Nine Fingers
asitagrawal
Premium Member
Premium Member
Posts: 273
Joined: Wed Oct 18, 2006 12:20 pm
Location: Porto

Post by asitagrawal »

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..
Share to Learn, and Learn to Share.
RaviSrivastava
Participant
Posts: 4
Joined: Fri Apr 09, 2004 12:25 pm

Post by RaviSrivastava »

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..
Asit, you can also try the following:
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.
asitagrawal
Premium Member
Premium Member
Posts: 273
Joined: Wed Oct 18, 2006 12:20 pm
Location: Porto

Post by asitagrawal »

Hi All,

I used the "Columns Contains Terminator 0 yes" and it helped..
Thx a lot!!
Share to Learn, and Learn to Share.
Post Reply