split the long line into multiple lines
Moderators: chulett, rschirm, roy
split the long line into multiple lines
Hi,
I need to be able to split large string variables into multiple lines, each line can be no longer than 70 chars.
The string variables are text, so I would additionally like the lines
to end at the end of a word
Now, with a limit of 70 chars per line (and lines *must* end with a
completed word)
ex-
Keying variance message to see what looks like on invoice.Keying really long first line
if I split exactly at 70 charcaters the word "Really" is goingto split into 2 lines.What I need hereis
Keying variance message to see what looks like on invoice.Keying
really long first line
can you please help me ow to do this
Thank you in advance in
I need to be able to split large string variables into multiple lines, each line can be no longer than 70 chars.
The string variables are text, so I would additionally like the lines
to end at the end of a word
Now, with a limit of 70 chars per line (and lines *must* end with a
completed word)
ex-
Keying variance message to see what looks like on invoice.Keying really long first line
if I split exactly at 70 charcaters the word "Really" is goingto split into 2 lines.What I need hereis
Keying variance message to see what looks like on invoice.Keying
really long first line
can you please help me ow to do this
Thank you in advance in
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use a BASIC Transformer stage (or a server job) and, within that, use the Fmt() function - which you can read about in the DataStage BASIC manual or the on-line help - with a "70T" format as the second argument. This will do precisely what you ask. Convert any text marks into field marks or newline 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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
HI Ray, Thanks for your reply.
I need to split the long line into multiple lines and write these to table records
Based on your input my idea is write this to sequential file adding some delimiter between these and read the input file by delimiter
I did like this. I added new line feed after every 70 characters and loaded into sequential file. and then read this with new line character
It is not writing to the file
field(Fmt(InvcReconMsg.BLRT_RECON_TXT, "70T"),@TM,1,1) :char(10):field(Fmt(InvcReconMsg.BLRT_RECON_TXT, "70T"),@TM,2,1)
Where did i do wrong
Thank you
I need to split the long line into multiple lines and write these to table records
Based on your input my idea is write this to sequential file adding some delimiter between these and read the input file by delimiter
I did like this. I added new line feed after every 70 characters and loaded into sequential file. and then read this with new line character
It is not writing to the file
field(Fmt(InvcReconMsg.BLRT_RECON_TXT, "70T"),@TM,1,1) :char(10):field(Fmt(InvcReconMsg.BLRT_RECON_TXT, "70T"),@TM,2,1)
Where did i do wrong
Thank you
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You tried to do too much. Try:
Code: Select all
Convert(@TM,@FM,Fmt(InvcReconMsg.BLRT_RECON_TXT, "70T"))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Thank s ray.
I am using basic transformer in paralle job
Now i can write to the seq file
KEYING VARIANCE MESSAGE TO SEE WHAT LOOKS LIKE ON INVOICE. KEYING ?REALLY LONG FIRST LINE. PLEASE PAY THE FOLLOWING ADJUSTMENTS:
now i need to read this into multiple lines and write to the table. i tried with UNIXnew line delimiter when I read the file.but it is not reading.
'?' is this the record delimiter
Thank
I am using basic transformer in paralle job
Now i can write to the seq file
KEYING VARIANCE MESSAGE TO SEE WHAT LOOKS LIKE ON INVOICE. KEYING ?REALLY LONG FIRST LINE. PLEASE PAY THE FOLLOWING ADJUSTMENTS:
now i need to read this into multiple lines and write to the table. i tried with UNIXnew line delimiter when I read the file.but it is not reading.
'?' is this the record delimiter
Thank
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
No, the @FM character is automatically converted to UNIX linefeed by the DataStage internals. Check the file with a non-DataStage text viewer. Also make sure that your metadata contain just a single VarChar field when writing.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: