Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

ERASE ALL ON A DATATRIEVE CROSS

SOLVED
Go to solution
panneer
Occasional Contributor

ERASE ALL ON A DATATRIEVE CROSS

We cross two files A and B over X(a common field).
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
ERASE ALL

This is not working. Kindly give a solution.
2 REPLIES
Volker Halle
Honored Contributor

Re: ERASE ALL ON A DATATRIEVE CROSS

Panneer,

welcome to the OpenVMS ITRC forum.

Would you please kindly provide any error message returned by DTR when you use ERASE ALL in this context ?

This may help others to diagnose the problem.

Volker.
Hein van den Heuvel
Honored Contributor
Solution

Re: ERASE ALL ON A DATATRIEVE CROSS

It's trying to delete records from both domains. You don't want that.

There are Datatrieve manuals online at:

http://www.sysworks.com.au/swadm_dat_root/axpdocjun04/dtraxp72a.html

From there:

" 8.8 Erasing Records
:
You cannot erase records in a view based on more than one domain or records specified by an RSE that contains a CROSS clause."

You probably want to build a FOR loop.
here is an example using 'yachts' where I edited yacht.seq to have fewer records than yachts.


$ copy yacht.dat_orig yacht.dat
$ datatrieve
DATATRIEVE V7.3
Digital Query and Report System
Type HELP for help
DTR> ready yachts write
DTR> ready yachts_sequential shared read
DTR> find yachts_sequential
[49 records found]
DTR> find yachts
[113 records found]

DTR> for a in yachts_sequential erase all of yachts with type = a.type;
DTR> find yachts
[64 records found]

An other Datatrieve site, with unfortunately some stale links:

http://dtrwiz.home.netcom.com/

hth,
Hein.