Issue handling date datatype with APT_STRING_PADCHAR

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
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Issue handling date datatype with APT_STRING_PADCHAR

Post by suja.somu »

I am creating a fixed flat file, I have around 10 columns with one date column in it. I have declared all column as CHAR in fixed flat file.

I do a date conversion from MM/DD/YYYY to YYYY-MM-DD format using stage variables for this field. I was getting expected results and was working fine.



Functions that are used in stage variables to convert date to required format :

BIRTH_DATE ['/',1,1] and DateFromComponents(Yr, MthPad, DtPad)


For char fields, the target was paddding NULLS, so to handle this I used the APT_STRING_PADCHAR to make it space(0x20).

The date conversion was not working properly and populating ********* ( stars) in the file.
Can anyone help to me find , where is the problem and how to fix this issue?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

APT_STRING_PADCHAR does not affect Date data type. You need to find better specifications for extracting the date from your source, perhaps using StringToDate() and DateToString() functions. Review documentation and/or Search DSXchange for how to specify variable formats such as one- or two-digit month.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply