1827848 Members
1775 Online
109969 Solutions
New Discussion

Script

 
SOLVED
Go to solution
Taulant Shamo
Frequent Advisor

Script

Hello,

I need to convert the format dd-mmm-yyyy that comes from output of:
$ write sys$output F$EXTRACT(0,12,p1)
13-JUN-2005

to :
yymmdd i.e 050613


Brgs
Taulant
5 REPLIES 5
Mobeen_1
Esteemed Contributor

Re: Script

Taulant,
I don't know of any other way than the following

1. Break up the date to DD YY and MM using
multiple F$EXTRACT 's on your original
output and
2. Concatenate the 3 strings

regards
Mobeen
Karl Rohwedder
Honored Contributor

Re: Script

$ write sys$output f$cvtime(time,"COMPARISON","DATE")-"-"-"-"

20050613

where time is your timestring.

regards Kalle
Kris Clippeleyr
Honored Contributor

Re: Script

Hi,

Provided that p1 is a valid absolute time, you can try:
f$extract(0,11,f$cvtime(p1)) - "-" - "-"

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Bojan Nemec
Honored Contributor
Solution

Re: Script

Taulant,

Maybe this command will work for you:
$ write sys$output f$extract(2,6,f$cvtime(p1,"COMPARISON","DATE")-"-"-"-")

Bojan
Taulant Shamo
Frequent Advisor

Re: Script

Thank you