Page 2 of 2

Posted: Tue Aug 02, 2011 10:29 am
by Seyed
Hello Ray,
Problem is resovled. After removing dashes and time from the timestamp, I was able to get your suggested code to work as well.

Here is how I got your suggested code to work:

Code: Select all

OConv(IConv(Change(DSLink1.LOG_DT_TM[1,10],"-",""), "G0.1" : @VM : "D"), "DMA" : @VM :"MCT")
Thank you very much for your help,

Seyed

Posted: Tue Aug 02, 2011 3:43 pm
by ray.wurlod
You shouldn't need to remove the dashes. However, since YMD is not your default locale setting, you need DYMD in the Iconv() function. Also, it's a space, not a dot, in the G conversion.

Code: Select all

OConv(IConv(DSLink1.LOG_DT_TM, "G0 1" : @VM : "DYMD"), "DMA" : @VM :"MCT")

Posted: Wed Aug 03, 2011 8:28 am
by pandeesh
Seyed wrote:Craig,
The problem is resolved. I followed your instructions and identified that the problem was in the Iconv routine. It turns out that I had to remove dashes from the date.

Here is how I got your suggested code to work:

Code: Select all

OConv(OConv(IConv(Change(DSLink1.LOG_DT_TM[1,10],"-",""),"D"),"DMA"),"MCT")

I ended up removing time and also dashes from date.

Thank you so much,

Seyed
For this code

for the input 2011-03-12, it returns November. It should be March right?

Thanks

Posted: Wed Aug 03, 2011 12:57 pm
by Seyed
ray.wurlod wrote:You shouldn't need to remove the dashes. However, since YMD is not your default locale setting, you need DYMD in the Iconv() function. Also, it's a space, not a dot, in the G conversion.
Ray,
Thank you so much for the information. I will make these changes.

Seyed

Posted: Thu Aug 04, 2011 12:18 am
by ray.wurlod
pandeesh wrote:It should be March right?
Only if your default date format (in your locale) uses YMD order.
Note that the rules for server jobs are different from the rules for parallel jobs.

Posted: Thu Aug 04, 2011 12:38 am
by pandeesh
Thanks Ray! I have understood. It depends on the default Date format settings

Posted: Thu Aug 04, 2011 9:00 am
by Seyed
Ray,
Following your comments, I didn't remove dashes. I also changed the format in the Iconv to 'DYMD' and also replaced the the decimal with a space for the 'G' function and now the resulting code works.

Code: Select all

OConv(IConv(DSLink1.LOG_DT_TM[1,10], "G0 1" : @VM : "DYMD"), "DMA" : @VM :"MCT")
Thank you very much,

Seyed

Taking one step farther Full month to abbr month

Posted: Wed Aug 08, 2012 9:26 am
by MrBlack
ray.wurlod wrote:

Code: Select all

OConv(IConv(YourField,"D"),"DMA" : @VM :"MCT")
...
I found your post and it's given me hope to my similar problem, in your example you return a full month name, what if I just want an abbreviated month, so August would be Aug, and June would be Jun.

The Big Picture
My data is 20120808 and I'm trying to transform it to 08-AUG-2012.

Posted: Wed Aug 08, 2012 9:39 am
by ArndW
"D-YMD[4,A3,2]"

Posted: Wed Aug 08, 2012 3:14 pm
by ray.wurlod
"D-DMBY"