Importing Sequential Data Structure

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Importing Sequential Data Structure

Post by clarcombe »

I am having difficulty importing a txt sequential data structure created from an Excel sheet.

I want to be able to specify all of the columns as well as their properties i.e. key field,data type, length etc.

Is this possible or is it only possible to choose the column names by ticking the first row is columns names box

TIA

Colin
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
mk_ds09
Participant
Posts: 72
Joined: Sun Jan 25, 2009 4:50 pm
Location: Pune

Post by mk_ds09 »

Hi Colin..

whether you are having file which contain some data with the structure you had defined..

I had a file which is having txt sequential data struture and some data in it i had imported it structure...

There is option while importing the structure, comma seprated...
if you select that option... DS will take care of rest..it will create the data type and length according to your data...( that's what i got ! )

I am not sure regarding how it works for key fields...
however it is worked for the data type and length..

hope this helps..

------------------------------
MK
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Thankyou

I have seen this working, but it doesnt define the columns as I want

I want to define them myself but without have to type the data

e.g. FIELD1, KEY, VARCHAR(2), NOT NULL are all definitions I have in my excel text file. Somehow I need to convey all of this to Datastage but I can't see how.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... you don't have an Excel spreadsheet of csv data but rather one with the appropriate metadata? Something like one row per field? If that's the case, you won't be able to import it as the importer is expecting to determine the data types / lengths / etc from the actual data that it sees in the first few rows of your example file. And yes, it can automatically set the field names if the first record has all of the column names and they are valid names - start with a letter, no spaces, etc.

There has been conversations on this subject here in the past, and I believe people may have built something to do what it seems you would like to do, but it doesn't ship with the product. Well... except perhaps until the 8.x world with the "FastTrack" module.
-craig

"You can never have too many knives" -- Logan Nine Fingers
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Yes, I have the metadata not the data. It should have read
IN an excel sheet
and
not FROM an excel sheet
I did search quite extensively on this before posting but I found no relevant conversations.

If this is the case, I will import just the fieldnames and modify the rest by hand.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And just to confirm, this is what kind of metadata... meaning, metadata for what? I was assuming for a sequential file but did you mean table metadata delivered in a sequential file? Or something else?
-craig

"You can never have too many knives" -- Logan Nine Fingers
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Its a COBOL schema converted into Datastage metadata.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

OK. If you want to pursue your original methodology, here's how I would attempt it. First take some saved metadata of the type you need to create and save it through the Manager into a .dsx file. Make sure you have a representative sample of the various types you need. Open and study the .dsx file and then build something - a server job, most likely - to read your metadata and create a .dsx file that you would then import to get things into your repository.

Simple, yes? :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
clarcombe
Premium Member
Premium Member
Posts: 515
Joined: Wed Jun 08, 2005 9:54 am
Location: Europe

Post by clarcombe »

Simple Yes. Timesaving...hmm.

I have created several text files from the metadata using the field names and the data as a replicated character dependant on the field length.

When I import this I get Varchar(255) Display N and then I copy N into the Varchar length. Not as elegant as your suggestion but a cheap "pound shop" alternative.

Thanks.
Colin Larcombe
-------------------

Certified IBM Infosphere Datastage Developer
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Of course, the timesaving aspect would come from how many times you needed to do this, assuming many times then yes. Once or twice... not so much.
-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 »

If you still have the COBOL FD you can import that directly. There is no other way to import table definitions from table definitions. (You could consider converting the metadata that you have into an Orchestrate record schema and import that but that would be time consuming, at least the first time.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply