Loading data into fixed width flat file using seq file stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Loading data into fixed width flat file using seq file stage

Post by ramakrishna459 »

Hi all

I need to load the data into flat file as fixed width format,source is a sql server and am using runtime column propagation .But few of the columns in the target are Integer and timestamp.So if i use char data type for integer how much length should i give and for timestamp columns when i use char data type the job is getting aborted due to conversion problem.

So to generate the fixed width file please suggest me the approach.

Thank you
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So just to be clear, you want to know how to generate a fixed-width file in an RCP enabled job, yes?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Post by ramakrishna459 »

yes craig.....

For integers and timsestamp columns what datatype can be used.....
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What happens when you stick with the original datatypes?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Post by ramakrishna459 »

The problem is the integer column data is not all of same length.as am using RCP i cant transform any columns.and for timestamp columns there is no problem if there is null am populating space(26)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Schema file?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Post by ramakrishna459 »

Yes am using schema file.The problem is with integer and timestamp columns for that how we can use to get fixed width format.
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Post by ramakrishna459 »

i have in the source Int(4).If i want to convert into char what length should i give.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's an integer, the (4) just means it is stored in 4 bytes. Look up the maximum size of an integer and account for that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Post by ramakrishna459 »

craig

For the integer column having length of four .I queried in the database it has max length of data stored is six.so should i go for the char(6) or any logical conversion is required between integer(4) to determine the character length.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Forget the 4, it plays no role here. An integer can store a value up to 2147483647. However, if you are confident your value will never go over 999999 then use 6 for the length otherwise best to use 10 (or 11 if signed).
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply