Retrieval of data from a file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Abhyankar
Participant
Posts: 15
Joined: Thu Jan 01, 2009 11:04 pm

Retrieval of data from a file

Post by Abhyankar »

Hi,
I have a file. It has lot of columns. However, some columns are together without any space in between them and some have space. For eg:

0000492007-02-28 1020001 1 5066 0.4

000049 is first column
2007-02-28 is second
1020001 is third.

What property do i need to set in my sequential stage to get the same?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That would be a "fixed width" file. In other words, there are no field delimiters and any reader program has to know the length of each field to know where any given one starts and stops.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

You need to set the format property that indicates that the record format is fixed width. For each column you need to specify the display width (which is the number of characters in the record that represent that particular field).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Abhyankar
Participant
Posts: 15
Joined: Thu Jan 01, 2009 11:04 pm

Post by Abhyankar »

Hi,
Thanks for your reply. I am not a Premiuim account holder so i could not see half of your 2nd message.
I did change the format to fixed width. By display width do you mean the Field width that you get after double clicking each column? I changed that also. But got the below mentioned error:

"Short read encountered on import; this most likely indicates one of the following possibilities:
1) the import schema you specified is incorrect
2) invalid data (the schema is correct, but there is an error in the data). "

The schema seems correct, so does the data.
vasa_dxx
Participant
Posts: 39
Joined: Sun Sep 28, 2008 2:59 am
Contact:

Post by vasa_dxx »

Try to read the Records from Data Viewer. If your able to view through Data Viewer, then the schema and other Credentials are supplied correctly. If there is any error, that would be displayed in the error message.
Two wrongs don't make a right. But three lefts do.
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Post by dr.murthy »

vasa_dxx wrote:Try to read the Records from Data Viewer. If your able to view through Data Viewer, then the schema and other Credentials are supplied correctly. If there is any error, that would be displayed in the error message.
data viewer is only for view the data in datastes.is there any way to view the sequential file data from data viewer
D.N .MURTHY
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Totally wrong. The data viewer can display data from almost all sources (one exception is Lookup File Set).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dr.murthy
Participant
Posts: 224
Joined: Sun Dec 07, 2008 8:47 am
Location: delhi

Post by dr.murthy »

ray.wurlod wrote:Totally wrong. The data viewer can display data from almost all sources (one exception is Lookup File Set). ...
hi ray,

i think that is data browser not a data viewer.
D.N .MURTHY
MarkB
Premium Member
Premium Member
Posts: 95
Joined: Fri Oct 27, 2006 9:13 am

Post by MarkB »

dr.murthy wrote: hi ray,

i think that is data browser not a data viewer.
Going back to the problem of the OP and the reply by vasa_dxx, I believe what is meant is that, in the Sequential File Stage, click on View Data, and see what the result is.
MarkB
Premium Member
Premium Member
Posts: 95
Joined: Fri Oct 27, 2006 9:13 am

Post by MarkB »

dr.murthy wrote: hi ray,

i think that is data browser not a data viewer.
Going back to the problem of the OP and the reply by vasa_dxx, I believe what is meant is that, in the Sequential File Stage, click on View Data, and see what the result is.
Post Reply