HP3000-L Archives

February 1997, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Greg Chaplin <[log in to unmask]>
Reply To:
Greg Chaplin <[log in to unmask]>
Date:
Fri, 28 Feb 1997 10:37:07 +1000
Content-Type:
text/plain
Parts/Attachments:
text/plain (58 lines)
Stephen,

Part of your question has already been answered neatly, so I'll
add a bit about naming files to include the date.

 We have a script which sets today's date into the variables:
     today_s, today_l, today_is, today_il, today_us, today_ul,
with the corresponding date formats :
     ddmmyy, ddmmyyyy, yymmdd, yyyymmdd, mmddyy & mmddyyyy.
Today's date (28th Feb 1997) produces:
     280297, 28021997, 970228, 19970228, 022897, 02281997.

This script used to be run whenever it was required, but I now run it as
part of the logon process for sessions & jobs and the variables are
available therefore at any time.

To construct a filename "A970228.pub" I do:

setvar file_name "A!today_is.pub"

Simple!

The script SETTODAY.CMD is:
--------------------------- cut here --------------------------------
option nolist

setvar today_s   rht("0"+ltrim("!hpdate"),2) + "/" &
               + rht("0"+ltrim("!hpmonth"),2) + "/" &
               + rht("0"+ltrim("!hpyear"),2)

setvar today_l   rht("0"+ltrim("!hpdate"),2) + "/" &
               + rht("0"+ltrim("!hpmonth"),2) + "/" &
               + "19" + rht("0"+ltrim("!hpyear"),2)

setvar today_is  rht("0"+ltrim("!hpyear"),2) &
               + rht("0"+ltrim("!hpmonth"),2) &
               + rht("0"+ltrim("!hpdate"),2)

setvar today_il  "19" + rht("0"+ltrim("!hpyear"),2) &
               + rht("0"+ltrim("!hpmonth"),2) &
               + rht("0"+ltrim("!hpdate"),2)

setvar today_us  rht("0"+ltrim("!hpmonth"),2) + "/" &
               + rht("0"+ltrim("!hpdate"),2) + "/" &
               + rht("0"+ltrim("!hpyear"),2)

setvar today_ul  rht("0"+ltrim("!hpmonth"),2) + "/" &
               + rht("0"+ltrim("!hpdate"),2) + "/" &
               + "19" + rht("0"+ltrim("!hpyear"),2)


Greg Chaplin
UniSuper
Level 28, 367 Collins St,      Email: [log in to unmask]
Melbourne 3000,                Phone: +61 3 9648 4145
Australia.                     Fax:   +61 3 9648 4141
(Any opinions expressed here are not necessarily my employer's)

ATOM RSS1 RSS2