Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 05 JAN 2000 05:10:04PM Marc Radley wrote:

Re Date Stamp Posted Nov '99. To be more specific we want a simple way to copy a directory with REV files in it. Once a set of data tables are duplicated we are unable to alias attach the duplicate data set. This is because OI (and AREV) use the internal data stamp in the REVMEDIA file to decide this is the same volume. We want a way to change this internal date stamp perhaps by OSREAD and OSWRITE.


At 05 JAN 2000 05:27PM WinWin/Revelation Support wrote:

An oldie but a goodie…

Hope it helps

Mike Ruane

WinWin Solutions Inc.

/*

RENAME_VOLUME

VERSION    :  Advanced Revelation 2.12
PURPOSE    :  Changes the volume label (media name) on the volume directory
              and on all indexes in the target volume.
AUTHOR     :
CREATED    :
PROCEDURES :
WARNINGS   :
THEORY OF OPERATION :
REVISION HISTORY (Most CURRENT first)  :
   DATE       IMPLEMENTOR       FUNCTION
  1. ——- ————— ————
   MM-DD-YY   initials          Modification

*/

* $INSERT Blocks :

* COMMON Variables (Terminate with '%') :

* LABELED COMMON Variables (Terminate with '@') :

* EQUATE Variables (Terminate with '$') :

EQU OPEN_MEDIA$ TO 16

EQU OPEN_FILE$ TO 11

EQU WRITE_MEDIA$ TO 19

EQU TRUE$ TO 1

EQU FALSE$ TO 0

* MESSAGES called (Terminate with '$') :

* DECLARED - FUNCTIONS called :

* DECLARED - SUBROUTINES called :

DECLARE SUBROUTINE MSG

/

INDIRECT - FUNCTIONS/SUBROUTINES called if known (Make COMMENTS) :

/

/* PROGRAM TOP */

NAME='

TEXT=Volume to change?"

MSG(TEXT, 'RCE', NAME, ) * Logical volume? VOL_REC=XLATE('VOC',NAME,,'X')

IF VOL_REC THEN

 PATH=VOL_REC

END ELSE

 PATH=NAME

END

IF PATH-1,1 NE '\' THEN PATH := '\'

* Get a volume handle

CALL RTP57(OPEN_MEDIA$, 'RTP57', , PATH, , HANDLE, STATUS)

IF STATUS ELSE

 TEXT=UNABLE TO ACCESS VOLUME ':NAME
 MSG(TEXT,'','','')
 STOP

END

MEDIA_HANDLE=RTP57' : @VM : HANDLE

*————————————————————————

* Get the new volume label

NEW_VOLUME_LABEL='

TEXT=New volume name?'

MSG(TEXT, 'RCE', NEW_VOLUME_LABEL, ) IF NEW_VOLUME_LABEL ELSE STOP IF INDEX(NEW_VOLUME_LABEL,'"', 1) THEN TEXT=No quotes!' msg(TEXT,,,)

 STOP

END

* Stamp the new volume label on the media map

CALL RTP57(WRITE_MEDIA$, 'RTP57', HANDLE, , , NEW_VOLUME_LABEL, STATUS)

IF STATUS THEN

 NEW_VOL_LAB=TRUE$

END ELSE

 NEW_VOL_LAB=FALSE$

END

* Need to have a resolved select list

SELECT MEDIA_HANDLE

DONE=0

ID_LIST='

LOOP

 READNEXT @ID ELSE DONE=1
 ID_LIST=@ID

UNTIL DONE REPEAT

CHANGES=0

COL=0

FLAG='

LOOP

 REMOVE @ID FROM ID_LIST AT COL SETTING FLAG

WHILE FLAG

 READ @RECORD FROM MEDIA_HANDLE, @ID THEN
  • ', 1)
  • Is this a bang file?
    IF NAME1,1=!' THEN
       GOSUB CHANGE_INDEX
    END
 END ; * Read

REPEAT

STOP

*————————————————————————-

CHANGE_INDEX:

/* Three things need to be done:

     1) Open the !file
     2) Remove the !record (thereby forcing a re-init when next opened)
     3) Modify the !file record to change the volume label

*/

* Open the file with a direct BFS call

CALL RTP57(OPEN_FILE$, 'RTP57', HANDLE, @ID, , FILE_HANDLE, STATUS) IF STATUS ELSE TEXT=NAME : " can't be opened!" MSG(TEXT,,,)

 RETURN

END

FILE_HANDLE=RTP57' : @VM : FILE_HANDLE

* delete ! record

DELETE FILE_HANDLE, '!'

