sequential File
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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 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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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...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
Thanks,
RK
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
OK, in spite of your tr not behaving like the man pages say it ought, try this:
If that doesn't work, try using Ctrl-@, shown as ^@ below.
Code: Select all
tr -d \x0 < #$FILEDIR#/#File#.ld > #$FILEDIR#/#File#_#Name#.ld
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod wrote:OK, in spite of your tr not behaving like the man pages say it ought, try this:If that doesn't work, try us ...Code: Select all
tr -d \x0 < #$FILEDIR#/#File#.ld > #$FILEDIR#/#File#_#Name#.ld
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