ASCII out yyyy-mm-dd (Numeric Month)

Stephen R McMillan smcmillan at PLANALYTICS.COM
Mon Apr 23 17:14:59 EDT 2007


Jae,

Add a function to convert alpha month to numerical month. For example,

timemo=newmon(timemo)

function newmon(timemo)
  if(timemo='JAN');val='01';endif
  if(timemo='FEB');val='02';endif
  etc.
return val

Stephen McMillan



 Jae H Ryu
 <jhryu at U.WASHINGTON.EDU>
 Sent by:                                                               To
 GRADSUSR at LIST.CINECA.IT                            GRADSUSR at LIST.CINECA.I
                                                    T
 04/23/2007 04:41 PM                                                    cc

       Please respond to                                           Subject
    GRADSUSR at LIST.CINECA.IT                         ASCII out yyyy-mm-dd
                                                    (Numeric Month)










Hi Users,

I have digged out the Listserve but coudn't get the answer yet.
My goal is to print data set look like this.
date         value
1995-01-01 0.123
1995-01-02 0.345
1995-01-03 0.123

rather than,
1995-JAN-01 0.123
1995-JAN-02 0.345
1995-JAN-03 0.123

but, GRAD always return the name of month (e.g. Jan, Feb, Mar..) rather
than numeric value (e.g.01, 02, 03..)
If anyone knows how to handle this problem, please let me know.
I attached a script below.

'reinit'
'open narr-a.ctl'

### Assign lon,lat to met stations ###
timeend = 1000
i = 1
while(i <= timeend)
'set t 'i''
'q time'
timehr = substr(result, 8, 3)
timedy = substr(result, 11, 2)
timemo = substr(result, 13, 3)
timeyr = substr(result, 16, 4)

'd pevapsfc'
a.nr = subwrd(result,10)
val = timeyr%"-"%timemo%"-"%timedy"-"%timehr" "%a.nr
rec = write('pevapsfc.txt',val, append)
i = i + 1
endwhile





***************************************************
The information contained in this e-mail message is intended only for the use of the recipient(s) named above and may contain information that is privileged, confidential, and/or proprietary.  If you are not the intended recipient, you may not review, copy or distribute this message.  If you have received this communication in error, please notify the sender immediately by e-mail, and delete the original message.
***************************************************



More information about the gradsusr mailing list