ASCII format showing some low characters
Moderators: chulett, rschirm, roy
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
ASCII format showing some low characters
Hi All
I am having one issue here.
I am having an ASCII file with some data.When i am looking at the data in the UltraEdit instead of real spaces i am having some low characters there.
Ex:
D27......R...23456
There should be spaces instead of dots there.Any suggestions.
Thanks
Sam
I am having one issue here.
I am having an ASCII file with some data.When i am looking at the data in the UltraEdit instead of real spaces i am having some low characters there.
Ex:
D27......R...23456
There should be spaces instead of dots there.Any suggestions.
Thanks
Sam
How big is the file, and what do you want to do about the low ASCII values? If the file is small and you want the low values swapped to a space, a simple filter using sed could swap out the values. Anything larger and complicated could require some work.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Are you creating the file or is it coming to you? If you're creating it, where are you getting it? You'll have to put some derivation logic on the interested columns.
If the file is coming to you this way, you'll have to address the file prior to reading it with PX.
If the file is coming to you this way, you'll have to address the file prior to reading it with PX.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Hi ken,
I am creating this file. Can i do anything before loading this thing in the sequential file.Orelse can i do something in my sequence job where i am concatinating the detail and trailer recors in one file.Like using some unix commands.....
Hi Ray,
Will it be an issue if we get the thing like that or we can ignore it?
Thanks
Sam
I am creating this file. Can i do anything before loading this thing in the sequential file.Orelse can i do something in my sequence job where i am concatinating the detail and trailer recors in one file.Like using some unix commands.....
Hi Ray,
Will it be an issue if we get the thing like that or we can ignore it?
Thanks
Sam
Sam,
since you are creating this file you can strip out or replace the offending non-displayable characters yourself. You can even write a simple DataStage job to read a file and do this. Do you know the ASCII code(s) of the characters that are getting inserted into the file? You've stated "low characters" but that could include anything lower than ASCII 32 (space).
You can use sed in UNIX to modify your file, but in order to get a suggestion on how to do that from here you might want to specify exactly what you need done to what characters.
since you are creating this file you can strip out or replace the offending non-displayable characters yourself. You can even write a simple DataStage job to read a file and do this. Do you know the ASCII code(s) of the characters that are getting inserted into the file? You've stated "low characters" but that could include anything lower than ASCII 32 (space).
You can use sed in UNIX to modify your file, but in order to get a suggestion on how to do that from here you might want to specify exactly what you need done to what characters.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Sam - Check the option available in the edition. And try to turn of the "Show space and tabs" option. If enabled will show you spaces, new line character, tabs...
It is an additional feature available in the editior.
So there is nothing to do with your job. Veiw the same file in unix, with vi option. It should look good.
It is an additional feature available in the editior.
So there is nothing to do with your job. Veiw the same file in unix, with vi option. It should look good.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Hi ARND,ArndW wrote: You've stated "low characters" but that could include anything lower than ASCII 32 (space).
You can use sed in UNIX to modify your file, but in order to get a suggestion on how to do that from here you might want to specify exactly what you need done to what characters.
I am getting dots instead of spaces. If possible i just want to get rid of any low character with space.
Thanks
Sam
You stated that you are creating this file. How (a DataStage EE Job, a script)?
You can use some of the Transform stage functions in either EE or Server to manipulate characters. I think some of us are confused because you have said that you create the file but you want to remove "low characters" without really having said which low characters and also where you want to replace them with spaces. There are so many ways that this can be done from a DataStage job to a simple sed script; but the best would be not get them those invalid characters there in the first place [which is why you've been asked about where the file gets created in the first place].
You can use some of the Transform stage functions in either EE or Server to manipulate characters. I think some of us are confused because you have said that you create the file but you want to remove "low characters" without really having said which low characters and also where you want to replace them with spaces. There are so many ways that this can be done from a DataStage job to a simple sed script; but the best would be not get them those invalid characters there in the first place [which is why you've been asked about where the file gets created in the first place].
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
HiArndW wrote:You stated that you are creating this file. How (a DataStage EE Job, a script)?
You can use some of the Transform stage functions in either EE or Server to manipulate characters. I think some of us are confused because you have said that you create the file but you want to remove "low characters" without really having said which low characters and also where you want to replace them with spaces. There are so many ways that this can be done from a DataStage job to a simple sed script; but the best would be not get them those invalid characters there in the first place [which is why you've been asked about where the file gets created in the first place].
I am creating this file in a Datastage EE job. I don't understand y i am getting those and as i said i am just being able to see that dots when i am checking the hex dump in UltraEdit. Maybe this is confusing but i don't know how to proceed further. But according to my understanding i need to replace hex '00' with '20'.(NUL Ascii character with the Space.)Can someone help me how to do this thing using ereplace or any other transform function.
Thanks
Sam
If you are generating the in a EE job then this is the best place to get rid of them. You can do a CONVERT(CAHR(000),' ',In.ColumnName) in a EE transform stage (the syntax is the same as that for a server job).
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Hi Sam..
There is one possible reason for the Low values. When u put a varchar field into a Char(N) Field, then EE Stage by default appends the remaning length with Lower values.
The solution for this is U trim the Source Field and explicitly append the rest of the Field Lenght with Spaces.
ex: Trimf(TrimB(SOURCE_COLUMN) : Str(' ',OUT_COLUMN_LENGTH -(Len(TrimF(TrimB(SOUCE_COLUMN)))))
let me know if this helps.
Regards.
Kiran.
There is one possible reason for the Low values. When u put a varchar field into a Char(N) Field, then EE Stage by default appends the remaning length with Lower values.
The solution for this is U trim the Source Field and explicitly append the rest of the Field Lenght with Spaces.
ex: Trimf(TrimB(SOURCE_COLUMN) : Str(' ',OUT_COLUMN_LENGTH -(Len(TrimF(TrimB(SOUCE_COLUMN)))))
let me know if this helps.
Regards.
Kiran.
g.kiran
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA