maximum length of varchar Stage variable

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
Suma Reddy
Participant
Posts: 7
Joined: Mon Oct 30, 2006 12:19 am

maximum length of varchar Stage variable

Post by Suma Reddy »

Hi Everyone,

I have a scenario wherein i am doing vertical to horizontal pivot. This requires concatenating field to itself 80 times. The field length is 2000.This means the stage variable which is going to hold this value should be of length 160079(2000*80 + 79(field delimiter)).

Can someone confirm me what is the maximum length a stage variable or VarChar() field can have in datastage?

Is it ok if i give the field type as Varchar and leave the length as empty in both stage variable and corresponding field in transformer.

Thanks,
Suma
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Note: Please take note of this IBM tech note: :D

Parallel Engine data sets and sort operations with VARCHAR/NVARCHAR columns may require the maximum length specified to store data on disk.

http://www-01.ibm.com/support/docview.w ... wg21458132
Choose a job you love, and you will never have to work a day in your life. - Confucius
nayanpatra
Participant
Posts: 41
Joined: Sat Jun 06, 2009 11:13 pm
Location: Kolkata

Post by nayanpatra »

The maximum length of a varchar field can be of 255.
Nayan
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

nayanpatra wrote:The maximum length of a varchar field can be of 255.
Not true. Did you know that max length is also not 999999999 (nine nines)? :idea:

Max length it will accept is 2^31 - 1 (2 to the power of 31, minus 1), or you can leave it blank. Try it for yourself.

I have seen some IBM tech notes that suggest max length is 2^31 - 5...

This is the kind of info I would expect to find in the Parallel Job Developer's Guide chapter 2 section on data types. However, it is not documented there.
Choose a job you love, and you will never have to work a day in your life. - Confucius
mobashshar
Participant
Posts: 91
Joined: Wed Apr 20, 2005 7:59 pm
Location: U.S.

Post by mobashshar »

Yes Suma.
It is ok to leave the length value as empty for Varchar field.
Post Reply