Hashed file size based on its columns datatype/length

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
datability_user
Premium Member
Premium Member
Posts: 50
Joined: Sat Jan 31, 2009 3:39 am
Location: Riyadh
Contact:

Hashed file size based on its columns datatype/length

Post by datability_user »

Hi All,

Is there any difference in the file size of a hashed file, based on its columns datatype/length structure,
i.e,
HF1:
col1 varchar(100)/char(100),
col2 decimal(100)/integer(100)/numeric(100)

HF2:
col1 varchar(10)/char(10),
col2 decimal(10)/integer(10)/numeric(10)

HF3:
col1 varchar(1)/char(1),
col2 decimal(1)/integer(1)/numeric(1)

if the data from the source coming as 1 digit (alphanumeric)

thanks in advance
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Hashed files only have one internal datatype, namely a string. Length specifications are informational only, thus all 3 hashed files you mentioned will be identical.

CHAR fields will be padded with blanks in DS and written/read with blanks.
datability_user
Premium Member
Premium Member
Posts: 50
Joined: Sat Jan 31, 2009 3:39 am
Location: Riyadh
Contact:

Post by datability_user »

Thanks ArndW very much
that means i do not have to care about defining data types and length for my hashed files, anything will be acceptable am i right?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You should always use realistic numbers, particularly for non-strings; but in Server you can put "Hello There" into a VarChar(3) field and it would still be stored correctly.
datability_user
Premium Member
Premium Member
Posts: 50
Joined: Sat Jan 31, 2009 3:39 am
Location: Riyadh
Contact:

Post by datability_user »

thanks again ArndW,

Why numbers?
if i stored, say 999 in integer(1), is it going to be stored correctly?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Even though DS Server does not restrict you from misusing job column metadata it is always best to act as if it would and use column definitions that approximate the data; that way if you were to write to a database you can avoid error messages upon insert and update.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly. At some point it will be enforced, after all.
-craig

"You can never have too many knives" -- Logan Nine Fingers
datability_user
Premium Member
Premium Member
Posts: 50
Joined: Sat Jan 31, 2009 3:39 am
Location: Riyadh
Contact:

Post by datability_user »

Again thanks,
i will flag this as resolved
Post Reply