Data Conversion
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3
- Joined: Tue Mar 25, 2008 9:51 am
- Location: Atlanta
Data Conversion
How do I take an internal InfoLease system date and convert it to MMDDYYYY without the / showing up? I am getting MM/DD/YYYY.
I have tried individual conversions on the date field with DM[2] DD[2] and DY[4], I have tried "DMDY[2,2,4], and I have tried MDY with no success.
Thanks.
I have tried individual conversions on the date field with DM[2] DD[2] and DY[4], I have tried "DMDY[2,2,4], and I have tried MDY with no success.
Thanks.
Welcome aboard! Common date manipulations are covered extensively here. Spend a little time and browse the 100 thousand plus questions and answers.
If you want me to give you a hint, look for conversations regarding using ICONV and OCONV to facilitate date manipulations. Your solution could also be solved using simple string manipulation to remove the / character. Search for tips on using EREPLACE and CHANGE and TRIM. You can look these functions up in the DS BASIC manual available under your Start button for Ascential, under Online Documentation.
If you want me to give you a hint, look for conversations regarding using ICONV and OCONV to facilitate date manipulations. Your solution could also be solved using simple string manipulation to remove the / character. Search for tips on using EREPLACE and CHANGE and TRIM. You can look these functions up in the DS BASIC manual available under your Start button for Ascential, under Online Documentation.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 58
- Joined: Thu Feb 15, 2007 3:42 pm
regarding data conversion
Hi,
can you make the question clear,you want the output to be in that specified foramt or data convesion.
can you make the question clear,you want the output to be in that specified foramt or data convesion.
Arunkumar..
-
- Participant
- Posts: 3
- Joined: Tue Mar 25, 2008 9:51 am
- Location: Atlanta
Updated Information
I have tried:
Oconv(FedDepr.BEG_DEPR_DATE, "MDY[2,2,4]" :@VM:"MCN") which produces:
03/21/1999
I have also tried: Oconv(DateTimeStampToInternal(AsMast.A_DISP_DATE) , "DM[2]"):Oconv(DateTimeStampToInternal(AsMast.A_DISP_DATE) , "DD"):Oconv(DateTimeStampToInternal(AsMast.A_DISP_DATE) , "DY") Else "" which produces:
03011999
so it appears that it rolls the day portion of the date back the 1st each time.
Oconv(FedDepr.BEG_DEPR_DATE, "MDY[2,2,4]" :@VM:"MCN") which produces:
03/21/1999
I have also tried: Oconv(DateTimeStampToInternal(AsMast.A_DISP_DATE) , "DM[2]"):Oconv(DateTimeStampToInternal(AsMast.A_DISP_DATE) , "DD"):Oconv(DateTimeStampToInternal(AsMast.A_DISP_DATE) , "DY") Else "" which produces:
03011999
so it appears that it rolls the day portion of the date back the 1st each time.
Re: Updated Information
Try this -
The MCN conversion code extracts only the numerals from the input string.
Code: Select all
Oconv(FedDepr.BEG_DEPR_DATE, "MDY[2,2,4]","MCN")
gateleys
Sure. You can provide multiple mainpulations on a string using a single ICONV or OCONV function by delimiting the conversions with a value mark (@VM) character. Hence, first change the internal date to MM DD YYYY format and then apply "MCN" which will extract the numbers out of the date, in turn, getting rid of the spaces.chulett wrote:DSG2B: It would probably help if you also explained what exactly that is doing, the 'how' of the 'what', if you will.
So gateleys conversion code is missing the @VM character. Hence, it will now be
Code: Select all
Oconv(FedDepr.BEG_DEPR_DATE, "MDY[2,2,4]":@VM:"MCN")
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 3
- Joined: Tue Mar 25, 2008 9:51 am
- Location: Atlanta
Transform Function
I ended up building this transform and it works.
Ans = DSDate[6,2]:DSDate[9,2]:DSDate[1,4]
SunTrustDateFormatNew(FedDepr.BEG_DEPR_DATE)
Ans = DSDate[6,2]:DSDate[9,2]:DSDate[1,4]
SunTrustDateFormatNew(FedDepr.BEG_DEPR_DATE)
Why y'all given out the answers to our friend from Atlanta? Why not let them discover our rich answer history here? Sometimes you learn a lot more than finding out an answer you care about...
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
I was just explaining my cryptic code. Forgot to do it the first time.kcbland wrote:Why y'all given out the answers to our friend from Atlanta? Why not let them discover our rich answer history here? Sometimes you learn a lot more than finding out an answer you care about...
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Or:
Might make it a little more obvious what's going on.
Code: Select all
Convert("/","",Oconv(FedDepr.BEG_DEPR_DATE, "MDY[2,2,4]"))
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Ooops!!DSguru2B wrote:So gateleys conversion code is missing the @VM character.
If you want to go without the Value Mark, you would need to go with a double call to Oconv -
Code: Select all
Oconv(Oconv(FedDepr.BEG_DEPR_DATE, "MDY[2,2,4]"),"MCN")
gateleys
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Given the original problem I'd use a DIGITS Transform.
Code: Select all
DIGITS(InLink.TheDate)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.