Operating System - OpenVMS
1748035 Members
4697 Online
108757 Solutions
New Discussion юеВ

Re: Accessing RMS indexed files from PHP

 
Gary Smallridge
Occasional Advisor

Accessing RMS indexed files from PHP

I've looked at the 'documentation' for the OpenVMS extension to PHP but it's of little help.

If this meant to be the OpenVMS API for PHP, why is there no documentation for it?

What function calls are available that would allow me to open an RMS indexed file in PHP?
4 REPLIES 4
Duncan Morris
Honored Contributor

Re: Accessing RMS indexed files from PHP

Hi Gary,

not a great help, I know, but have a look at this thread. In particular see Hein's response.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1081795

Regards,

Duncan
Hoff
Honored Contributor

Re: Accessing RMS indexed files from PHP

Somebody from HP will have to informally or more formally answer the "why is there no documentation for it?" question.

AFAIK, there are no PHP extension calls for accessing indexed files. You might ask HP this question directly.

PHP and most other languages are most commonly coded to communicate with sequential files and with MySQL, ProgreSQL or other similar database packages. Not RMS.

There are extensions for some languages that allow access. Python, Perl and DCL do have access to RMS indexed files. Haven't checked Ruby. There does not appear, however, to be an extension available for PHP for this purpose.

The usual database interface for most languages would likely involve acquiring and configuring an ODBC connector for RMS. These products do (did?) exist. Alternatively, rolling your own PHP interface for RMS indexed files, or convincing an outside organization to provide the interface to you, or convincing HP to extend the existing php_openvms module.

Not what you want to hear, I expect.
Robert Atkinson
Respected Contributor

Re: Accessing RMS indexed files from PHP

Gary, for what it's worth, I never found anything I could use for indexed files on VMS, apart from the suggestions made in my original thread.

I'm still left with using Attunity Connect ODBC drivers, which will allow me to read using the indexes, or scanning the whole file and breaking it up into records with PHP.

Rob.

Gary Smallridge
Occasional Advisor

Re: Accessing RMS indexed files from PHP

Robert,

Retrieving all the records is what I have resorted to.

FYI: open the file for binary read access;

$fp=fopen("file.idx","rb");

then each record can be read;

$record = fgets($fp,396);

the file I'm accessing is fixed length 396 byte records and has a single key. There are also binary 2 and binary 4 numbers in each record which I would have to write code for.