Getting less spaces in viewing the data from seqfile
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 31
- Joined: Thu Jul 05, 2007 11:57 pm
- Location: India
- Contact:
Getting less spaces in viewing the data from seqfile
Hi,
We are getting one space less in the middle of a string when viewing the data through seqfile, but the same data when viewd in unix is showing correct.
data is of type varchar(50)
ex:
in seqfile : "GATEWAY NEW BUSINESSxx14.9"
( spaces are shown as x)
while viewing from unix : "GATEWAY NEW BUSINESSxxx14.9
Thanks,
Sultan
We are getting one space less in the middle of a string when viewing the data through seqfile, but the same data when viewd in unix is showing correct.
data is of type varchar(50)
ex:
in seqfile : "GATEWAY NEW BUSINESSxx14.9"
( spaces are shown as x)
while viewing from unix : "GATEWAY NEW BUSINESSxxx14.9
Thanks,
Sultan
Thanks
Sultan
Sultan
Re: Getting less spaces in viewing the data from seqfile
Code: Select all
data is of type varchar(50)
ex:
in seqfile : "GATEWAY NEW BUSINESS 14.9"
while viewing from unix : "GATEWAY NEW BUSINESS 14.9
What tool are you using to "view" the data? If you read the file in DataStage and output a LEN(In.String) is the correct lenght displayed?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 31
- Joined: Thu Jul 05, 2007 11:57 pm
- Location: India
- Contact:
Re: Getting less spaces in viewing the data from seqfile
We are viewing the data from datastage seqfiles (View Data). Also loaded the data in to a table and found the length...it is giving one byte lessArndW wrote:(I used code mark so that the spaces display)Code: Select all
data is of type varchar(50) ex: in seqfile : "GATEWAY NEW BUSINESS 14.9" while viewing from unix : "GATEWAY NEW BUSINESS 14.9
What tool are you using to "view" the data? If you read the file in DataStage and output a LEN(In.String) is the correct lenght displayed?
Thanks
Sultan
Sultan
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 31
- Joined: Thu Jul 05, 2007 11:57 pm
- Location: India
- Contact:
-
- Participant
- Posts: 31
- Joined: Thu Jul 05, 2007 11:57 pm
- Location: India
- Contact:
I think that "cat -v" will show the problem, as HariK has suggested.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
do a hex or octal dump of the file data (use "od" or a similar tool). I am certain that one of those spaces is not like the others (the not-so-subtle reference is intended).
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 31
- Joined: Thu Jul 05, 2007 11:57 pm
- Location: India
- Contact:
We have converted these data to hex with the help of od -x, then only we posted here.ArndW wrote:do a hex or octal dump of the file data (use "od" or a similar tool). I am certain that one of those spaces is not like the others (the not-so-subtle reference is intended).
From unix its given as 3 spaces , in hex its like 202020(space =20 in hex).
From View data in Datastage its like 0920(tab=09 in hex).
Its considering the first space as tab when viwed from DS seq file.
Thanks
Sultan
Sultan
The "view data" in DataStage has always caused problems, particularly in NLS installations, because it does its own interpretation of data and can display differently. In your case, please put an output stage after your source stage that just writes this one column into a flat file, then use "od -x" to see if the spaces are actually present or if there is now a tab in the string. If the spaces remain then you have discovered a problem in "view data" but your program should be unaffected; if there is a TAB now in your string then I would look at your sequential file settings, particularly for the default values of the input columns.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 31
- Joined: Thu Jul 05, 2007 11:57 pm
- Location: India
- Contact:
I have loaded the one coulmn to a flat file, now also TAB is there.There are no default values assigned for this field in source stage while reading.ArndW wrote: In your case, please put an output stage after your source stage that just writes this one column into a flat file, then use "od -x" to see if the spaces are actually present or if there is now a tab in the string. If the spaces remain then you have discovered a problem in "view data" but your program should be unaffected; if there is a TAB now in your string then I would look at your sequential file settings, particularly for the default values of the input columns.
Actually the source file which we are using was creted from the unload script,which unloads from the db2 database table. i have tried to create this file throgh a simple datastage job and now this issue is resolved.
Thanks to all who looked into this issue.
Thanks
Sultan
Sultan