Subject: | |
From: | |
Reply To: | |
Date: | Mon, 6 Nov 1995 13:29:13 GMT |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
[This note has been sent to the following InterNet address(es):
HP3000-L @ UTCVM.UTC.EDU]
> Subject: Help with string extraction plse (fwd)
> I need to rename a file in MPE to filemmdd where mm is taken from HPMONTH
> and dd is taken from HPDATE.
>
> I need to right justify and zerofill the value so I want dd=06 not 6.
Try this :-
setvar fname "file"+rht("0!hpmonth",2)+rht("0!hpdate",2)
or even (version 97)
setvar fname "file"+rht("0000![hpmonth*100+hpdate]",4)
or even (version 98)
you could set up this command file and call it TSTAMP :-
PARM t=timestamp f=timetemp
echo > !f
setvar !t '000![finfo("!f",-8)]'+rht('000000![finfo("!f",-24)]',6)
return
and then use it as follows :-
:tstamp
:showvar timestamp
TIMESTAMP = 19951106171339
:setvar fname "file"+str(timestamp,5,4)
[log in to unmask]
|
|
|