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

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
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

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

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What character did you trim? New lines are usually converted to field marks, so that you need to trim @FM characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Put @FM where you have " ".
-craig

"You can never have too many knives" -- Logan Nine Fingers
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Post by agathaeleanor »

It seems not working....
Date returned follow by a new line.
I'm currently using datastage version 7.5
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then it seems you may need to trim a 'newline' directly - CHAR(10) rather than @FM.
-craig

"You can never have too many knives" -- Logan Nine Fingers
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

Post by agathaeleanor »

Anyway, really appreciate your help :P
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:lol:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply