sequential File

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

g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

sequential File

Post by g_rkrish »

hi,

i have a issue here..i need a sequential file formt like

|513533202005135|03/16/2007|10|M|02/19/2007|01/01/1900|1|

so what i gave in proerty is s delimiter as | and the quote character as 000 but i am having error in the records having hex00 added to it..is there any other property that i can set so that i can have no hexa character in there records it should just the fields delimted by |..Pls help me out...
RK
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use a Filter to pre-process the file to remove the \x00 characters, perhaps using a tr command. The Sequential File stage reads stdout of the filter command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

ray.wurlod wrote:Use a Filter to pre-process the file to remove the \x00 characters, perhaps using a tr command. The Sequential File stage reads stdout of the filter command. ...
cat filename1.txt | tr '\x00' '' > filename2.txt

I gave this command as after job subroutine but it is gving me the error..but when i do the same command in my command prompt it works...Pls help me out...
RK
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

...but it is gving me the error..
What error message are you getting? Remember, your current working directory will be that of the DataStage project, you should always use fully qualified pathnames.
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

ArndW wrote:
...but it is gving me the error..
What error message are you getting? Remember, your current working directory will be that of the DataStage project, you should always use fully ...
the error am getting is

Output from command ====>
tr: Error 0
yes am using fully qualified path names..

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

Post by ArndW »

Does your job have the path to the "tr" executable set? Check the 1st line of the log file where it shows the environment and compare it to the environment setting for your terminal command session.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why after-job?!!! I suggested a Filter command in a Sequential File stage. The command should be tr -d \x00 filename if reading the file.

If you must use an after-job subroutine, then you need to specify (redirect) input and output file names for the tr -d command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

ArndW wrote:Does your job have the path to the "tr" executable set? Check the 1st line of the log file where it shows the environment and compare it to the environment setting for your terminal command session. ...
i tried running the same command in my project directory where my dsjob run..the command works..but i don't know why it is not working through DS....
RK
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Look in your job log to see what command was actually executed by ExecSH.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

or use an absolute path to your tr command in your job to see if that works.
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

ray.wurlod wrote:Look in your job log to see what command was actually executed by ExecSH. ...
I looked in to the log it is executing the whole command but it is giving error at the tr command....
RK
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

ArndW wrote:or use an absolute path to your tr command in your job to see if that works. ...
I tried that one too it did not work..i could not fine the exact reason why it is not executing...
RK
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please advise:
(a) exactly what tr command was executed (and specifically what quote characters were involved)
(b) the exact error message that was generated by the tr command
(c) what version of the operating system you are using (uname -a)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

ray.wurlod wrote:Please advise:
(a) exactly what tr command was executed (and specifically what quote characters were involved)
(b) the exact error message that was generated by the tr command
(c) wha ...

a)
The tr command was tr '\x00' ''

b)error in executing the command Output from command ====>
tr: Error 0

c)the version of my os is AIX 5.3

Pls let me know if you need any more info....

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

Post by ArndW »

Are you executing tr as UNIX shell in the after-job? Also, what happens if you change your command to read:

Code: Select all

cat filename1.txt | tr \'\x00\' \'\' > filename2.txt 
Post Reply