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....
Answer Posted / 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 |
Post New Answer View All Answers
In a batch if a job fails in between and you want to restart the batch from that particular job and not from the scratch then what will you do?
Differentiate between datastage and informatica?
Triggers,VIEW,Procedures
Differentiate between hash file and sequential file?
What is process model?
There are two file are there .1st file contains 5 records and 2nd file contain 10 records in target they want 50 records.how can achieve this
Is the value of staging variable stored temporarily or permanently?
What are routines in datastage? Enlist various types of routines.
Describe stream connector?
Name the third party tools that can be used in datastage?
Difference between in process and inter process?
hi iam new to this tooliam cmpltied to know abt datastage so now iam in project tell me whole step by step what iam doing iwnt to go with exp so plz hlp me pals
How do you run datastage job from the command line?
1)s.key generate 1 to 700 records today. tomorrow another 400 will updated how to update the records using s.key generator? 2)source is like :-- DB --> T/F stage1 --> seq1file T/f 1 is linking with T/F2 ---> seq 2 how to load the data? in source i given some conditions those r going in seq1. The another data will going to seq2 how to do this ?
What are system variables and sequencers in datastage