Page 1 of 1

How to load column metadata into sequential file target

Posted: Fri Jun 02, 2006 12:59 am
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

Posted: Fri Jun 02, 2006 1:16 am
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.

Posted: Fri Jun 02, 2006 3:00 am
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

Posted: Fri Jun 02, 2006 4:30 am
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.

Posted: Fri Jun 02, 2006 4:35 pm
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.