/* Change the volume label in !file rec:

  1. Loop through each entry (they are @SVM-delim).
  1. Match the 'field' (@TM-delim) against the index entries from *INDEXES. if there's a
  1. Match (relational only?) then change appropriately.
  1. The first field (@SVM delim) contains the file*acct*vol info;
    Change that as follows:

*/

BANG_REC_NAME=FIELD(NAME,'*',1)

READ BANG_REC FROM FILE_HANDLE, BANG_REC_NAME THEN

  • Change 'field' 1 to reflect the new file*acct*vol_label
 INDEX_INFO=BANG_REC
 CONVERT '*' TO @FM IN INDEX_INFO
 INDEX_INFO=NEW_VOLUME_LABEL
 CONVERT @FM TO '*' IN INDEX_INFO
 BANG_REC=INDEX_INFO
 /* Loop through the remainder, looking for relational index names.
    If one is found, change 'field' 5 (@TM-delim) to reflect current
    File*acct*volume. */
 CONVERT @SVM TO @FM IN BANG_REC
 INDEX_CNT=COUNT( BANG_REC, @FM ) + ( BANG_REC NE '' )
 FOR INDEX_CTR=3 TO INDEX_CNT
  • (Skip first two 'fields', as these do not contain relevant information)
    NEXT_INDEX=BANG_REC
    CONVERT @TM TO @SVM IN NEXT_INDEX
    NEXT_INDEX_NAME=NEXT_INDEX
    IF INDEX(NEXT_INDEX_NAME, '*', 1) THEN
  • Relational
       INDEX_INFO=NEXT_INDEX
       CONVERT '*' TO @FM IN INDEX_INFO
       INDEX_INFO=NEW_VOLUME_LABEL
       CONVERT @FM TO '*' IN INDEX_INFO
       NEXT_INDEX=INDEX_INFO
  • Fix the appropriate record for the relational index
       GOSUB FIX_RELATIONAL
    END
    CONVERT @SVM TO @TM IN NEXT_INDEX
    BANG_REC=NEXT_INDEX
 NEXT INDEX_CTR
 CONVERT @FM TO @SVM IN BANG_REC
 WRITE BANG_REC ON FILE_HANDLE, BANG_REC_NAME

END ELSE

 TEXT=BANG_REC_NAME: ' is not available!'
 MSG(TEXT,'','','')

END

RETURN

*————————————————————————

FIX_RELATIONAL:

/* For each relational index there is a record in the !file with the

 the key as per the name in the !file record.  This contains a
 file*acct*vol_label pointer that needs to be updated */

READ RELATIONAL_REC FROM FILE_HANDLE, NEXT_INDEX_NAME THEN

 INDEX_INFO=RELATIONAL_REC
 CONVERT '*' TO @FM IN INDEX_INFO
 INDEX_INFO=NEW_VOLUME_LABEL
 CONVERT @FM TO '*' IN INDEX_INFO
 RELATIONAL_REC=INDEX_INFO
 WRITE RELATIONAL_REC ON FILE_HANDLE, NEXT_INDEX_NAME

END

RETURN


At 06 JAN 2000 09:20AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Whilst Revelation Support's answer is perfect for AREV it will not work for OpenInsight for a number of reasons based in two areas.

1) AREV constructs omitting End Elses (such as Write and Delete) will not compile in OI. There is no STOP statement in OI.

2) The answer fails to address fundamental differences betwen OI and AREV.

The first area is easily addressed the second less so. Regretfully failure to address the second area will lead to data integrity problems.

The problems vis a vis OI can be split into three areas.

1) Volume information is also stored in the DBT file. This also needs to be updated. Failure to update this can lead to synchronisation errors.

2) Volume information is also stored in SYSVOLUMES. Failure to update this can lead to indexes getting out of sync.

3) Volume information in RevBoot has certain discrepancies which need to be addressed.

We have a program which addresses all of these issues (it was written for OI rather than AREV) and would be pleased to email the object code to all interested parties, please request via support@sprezzatura.com.

The Sprezzatura Group

[/i]World leaders in all things RevSoft[/i]

www.sprezzatura.com_zz.jpg


At 06 JAN 2000 09:45AM Mike Ruane wrote:

As Andrew has pinted out, this program is obviously written for Arev, version 2.12, as noted in the comments. It will also work in Arev3.


At 06 JAN 2000 10:04AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Actually you're right, READ needs a then else qualifier but write and delete will still compile without it.

The Sprezzatura Group

[/i]World leaders in all things RevSoft[/i]

www.sprezzatura.com_zz.jpg

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/bf5f403d99eea7828525685d0079c5c5.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1