I have a job that converts a char of length 8 to a date. After debugging I realized that some of my input data comes in as a high value of 99999999. I first need to convert those fields that come in as that high date to our default of 99991231 in a char or varchar format. The way i accomplished this was to fist have the following if statement in a stage variable:
if TrimtoXfrm.BILL_UNIT_TRM_DT = '99999999' then '99991231' else TrimtoXfrm.BILL_UNIT_TRM_DT
then i took this stage as name TermDt and loaded it to the output as
StringtoDate(TermDt, "%yyyy%mm%dd") and this only works for records that do not contain the high date. I have used stringtodate in other fields and it works fine as just an input into the function and an output to a date. If I go to unix and cat the output file the term date field is populated fine if it fails the if logic and populated to ********** if it has pasted the if logic and populated to the high date.
I also created another job to just test the stage variable where i just populated the field to a string and the high date if logic works, if the value comes in as 99999999 it is converted to 99991231 and if it is not this then it just passes the incoming string through. Does anyone have any suggestions as to how I can get this to work with my stringtodate function
StringtoDate Conversion
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
Return to “IBM<sup>®</sup> DataStage Enterprise Edition (Formerly Parallel Extender/PX)”
Jump to
- Moderators' Choice
- ↳ Editor's BLOG Corner
- ↳ Ask the Experts! - Dads and Grads
- ↳ DSXchange Testimonials
- ↳ Cognos (IBM BI)
- FAQs
- ↳ FAQs
- ↳ FAQ Discussion
- DataStage
- ↳ General
- ↳ IBM<sup>®</sup> Infosphere DataStage Server Edition
- ↳ IBM<sup>®</sup> DataStage Enterprise Edition (Formerly Parallel Extender/PX)
- ↳ Archive of DataStage Users@Oliver.com
- IBM<sup>®</sup>Infosphere Products<sup></sup>
- ↳ Business Glossary
- Suggestions
- ↳ Site/Forum
- ↳ Enhancement Wish List
- Consulting
- ↳ Talent
- ↳ Looking for Talent
- Support
- ↳ Parameter Manager
- ↳ Compile All Plus
- Usergroup Forums
- ↳ Usergroup Central Forum
- ↳ Heartland Usergroup Forum
- The Written Word
- ↳ Articles, White Papers and Tips and Tricks
- ↳ Product Documentation
- Third Party Applications
- ↳ Third Party Applications
- Product Derivatives
- ↳ Functions
- ↳ Routines
- ↳ Jobs
- ↳ Logs
- Tools
- ↳ Tools Forum
- Category
- ↳ Infosphere Master Data Management
- ↳ Data Quality Best Practices
- ↳ IBM QualityStage
- ↳ Information Analyzer (formerly ProfileStage)
- ↳ IBM<sup>®</sup> SOA Editions (Formerly RTI Services)
- ↳ IBM<sup>®</sup> DataStage TX
- ↳ BI
- ↳ Data Integration