Reading rows using schema 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
NewPXUser
Participant
Posts: 17
Joined: Fri Feb 11, 2005 6:06 am

Reading rows using schema file

Post by NewPXUser »

Hi All,

I am trying to read row from a sequential file using column defn from a schema file.

The schema file has

Code: Select all

record (
  account_number: decimal[4, 0];
  phone_nbr: decimal[1, 0];
)
and the sequential file has

Code: Select all

1111,1
2222,2
3333,3
4444,4
Questions:
1.) I am not able to view data unless and otherwise I provide the column defn.s in the column tab. Why?
2.) When I run this job (without col defn), it returns the warning message for each row, which is some like below
Sequential_File_0,0: Field "account_number" has import error and no default value; data: {1 1 1 1 , 1}, at offset: 0
Why does this appear as the data matches the column requirements?
3.) How to make this job work? :(

Thanks in advance.
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi NewPXUser,

If you want to use a schema file for a sequential file then you create a dummy job which loads a fileset with the following column configuration. Open the fileset and get the schema structure. Use the schema structure for the sequential file. Hope this resolves all your issues.

Keep us posted.

Rich
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

DataStage is dumb. Dumb. Dumb dumb dumb.

It does not read minds.

It does not know what the intent of something is.

It does not know what is right, what is wrong, where things are, and where things should be.

Keep that in mind, and whenever you tell DataStage to do something, you have to tell it everything that it needs to know, including what the column formats are.

DataStage heavily depends on metadata to get things done. It is not a dynamic language in that sense.

I hope this answers your question.
NewPXUser
Participant
Posts: 17
Joined: Fri Feb 11, 2005 6:06 am

Post by NewPXUser »

T42,

With no disrespect, all I asked for is someone to point out what the mistake with the schema file defn that gives raise to the warning during runtime. i.e. is the data content not a decimal or must some special parameters need to be set to read the specified format etc.

This is why I mentioned the sentence
'First time schema usage. So need help'
in the additional info box.

I have used DataStage Server Edition and am trying to understand the usage of schemas as we have requirements for partial schemas in our project.

So if anyone can guide me through this initial stage, it will be very helpful.
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi NewPXUser,

Did you try the solution I had provided.

Rich
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
If my mempory serves me ....
Not 100% sure of this so give it a try.
When reading from an ascii sequential file using C/C++ which is the parallel jobs always read as char/varchar and such types even if you deal with numbers.
later "Modify" the column types to suite your needs.

to verify this try defining your columns as char/varchar types and see if the import error persists.

please post your findings :).

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply