Padchar application not working properly

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
vivekreddy
Participant
Posts: 43
Joined: Mon Jan 15, 2007 10:53 pm

Padchar application not working properly

Post by vivekreddy »

I am applying an environment variable for padding the blank characters in a Char field. The variable is set to value "0x20", which corresponds to " " in ASCII.
However, when the data is written to the database, the blank characters are padded not with the " " character, but with the block character (which I cannot represent here, but I think you would understand).

I am using a DB2 v.8.1 database.

Could anyone suggest as to what could possibly the problem, and how I could solve it?
Regards,
Vivek D. Reddy

__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What happens when you load a few records to a flat file or dataset? Do you see the block characters there too?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
vivekreddy
Participant
Posts: 43
Joined: Mon Jan 15, 2007 10:53 pm

Post by vivekreddy »

No, I don't. Would that impact anything as such?
Regards,
Vivek D. Reddy

__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

No. It wont. That test was just to make sure that you were actually getting 'space' as a pad character.
What if you change your target sql type to varchar. Does that take care of the problem? The database will put the necessary spaces itself.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
vivekreddy
Participant
Posts: 43
Joined: Mon Jan 15, 2007 10:53 pm

Post by vivekreddy »

Hi.

Sorry but changing the target SQL type to Varchar doesn't help. The database still puts the block character.
One more thing, the database insertion is highly inconsistent, as in some fields are affected by this, while some aren't.

Could you tell me why this may be so?
Regards,
Vivek D. Reddy

__________________________________________
If knowledge can create problems, it is not through ignorance that we can solve them. - Isaac Asimov
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Ok. Let them be inserted with blocks. Do a select on this table and then load it to a flat file or send it to peek stage. Do you see those blocks in the file or log file? Do you have NLS enabled at the database and not datastage?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply