- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- How to use the below CROSS statement in a FOR loop
Operating System - OpenVMS
1753481
Members
4284
Online
108794
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
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
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
тАО11-28-2007 11:59 PM
тАО11-28-2007 11:59 PM
We cross two files A and B over X(a common field) with TRADE(a field in A) and STATUS(a field in B).From the result,i need to delete the records in A that matches with B.
READY A WRITE
READY B SHARED
FIND ALL A CROSS B OVER X WITH TRADE STARTING WITH "FR" AND STATUS="OK"
ERASE ALL
How can the above code be written in a FOR loop,so that i can erase the required records?
READY A WRITE
READY B SHARED
FIND ALL A CROSS B OVER X WITH TRADE STARTING WITH "FR" AND STATUS="OK"
ERASE ALL
How can the above code be written in a FOR loop,so that i can erase the required records?
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2007 01:01 AM
тАО11-29-2007 01:01 AM
Re: How to use the below CROSS statement in a FOR loop
DATATRIEVE? Been a few years since I've coded in that. Good choice for ad-hoc queries, for its time. (InstantSQL (if you can find it; officially ISQL is long gone) was better for ad-hoc tasks, but I digress.)
The DATATRIEVE documentation is available here:
http://h30266.www3.hp.com/odl/i64lp/databases/dtr073/datrieve.htm
If you're programming in DATATRIEVE (as it appears here), the reference materials, as well as available programming examples and such are available there.
As for your request, I'd not expect that to work: "Do not use a FIND statement in a compound statement, such as a BEGIN-END, FOR, REPEAT, or THEN statement. (To establish single record context in compound statements, use the RSE clauses of FOR, PRINT, or MODIFY statements. These RSEs can establish the record streams needed to control the name recognition and single record context inside compound statements.)"
ERASE ALL removes the entirety of the current collection.
FIND establishes a collection.
Without running some tests, I'm not sure what might happen here, nor what you're specifically seeking to have happen. (I usually confirm DATATRIEVE syntax on a test copy of the database.)
Again, I'd suggest starting with a test database and with the manuals and with Yachts and other examples -- and you should get to where you need to be.
Stephen Hoffman
HoffmanLabs LLC
The DATATRIEVE documentation is available here:
http://h30266.www3.hp.com/odl/i64lp/databases/dtr073/datrieve.htm
If you're programming in DATATRIEVE (as it appears here), the reference materials, as well as available programming examples and such are available there.
As for your request, I'd not expect that to work: "Do not use a FIND statement in a compound statement, such as a BEGIN-END, FOR, REPEAT, or THEN statement. (To establish single record context in compound statements, use the RSE clauses of FOR, PRINT, or MODIFY statements. These RSEs can establish the record streams needed to control the name recognition and single record context inside compound statements.)"
ERASE ALL removes the entirety of the current collection.
FIND establishes a collection.
Without running some tests, I'm not sure what might happen here, nor what you're specifically seeking to have happen. (I usually confirm DATATRIEVE syntax on a test copy of the database.)
Again, I'd suggest starting with a test database and with the manuals and with Yachts and other examples -- and you should get to where you need to be.
Stephen Hoffman
HoffmanLabs LLC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-29-2007 08:44 PM
тАО11-29-2007 08:44 PM
Solution
I think you want something like:
FOR ok_b IN B WITH STATUS = "OK" PRINT ALL A
WITH x = ok_b.x AND TRADE STARTING WITH "FR";
If you like the result, then replace the PRINT with ERASE
The problem might be the scale of the number of records.
If B has millions of records with "OK"
and A has just a few records with trade starting with FR then the above is sub-optimal.
But for now... let's see if this handles the problem.
Hein
FOR ok_b IN B WITH STATUS = "OK" PRINT ALL A
WITH x = ok_b.x AND TRADE STARTING WITH "FR";
If you like the result, then replace the PRINT with ERASE
The problem might be the scale of the number of records.
If B has millions of records with "OK"
and A has just a few records with trade starting with FR then the above is sub-optimal.
But for now... let's see if this handles the problem.
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