- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Lexical functions f$time()
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2005 09:36 PM
10-31-2005 09:36 PM
Is it possible to let f$time write 01, insted of " 1" (leading blank characters)??. I looked at f$cvtime, but could not find any solutions.
I want to include a daynumber in a filename, so blank characters make problems.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2005 10:00 PM
10-31-2005 10:00 PM
SolutionHowever you can format this yourself
$ now = F$TIME()
$ d = F$INTEGER(F$CVTIME(now,"ABSOLUTE","DAY"))
$ m = F$CVTIME(now,"ABSOLUTE","MONTH")
$ y = F$CVTIME(now,"ABSOLUTE","YEAR")
$ WRITE SYS$OUTPUT F$FAO("!2ZL-!AS-!AS",d,m,y)
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2005 10:10 PM
10-31-2005 10:10 PM
Re: Lexical functions f$time()
$ day = f$cvtime(f$time(),"COMPARISON","DAY")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2005 12:00 AM
11-01-2005 12:00 AM
Re: Lexical functions f$time()
I realize the problem is solved. The comparision time is always my preferred solution as it sorts. but for similar problems elsewhere you may consider the little used/known left assignment in DCL:
$ x = f$time()
$ if f$loc(" ",x).eq.0 then x[0,1]="0"
that is...
If the first found space in X is at offset 0, then make 1 byte at offset 0 be an ascii 0.
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2005 01:11 AM
11-01-2005 01:11 AM
Re: Lexical functions f$time()
%DCL-W-IVCHAR, invalid numeric value - check for invalid digits
\0\
replace "0" by ascii code for 0
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2005 01:24 AM
11-01-2005 01:24 AM
Re: Lexical functions f$time()
Oops, retype error. Thanks for pointing that out Ian.
The line should be:
if f$loc(" ",x).eq.0 then x[0,1]:="0"
I hate re-typing and always cut&paste from working examples, but I was experimenting with a new 'T5515 thin client' at home and could not get the Xterm cut&paste to go. Argh.
The := is a string assignment.
The alternative is just the var[off,len]=val for left bit string assignments.
The suggested solution then becomes:
if f$loc(" ",x).eq.0 then x[0,8]=48
Notice the 8 for 8 bits in a byte.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2005 03:18 AM
11-01-2005 03:18 AM
Re: Lexical functions f$time()
just another way.
$ zz = f$cvtime(,"ABSOLUTE")
$ if f$length(f$ele(0," ",zz)).eq.10 then zz = "0''zz'"
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2005 04:40 AM
11-01-2005 04:40 AM
Re: Lexical functions f$time()
Instead of the 'heavy' f$elem construction, Mike could also have just tested length:
$ if f$len(zz)).eq.22 then zz = "0" + zz
With the leading space from f$time() you would need:
$ x=f$time()
$ show symb x
X = " 1-NOV-2005 11:31:10.88"
$ if f$extr(0,1,x).eqs." " then x = "0" + f$ext(1,99,x)
$ show symb x
X = "01-NOV-2005 11:31:10.88"
$
I think we now have sufficiently beaten this horse to death :-).
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2005 04:59 AM
11-01-2005 04:59 AM
Re: Lexical functions f$time()
:-)
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2005 06:28 PM
11-01-2005 06:28 PM
Re: Lexical functions f$time()
that's even better.
I wasn't shure, if there is 0 preceding morning hours in the string. That's why I've suggested F$ELEMENT.
Mike