- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Copy a file with same format
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
Discussions
Discussions
Forums
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
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
тАО03-14-2011 06:53 AM
тАО03-14-2011 06:53 AM
Copy a file with same format
I am learning the RMS/FDL APIs right now. One
program I am trying to write is to make an exact
copy of a file in terms of it's organization
and data.
Any pointers on how to do this using RMS APIs ?
Do we copy in FAB to out FAB and then copy records one by one ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 07:34 AM
тАО03-14-2011 07:34 AM
Re: Copy a file with same format
In order to allow us to help you better, it may help to indicate that is the ultimate goal.
- Just to learn RMS?
- Simple (sequential) files or indexed as well?
- Just to copy a FILE
- Become comfortable enough to tackle 'the real problem'
RMS - You may want to start out with the COPYFILE example program in : http://h71000.www7.hp.com/doc/731final/4523/4523pro_002.html
To meet your current specification you would to copy fields like RAT, RFM from infab to outfab before $CREATE and check out details for XABFHC
The example copies a record at a time.
It is also possible to use $CREATE to get a file with the right attributes and then use SYS$READ + SYS$WRITE to move the raw blocks.
That is essentially what COPY does.
INDEXED -
You can use FDL$GENERATE to help setup FAB, RAB, XABS. Generate from input, adapt to become output.
Or you can roll your own, by hooking up KEY and AREA XABS. See show_roots.c example in:
http://h71000.www7.hp.com/doc/731final/4523/4523pro_003.html
COPY - A simple API for copy is sorely missing. Some use CONV$CONVERT as alternative. This can give the exact same attributes and records, but the bits might be different. Others use callable BACKUP. I suspect that mostly folks resort to call SPAWN to execute a COPY command. While there is some overhead here, and error handling gets less precise, typically such spawn would be reasonable notably for significant sized files. For frequent (more than 1/sec copies?) for smallish files you may want to roll your own.
Also look around in SYS$HELP. For example:
SYS$COMMON:[SYSHLP.EXAMPLES.CDSA.AES]AES.C;1
Hope this helps to get you going,
Regards,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 07:50 AM
тАО03-14-2011 07:50 AM
Re: Copy a file with same format
Thanks for the help. The final goal is to
come up with a prototype that can backup
VMS files on another machine. This will be
backed and stored at common places/s where
UNIX files are also backed up.
So we need to design a kind of format of save set that we store and later use to restore the file/s. Thus, this has to be
done for all kinds of VMS files (seq/rel/idx)
I am going through RMS APIs (and FDL and other 2-3 related manuals) and it is huge
information to say the least. I am breaking
down this activity further. Copying files to
another file (keeping format intact) is a way
forward in that (hopefully). If that works,
next step is somehow dump all the FAB/RAB
information alongwith data in a backup set
(I was thinking of using FDL files instead
of dumping the structures as a first step).
Is this the right direction ?
Thanks,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 07:52 AM
тАО03-14-2011 07:52 AM
Re: Copy a file with same format
As for resources for answering your own questions and learning how to research technical questions on OpenVMS...
The OpenVMS FAQ is here:
http://labs.hoffmanlabs.com/node/1
Which includes the section:
>>>
How do I do a file copy from a program?
There are several options available for copying files from within a program. Obvious choices include using lib$spawn( ), system( ), sys$sndjbc( ) or sys$creprc( ) to invoke a DCL COPY command. Other common alternatives include using the callable convert routines and the BACKUP application programming interface (V7.1 and later).
<<<
There is a massive repository of VMS information in the comp.os.vms newsgroup, and going back for a couple of decades of VMS-related questions, here:
https://groups.google.com/forum/?fromgroups#forum/comp.os.vms
The HP documentation can be searched with the addition of the following Google keyword onto your search:
site:h71000.www7.hp.com
The Ask The Wizard area has a zip archive available where you can download the entire archive of questions and answers (and search it) here:
http://www.hp.com/go/openvms/wizard
There is an RMS library for C programs available here:
http://labs.hoffmanlabs.com/node/1260
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 07:55 AM
тАО03-14-2011 07:55 AM
Re: Copy a file with same format
I should have looked.
Get yourself professional, expert advice.
Best regards,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 08:02 AM
тАО03-14-2011 08:02 AM
Re: Copy a file with same format
This is not a simple problem (and I know how to do this) and you're adding a whole layer of complexity with this off-platform restoration requirement, and (if you want to do a bootable VMS restoration) you've got a yet larger project.
I'd suggest that you look to provide better and more direct input your manager's schedule time and your company's budget. Tell your manager that you are struggling with this.
The further you drag this out, the worse the issues here will look. If you drag this out too far, and though there will also be clear management-level errors here, it'll be you that gets blamed for this.
That's not intended as a reflection on you, it's a reflection of the complexity of the task involved, and with the complete lack of technical familiarity with the target platform.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 08:10 AM
тАО03-14-2011 08:10 AM
Re: Copy a file with same format
BACKUP was hitting nasty errors as recently as V6-ish with image backlink errors, and there have been BACKUP errors in subsequent VMS releases including problems with GPT restoration and related baggage in the V8-ish range.
I'm not entirely certain that the "new" file links stuff has been particularly documented, either. But I digress.
And that was with the folks working on BACKUP being far more familiar with RMS and the XQP structures than is the OP, and with direct access to the engineers working on MOUNT and XQP and RMS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 08:16 AM
тАО03-14-2011 08:16 AM
Re: Copy a file with same format
One of the reasons I am doing this is there
is lack of VMS developers around and we do
need (eventually) internal experience on this.
Please let me know options available to
get external expertise and advise on this.
I appreciate all the help that has been
offered till now. Having started totally new
to VMS, I moved on like this with this help
1. Using GNV to straight compile things as
porting strategy to realize that this
is not going to get anywhere as to even
compile a single file (with various
scripting issues due to our complex make
environment)
2. Compiling individual files to realize that
there are lot of things not supported by
CRTL.
3. Using RMS to develop small programs and
working way up to have a new code base
(backup/restore portion) totally.
Thanks,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 08:30 AM
тАО03-14-2011 08:30 AM
Re: Copy a file with same format
It is not appropriate for for use to suggest a specific name in this name or number in a reply this forum.
I wouldn't want to slight someone.
Several options involving folks I'd like to stay friendly with. :-)
It should be obvious that any resource who has worked on tools like OpenVMS Backup or related software, or on tools like ZIP should be able to provide you with valuable help.
We have hinted to such names already.
Regards,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 11:04 AM
тАО03-14-2011 11:04 AM