Page 1 of 1

How to get rid of new line return in Datastage basic code

Posted: Tue Aug 05, 2008 8:47 pm
by agathaeleanor
Hi all,

I've a shell script to get date from table, then print it to datastage.

In shell script the date returned is fine but when it went to datastage, it returned date follow by a new line. Thus making the child job inherit the parameter(date) to a null value. Suspect it takes value at the new line which is null.

I've tried trim, and substring but doesnt seem working anyway.
Is there any solution to get rid of newline returned?

Thanks in advance for your help.


agatha

Posted: Tue Aug 05, 2008 8:51 pm
by ray.wurlod
What character did you trim? New lines are usually converted to field marks, so that you need to trim @FM characters.

Posted: Tue Aug 05, 2008 9:08 pm
by agathaeleanor
Previously, I was trimming a space.

vFDATE = ScreenOutput
vFROM_DATE = TRIM(vFDATE," ","A")

Appreciate if you could provide a an example on how to use trim @FM.

Thanks.

agatha

Posted: Tue Aug 05, 2008 9:14 pm
by chulett
Put @FM where you have " ".

Posted: Tue Aug 05, 2008 9:20 pm
by agathaeleanor
It seems not working....
Date returned follow by a new line.
I'm currently using datastage version 7.5

Posted: Tue Aug 05, 2008 9:22 pm
by chulett
Then it seems you may need to trim a 'newline' directly - CHAR(10) rather than @FM.

Posted: Tue Aug 05, 2008 9:33 pm
by agathaeleanor
It's my fault.

I put
vFROM_DATE = TRIM(vFDATE,"@FM ","A")

and now i changed it to
vFROM_DATE = TRIM(vFDATE,@FM,"A")

it works now.
Thank you very much for your help and instant reply.

agatha

Posted: Tue Aug 05, 2008 9:34 pm
by ray.wurlod
You're welcome, though "instant reply" was simply a matter of luck (time zone of my current location, lunch break). Craig, of course, never sleeps.

Posted: Tue Aug 05, 2008 9:39 pm
by agathaeleanor
Anyway, really appreciate your help :P

Posted: Tue Aug 05, 2008 9:51 pm
by chulett
:lol: