How to load column metadata into sequential file target

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
jagan1976
Participant
Posts: 3
Joined: Thu Jun 01, 2006 11:08 pm

How to load column metadata into sequential file target

Post by jagan1976 »

I have a flat file source(Sequential file) which contains more than 100 columns. Now I need to load the target,as same as structure of the source file. It means, the no. of columns in the source file will become the no. of rows in the target file.
For ex:
Source: eno ename sal
1 a 100
2 b 200
3 c 300

Target : field_name data_type length
eno number 10
ename char 2
sal number 10

Anybody can let me know how to do in datastage.

will DSSTAGEINFO work??
if possible can u give me hint regarding how to write in routine.

thanx n regards,
jagan
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Welcome Aboard :D
the no. of columns in the source file will become the no. of rows in the target file.
Do you really mean to acheive this. I hope you are tyring to import the same structure of the input to the target stage.
If so save the input metadata (DS manager can be used). Import back in target stage.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

Post by ashwin141 »

Yeah Kumar you are right.

But the column name eno, ename, sal create some confusion and the way its writen in source and target.

eno ename sal
1 a 100
2 b 200
3 c 300


eno number 10
ename char 2
sal number 10

Regards
Ashwin
Last edited by ashwin141 on Fri Jun 02, 2006 4:50 am, edited 2 times in total.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Source: eno ename sal
1 a 100
2 b 200
3 c 300

Target : field_name data_type length
eno number 10
ename char 2
sal number 10
Jagan has just given sample data for the input and metadata for the target. I dont find any pivoting in this.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How about "the no. of columns in the source file will become the no. of rows in the target file" in the original post? That sure looks like a pivot requirement to me.

Prior to the Pivot stage you can introduce a new column that contains the field names (which become column 1 in your output). Derive these as string constants. You can also do this for the "data type" and "precision" columns.

Make these generated columns pivot keys.
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