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

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

Post by ray.wurlod »

You failed to tell the tr command which file to process and where to send the output. That's why it failed. Arnd's approach would suffice, unless you were using tr as a Filter command, in which case you would not redirect stdout.
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: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 
...

It works with no error..but
the output file got messed up it removed all the 00 from the file so for ex if the date field is there 20070922..the o/p is 2 7 9.....



Thanks,
RK
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? Post the exact command you are using and how you are executing it. Exact. Copy/paste the entire thing, not selective samples like you've done before and not what Arnd wrote - your command.
-craig

"You can never have too many knives" -- Logan Nine Fingers
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Post by g_rkrish »

chulett wrote::? Post the exact command you are using and how you are executing it. Exact. Copy/paste the entire thing, not selective samples like you've done before and not what Arnd wrote - your command.

cat #$FILEDIR#/#File#.ld | tr \ '\x00' \ '\' > #$FILEDIR#/#File#_#Name#.ld

I did this command on after job subroutine.. as ExecSH.....

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

Post by ray.wurlod »

Try losing the hard quotes, and using the -d option.

Code: Select all

tr -d \x00 < #$FILEDIR#/#File#.ld > #$FILEDIR#/#File#_#Name#.ld 
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:Try losing the hard quotes, and using the -d option.

Code: Select all

tr -d \x00 < #$FILEDIR#/#File#.ld > #$FILEDIR#/#File#_#Name#.ld 
...
Now the o/p of the command is for ex 12/09/2007-----output as 12/9/27...i don't know it is removing all the 0's rather than remvoing the hexa ctrl 00...is the reason is because all 0's are put as hexa ctrl...

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

Post by ray.wurlod »

OK, in spite of your tr not behaving like the man pages say it ought, try this:

Code: Select all

tr -d \x0 < #$FILEDIR#/#File#.ld > #$FILEDIR#/#File#_#Name#.ld 
If that doesn't work, try using Ctrl-@, shown as ^@ below.

Code: Select all

tr -d '^@' < #$FILEDIR#/#File#.ld > #$FILEDIR#/#File#_#Name#.ld 
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:OK, in spite of your tr not behaving like the man pages say it ought, try this:

Code: Select all

tr -d \x0 < #$FILEDIR#/#File#.ld > #$FILEDIR#/#File#_#Name#.ld 
If that doesn't work, try us ...

at last it works..^@ works..i don't why the /x00 or /x0 did not work..i really appreciate Ray,chultte and Arndw for their valuable time in helping me to solve this issue...thanks a lot guys....

thanks,
RK
Post Reply