When do the Project and Job property defaults take effect?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jherr22
Premium Member
Premium Member
Posts: 56
Joined: Mon Jan 29, 2007 3:24 pm
Location: Denver
Contact:

When do the Project and Job property defaults take effect?

Post by jherr22 »

using Parallel job, converting timestamp from Sybase format to Oracle format.
At the project level and at the job level, one can use the system-provided timestamp format, or change it to a user-defined format.
I used the system-default, and I used multiple format attempts of my own
in both levels.
Nothing seem to be affected. I always got the same errors in the log.
I assume that the system format is used unless the job format is different, in which case, the job format takes precedence?
When do these format get used?

Also, where are the format elements defined (I couldn't find them in the docs on in the Help)?
For example: %mm = 12, or %MM = 12, or %mmm = DEC or Dec, or %MMM = DEC or Dec, or %M = DEC or Dec, or etc, etc, and etc. ???
-- john
P.S. if you are wondering why I'm asking about the timestamp since I have already converted it using my own 'C' program object file (creating my own function) [see my other post]. The reason is that all of us here on the project believe that converting a Timestamp should be one of the most basic elements of DataStage, especially from Sybase to Oracle. But, we don't see any such capability.
PLUS, after converting to the precise expected Oracle format, using the 'C' function, it still did not go into the Oracle table. So, there is still much yet to understand: For example: I used VarChar as input. But, what should I use as output: VarChar or Timestamp? Neither worked.
This simply should not be this hard. There is something very basic we all are missing here.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

The C function will return a character field. YOu need to change it to timestamp using StringToTimestamp(). I tested the whole nine yards here at my end and its working like a charm. I wonder what you are doing wrong :roll:
Did you populate the results to a flat file first and inspected the file? Once you get that part working without a hitch then bring in the database stage.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It shouldn't be that hard. It's made that hard by the database vendors' insistence on different formats for Timestamp. What's wrong with following the ISO 8601 standard, I wonder? At least why can't they all recognize this one standard, in addition to their own idiosyncrasies?

However, as DSguruji suggests, once you've converted to an actual Timestamp (which has a binary internal format in DataStage), then all should be well. Maybe you're trying too hard - the import should read the database format and convert to DataStage format, and the export should reverse the procedure. Leave everything as Timestamp, and set the date format string according to database vendor's specification.

The format elements are defined for the project in the Administrator client (Project Properties, Parallel tab). For an individual column they can be overridden in the extended properties - right click on the column name in the Columns grid and choose Edit Row to open the editor for extended properties.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jherr22
Premium Member
Premium Member
Posts: 56
Joined: Mon Jan 29, 2007 3:24 pm
Location: Denver
Contact:

I found the solution (with your help)

Post by jherr22 »

The solution turned out as follows:
I read in the sybase timestamp from the flat file as a VARCHAR.
I used a custom-made DS Routine ( 'C' program) to convert the Sybase format to the following format: %dd-%mm-%yyyy %hh:%nn%ss.3
Then I fed that result into a DS-supplied function. Here is my transform statement which output to an Oracle Enterprise Stage containing the type "Timestamp":
StringToTimestamp( customConvert(DSLink17.my_date), "%dd-%mm-%yyyy %hh:%nn%ss.3" )

An important page to facilitate the timestamp formatting issue was in Parallel Job Guide, page B-13. That was when I found out that "Jan" or "JAN" was not an acceptable format for the month.

Thanks for your help.
Hopefully this will help someone else.
-- john
Post Reply