Page 1 of 1

newline character

Posted: Tue Mar 04, 2008 1:06 am
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

Posted: Tue Mar 04, 2008 2:05 am
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

Posted: Tue Mar 04, 2008 2:24 am
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

Posted: Tue Mar 04, 2008 2:28 am
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.

Posted: Tue Mar 04, 2008 3:40 am
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.

Posted: Tue Mar 04, 2008 3:40 am
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.

Posted: Tue Mar 04, 2008 3:57 am
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)

Posted: Tue Mar 04, 2008 3:58 am
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>.

Posted: Tue Mar 04, 2008 4:10 am
by ArndW
Are you sure that you need a Windows format file, as your backend is UNIX?

Posted: Tue Mar 04, 2008 4:37 am
by admiral1969
In UNIX you need only LF - char(10).

Posted: Tue Mar 04, 2008 4:40 am
by vilasini
Thanks a lot.Its working now.I used char(10).

Posted: Tue Mar 04, 2008 4:49 am
by admiral1969
U r wellcome :)

Posted: Tue Mar 04, 2008 5:49 am
by PhilHibbs
vilasini, you should tag your post as "unix" not "windows" if your server platform is unix.

Posted: Tue Mar 04, 2008 6:01 am
by ray.wurlod
Please mark the thread as resolved.