in one scenario source flat file like
Fileld1
00122001550056200568
00256002360014500896
00123004560078900258
00147004560025800256
divide each 5 numbers as one column i.e
here i need
field1 field2 field3 field4
00122 00155 00562 00568
00256 00236 00145 00896
00123 00456 00789 00258
00147 00456 00258 00256
plz help me....
Answers were Sorted based on User's Feedback
Answer / vs
First and foremost thing, put the following data in a text file.
00122001550056200568
00256002360014500896
00123004560078900258
00147004560025800256
Follow the steps:
Take following 3 stages:
1. Sequential File
2. Transformer
3. Dataset/Sequential File
STAGE 1:
1. Sequential File Properties
Source-->File = browse & select the text file containing the
above data.
Read Method = Specific File(s)
Go to Columns Tab:
Give column name (any name), SQL Type = Varchar, length = 50
(Make sure you take the minimum length as 20 since the
character length in the input file is 20).
Now, click on the "Load" option at the bottom and import the
table definitions by choosing "Sequential File Definitions".
After the table definitions are imported. Double click on
the imported table definition. Click OK.
STAGE 2:
Transformer Properties:
Click on the O/p column, and create 4 Columns at the bottom.
Column Name SQL Type Length
Field1 Varchar 50
Field2 Varchar 50
Field3 Varchar 50
Field4 Varchar 50
Create 4 Stage variables:
Derivation Stage
Variable
Left(inputcolumnname,5) F1
Right(Left(inputcolumnname,10),5) F2
Right(Left(inputcolumnname,15),5) F3
Right(inputcolumnname,5) F4
Map the above stage variables by dragging and dropping into
the below O/p table
O/p Table
Derivation Column Name
F1 Field1
F2 Field2
F3 Field3
F4 Feild4
STAGE 3:
Dataset File Stage/Sequential File Stage Properties:
Double click and File = browse the output file path.
If it's sequential, .txt || Dataset File, .ds
Hope this helps you !!! If you follow the above procedure,
you must get the out put correct!!!
All The Best !!!
Thanks & Regards,
VS
Is This Answer Correct ? | 24 Yes | 0 No |
Take 4 field names(field1 field2 field3 field4) in output stage.
use Transformer stage: In Derivation use the below substring
Field1: SourceColumn[1,5]
Field2: SourceColumn[6,10]
Field3: SourceColumn[11,15]
Field4: SourceColumn[16,20] use this one u will get correct o/p.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sindhu
BY using sequential file in format delimeter =none while importing the data enable the option fixed width and give column width 5 space 5 space 5.datatype as varchar inorder to get zeros also in output.
reducing the stages will always increase performance
Is This Answer Correct ? | 0 Yes | 0 No |
Which type of joins Merge stage can support?
i want anser this question empno,ename,sal 12,mmm_ww,200 13,nnn_xx,300 14,bbb_qq,400 which stages are take which types of logicks are doing pls help me
how to get the unique records on multiple columns by using sequential file stage only
Hi am sundar, i have datas like 00023-1010 00086-1010 00184F2-1010 . . . . SCH-AS-1010 200-0196-039 . . . Now i want the result "SCH-AS" in onee column and "1010" in another column.. Can any one tell the answer...
how do you pass parameters in a script?
SEQUENTIAL FILE I HAVE ONE RECORD,I WANT 100 RECORDS IN TARGET?HOW CAN WE DO THAT?PLS EXPLAIN ME AND WHAT STAGES ARE THERE?WHAT LOGIC?
how can we join one oracle & flat files ?
what is materialized view used datastage?
How to Convert the columns into rows?
Anyone has Datastage certification free dumps for 000-418 , 000-421 codes, mail me @ manik.dwh@gmail.com 000-418 : InfoSphere DataStage v8.0 000-421 : InfoSphere DataStage v8.5
Sequential file i have one record,i want 100 records in target?How can we do that?Pls explain me and what stages are there?What logic?
What is aggtorec restructure operator?