Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

HP OpenVMS Systems

Ask the Wizard
» 

HP OpenVMS Systems

OpenVMS information

» What's new on our site
» Upcoming events
» Configuration and buying assistance
» Send us your comments

HP OpenVMS systems

» OpenVMS software
» Supported Servers
» OpenVMS virtualization
» OpenVMS solutions and partners
» OpenVMS success stories
» OpenVMS service and support
» OpenVMS resources and information
» OpenVMS documentation
» Education and training

Evolving business value

» Business Systems Evolution
» AlphaServer systems transition planning
» Alpha RetainTrust program

Related links

» HP Integrity servers
» HP Alpha systems
» HP storage
» HP software
» HP products and services
» HP solutions
» HP support
disaster proof
HP Integrity server animation
Content starts here

Ask the Wizard Questions

DCL to convert binary time to text

The Question is:


Dear Wizards,

I have an application which uses RMS-files as database.
In some of these files the application stores timestamp
data (quadword) for various transactions made in the system.

I need to analyze these transactions, and to be able to do
this I need the timestamp converted to a string
(e.g. "2-JAN-1996 16:55:39").
The problem is that I have not found any way to do this
by using DCL or lexical functions (which I must use since
I don't have any compiler for any programming-language).

Can you please tell me how to do this ?

The application today runs on a VAX-4000 system with
VMS 5.5-2, but will soon be moved to an Alpha system
with VMS 6.2 .

Thanks in advance.


The Answer is:

    This method is totally unsupported and may stop     working
eventually, but it seems to work on all versions of OpenVMS,     VAX
and Alpha to date.

    $ binary_time[0,32] = %xA4FE0000	! low longword of binary date
    $ binary_time[32,32] = %x0099D8C4	! high longword
    $ date_string=f$cvtime(f$fao("!%D",-
    	f$cvui(32,32,f$fao("!AD",8,binary_time))),"ABSOLUTE")
    $ show sym date_string
      DATE_STRING = "7-FEB-1996 09:10:53.00"

    The F$FAO magic depends on the way DCL stores strings internally. It's
    not at all supported. Use at your own risk.



 

** About PDF files: The PDF files on this Web site can be read online or printed using Adobe® Acrobat® Reader. If you do not have this software installed on your system, you may download it from the Adobe Web site.
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.