Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emergency- Rebuild key

Status
Not open for further replies.

pado77

Programmer
Apr 9, 2003
9
IT
Hi,
I have a problem with a file clarion for Dos, I must rebuild a key in a file clarion only one key , because the file is 4 GB and i don't rebuild all file.
I would try with CSRT command :
Is possible use this command rebuilding just one key??
Can somebody help me???
Thank a lots

 
There is no way to rebuild ONLY one key with CSRT unless you write a program. If you have CRUN.exe & CCMP.exe then you can write a temp program, compile it with CCMP <progname> and run the compiled program with CRUN <progname>. The program would be as follows:

PROGRAM

<INSERT FILE STRUCTURE HERE>

CODE

OPEN(FILE)
IF ERRORCODE() THEN STOP('FILE : ' & ERROR()).

BUILD(KEY)
IF ERRORCODE() THEN STOP('FILE : ' & ERROR()).

CLOSE(FILE)

RETURN
 
Thanks a lot for the answer, but now I have another question.
If the file contain duplicate record, make the command build one of two records will delete??

Thanks
bye bye
 
If the key has got a DUP attribute, key records are generated for both records which can be accessed in a NEXT() or PREVIOUS() statement, but a GET() will result in only the first record being fetched.

If the key has NOT got a DUP attribute, CSRT generated key records for both records but creates a filename.BLD file showing all duplicate key entries. I do not know what happens when you rebuild thru a program i.e. does it create a BLD file or not?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top