newline character

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
vilasini
Participant
Posts: 32
Joined: Sun Dec 09, 2007 11:48 pm

newline character

Post by vilasini »

Hi,

I need to concatenate some text + newline(\n) + <input field>.
Can any one help how to add newline between some text and input field.

Thanks
Anju
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create a stage variable, let's call it svNewLine. In Windows, of course, the line terminator is actually two characters (carriage return and line feed), so initialize the stage variable to

Code: Select all

Char(13):Char(10)
Don't assign any new value to this stage variable during per-row processing.
The derivation for your output column then becomes

Code: Select all

"some text" : svNewLine : InLink.InputField
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vilasini
Participant
Posts: 32
Joined: Sun Dec 09, 2007 11:48 pm

Post by vilasini »

Hi Ray,

I can view your answer till
"Create a stage variable, let's call it svNewLine. In Windows, of course, the line terminator is actually two characters (carriage return and line feed), so initialize the stage variable to Code:"

till here,can you explain me again how to get newline.

Thanks
Anju
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Anju,


Ray's response is part of Premium content, which you can view if you were to sign up for that relatively inexpensive membership.

Even though the message is not currently viewable in it's entirety, the portion that is visible gives you the clue on how to solve your problem. Basically, a "\n" (UNIX), or <CR><LF> (Windows) is just another string that can be manipulated with normal string functions.
vilasini
Participant
Posts: 32
Joined: Sun Dec 09, 2007 11:48 pm

Post by vilasini »

ok.
my frontend is Wincdows for datastage and backend is Unix.
I dont have an idea how to put a newline using CR /LF in datastage.Can you tell me how to do that.
vilasini
Participant
Posts: 32
Joined: Sun Dec 09, 2007 11:48 pm

Post by vilasini »

Hi ArndW,
my frontend is Wincdows for datastage and backend is Unix.
I dont have an idea how to put a newline using CR /LF in datastage.Can you tell me how to do that.
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

LF (LineFeed) is Char(13)
CR (CursorReturn) is Char(10).

Lets say you want to have a new Line after "John" you code in Unix:

"

Code: Select all

John":char(13)
In windows it is:

Code: Select all

"John":char(13):char(10)
Wolfgang Hürter
Amsterdam
admiral1969
Participant
Posts: 10
Joined: Wed Feb 27, 2008 3:37 am

Post by admiral1969 »

Hi, use the char() function which generates an ASCII character from its numeric code value. Then numeric value of LF is 10 and CR is 13.
So concatenate: "your text" : char(13) : char(10) : <input field>.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Are you sure that you need a Windows format file, as your backend is UNIX?
admiral1969
Participant
Posts: 10
Joined: Wed Feb 27, 2008 3:37 am

Post by admiral1969 »

In UNIX you need only LF - char(10).
vilasini
Participant
Posts: 32
Joined: Sun Dec 09, 2007 11:48 pm

Post by vilasini »

Thanks a lot.Its working now.I used char(10).
admiral1969
Participant
Posts: 10
Joined: Wed Feb 27, 2008 3:37 am

Post by admiral1969 »

U r wellcome :)
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

vilasini, you should tag your post as "unix" not "windows" if your server platform is unix.
Phil Hibbs | Capgemini
Technical Consultant
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please mark the thread as resolved.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply