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
raji33
Premium Member
Posts: 151 Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ
Post
by raji33 » Sun Nov 07, 2010 5:04 pm
Hi,
Can we use new line character as delimiter?
If yes, can anyone please suggest me how to use the \n as delimiter.
Thanks in advance
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sun Nov 07, 2010 8:08 pm
What kind of delimiter - field, record? Where?
A UNIX newline is a CHAR(10), by the way, depending on the 'where' you can use that function or perhaps the value '010' by itself.
-craig
"You can never have too many knives" -- Logan Nine Fingers
raji33
Premium Member
Posts: 151 Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ
Post
by raji33 » Mon Nov 08, 2010 9:35 am
Hi craig,
I have actually used the filter command in sequential file i used this command
tr -s "\n" ','
but it is saying error in command
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Mon Nov 08, 2010 9:56 am
What is your record delimiter?
You are the creator of your destiny - Swami Vivekananda
raji33
Premium Member
Posts: 151 Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ
Post
by raji33 » Mon Nov 08, 2010 11:27 am
, is my record delimiter
nitkuar
Participant
Posts: 46 Joined: Mon Jun 23, 2008 3:09 am
Post
by nitkuar » Mon Nov 08, 2010 11:39 am
I guess you are looking for the usage of UNIX newline as record delimiter.
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Mon Nov 08, 2010 11:45 am
Can you show your input?
You are the creator of your destiny - Swami Vivekananda
raji33
Premium Member
Posts: 151 Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ
Post
by raji33 » Mon Nov 08, 2010 12:06 pm
ya your right my input is jill file
insert_job: template
job_type:c
command: ls -l
machine: localhost
owner: lyota01@TANT-A01
days_of_week: all
description: "description field"
std_err_file: /tmp/std_err
this by filter commnad iam changing,nelinw as ,
with filter command in sequential file
tr -s '\n' ','
raji33
Premium Member
Posts: 151 Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ
Post
by raji33 » Mon Nov 08, 2010 12:07 pm
ya your right my input is jill file
insert_job: template
job_type:c
command: ls -l
machine: localhost
owner: lyota01@TANT-A01
days_of_week: all
description: "description field"
std_err_file: /tmp/std_err
this by filter commnad iam changing,nelinw as ,
with filter command in sequential file
tr -s '\n' ','
nitkuar
Participant
Posts: 46 Joined: Mon Jun 23, 2008 3:09 am
Post
by nitkuar » Mon Nov 08, 2010 12:13 pm
Just curious, why do you want to first convert newline to ',' character and then want to use ',' character as record delimiter.
Simply use UNIX newline as record delimiter without any substitution.
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Mon Nov 08, 2010 12:17 pm
Simple tr command wont work for your case. Because tr converts entire input file into a single line where all fields and records are separated by comma.
Do you all 8 fields in all the records?
You are the creator of your destiny - Swami Vivekananda
raji33
Premium Member
Posts: 151 Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ
Post
by raji33 » Mon Nov 08, 2010 12:20 pm
sorry for the confussion nitkaur newline is not , i dont know exactly what it is but what ever it may be iam converting that to , by using that command in filter
raji33
Premium Member
Posts: 151 Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ
Post
by raji33 » Mon Nov 08, 2010 12:23 pm
yes anbu that what exactly i want then in transformaer i will use field function and pick the 2nd field
nitkuar
Participant
Posts: 46 Joined: Mon Jun 23, 2008 3:09 am
Post
by nitkuar » Mon Nov 08, 2010 12:26 pm
raji33 wrote: i dont know exactly what it is but what ever it may be iam converting that to , by using that command in filter
if you don't know exactly what it is, then how could you substitute it with another character.
Did you try using my other solution.
raji33
Premium Member
Posts: 151 Joined: Thu Sep 23, 2010 9:21 pm
Location: NJ
Post
by raji33 » Mon Nov 08, 2010 12:34 pm
you may be right but iam idea was i want complete input to come in oneline
saylike this
Job type command machine
nsert_job: template job_type:c command: ls -l machine: localhost
now in transformer Field(inputcolumn,':',2)
this will be iam derivation
and i have implemented in 8.01 version but i dnt know y iam getting these errors in 7.5