- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Datatrieve help needed
Operating System - OpenVMS
1745939
Members
3923
Online
108723
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
09-17-2009 02:45 AM
09-17-2009 02:45 AM
I am using datatrieve for querying records of a file and there are about 6300 records in the file I need only one record for testing and that one is some where in the between the records and all the records are randomly placed Is there any way that i can select only that record and delete all the remaining records and continue my testing.and also is there any way i can get the record numbers in the file by using datatrieve
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2009 03:55 AM
09-17-2009 03:55 AM
Solution
To delete records the file needs to be an indexed file. Is it?
Why not just create a fresh file with the target record(s)?
That's easy enough, although the request to select a record by number is 'odd'.
What identifies that record?
Why not use that in the record-selection-expression?
To select a particular record to work on in datatrieve you can use SELECT [collection]
I would use something like:
DTR> show yachts
DOMAIN YACHTS USING YACHT ON YACHT.DAT;
DTR> define domain test using yacht on test.tmp;
DTR> define file for test;
DTR> ready yachts read
DTR> ready test write
DTR> test = yachts with running count = 42
DTR> print test
MANUFACTURER MODEL RIG ALL WEIGHT BEAM PRICE
FJORD MS 33 MS 33 14,000 11
But why not select by contents, rather than number....
Obviously here this will create a second instance of the same:
DTR> test = yachts with MANUFACTURER = "FJORD" and model = "MS 33"
DTR> print test
MANUFACTURER MODEL RIG ALL WEIGHT BEAM PRICE
FJORD MS 33 MS 33 14,000 11
FJORD MS 33 MS 33 14,000 11
Also... you can probably just use DCL or read and write old and new files.
Or even an editor? Why not?
Now did you want an index or two to go with that?
hth,
Hein.
Why not just create a fresh file with the target record(s)?
That's easy enough, although the request to select a record by number is 'odd'.
What identifies that record?
Why not use that in the record-selection-expression?
To select a particular record to work on in datatrieve you can use SELECT
I would use something like:
DTR> show yachts
DOMAIN YACHTS USING YACHT ON YACHT.DAT;
DTR> define domain test using yacht on test.tmp;
DTR> define file for test;
DTR> ready yachts read
DTR> ready test write
DTR> test = yachts with running count = 42
DTR> print test
MANUFACTURER MODEL RIG ALL WEIGHT BEAM PRICE
FJORD MS 33 MS 33 14,000 11
But why not select by contents, rather than number....
Obviously here this will create a second instance of the same:
DTR> test = yachts with MANUFACTURER = "FJORD" and model = "MS 33"
DTR> print test
MANUFACTURER MODEL RIG ALL WEIGHT BEAM PRICE
FJORD MS 33 MS 33 14,000 11
FJORD MS 33 MS 33 14,000 11
Also... you can probably just use DCL or read and write old and new files.
Or even an editor? Why not?
Now did you want an index or two to go with that?
hth,
Hein.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP