At 12:35 PM -0400 7/10/00, [log in to unmask] wrote:
...
>!# Prepare the date information
>!#
>!# Get the month
>!#
>!SETVAR FTP_MONTH RHT("0" + "!HPMONTH",2)
>!#
>!# Get the day of the month
>!#
>!SETVAR FTP_DAY RHT("0" + "!HPDATE",2)
>!#
>!# Combine to form a single number
>!#
>!SETVAR FTP_MMDD "!FTP_MONTH" + "!FTP_DAY"
...
>!# Now get the time information
>!#
>!# Start with the hour
>!#
>!SETVAR FTP_HOUR RHT("0" + "!HPHOUR",2)
>!#
>!# Now get the minute
>!#
>!SETVAR FTP_MINUTE RHT("0" + "!HPMINUTE",2)
>!#
>!# Combine the time into a single value
>!#
>!SETVAR FTP_HHMM,"!FTP_HOUR" + "!FTP_MINUTE"
>!#=20
>!# Now put the time and date together into a single data element
>!#
>!SETVAR FTP_DTS,"!FTP_YOMMDD" + "!FTP_HHMM"
Might I make the following observation and suggestion?
If, by chance, you were to run your command file (or JCL) at 23:59:59, your
first few SETVAR statements might get "today's" date, but then the next few
could get "tomorrow's" time.
Instead, you could actually gather all this information in a single call:
:setvar time_stamp hpyyyymmdd + hphhmmssmmm
Then you'd have one zero-filled string in the form YYYYMMDDHHMMSSMMM
containing all the date/time information you're now gathering with multiple
calls. Furthermore, the extra
...RHT("0" + HPDATE,2)
syntax for zero filling wouldn't be necessary. Once you have your
time_stamp string, it's easy to parse out the components, if necessary. For
example,
:setvar _minute str(time_stamp,11,2)
And if you needed integer data, rather than character data, then do
:setvar _minute ![str(time_stamp,11,2)]
HTH, FWIW, my $.02...
TTFN
Barry Lake [log in to unmask]
Allegro Consultants, Inc. www.allegro.com
(408)252-2330
|