Use of $ZUTIL(49) is deprecated

Hi all,

I'm using $ZUTIL(49) to get information of the databases I want to add to a mirror. This information is passed to ##class(SYS.Mirror).CatchupDB(plstPathDatabases)  in order to Catchup all databases addes to a Mirror.

I know that ZUTIL is deprecated and I'd like to know what function or functions I have to use in order to get all necessary information for CatchupDB.

 

Thanks a lot

  • 0
  • 0
  • 416
  • 10
  • 1

Answers

All replacements for different $zu you can find here

so, in case with $zu(49), you can get such information with class SYS.Database, and it's not delimited now, and has properties

 

Hi Dmitry,

Thanks for your response.

I see that page you tell me but the main problem is that I don't know what are the properties or methods of SYS.Database that I have to use because I don't know what are the fields ZU(49) is sending to me.

Can you help me on this? Where can I find the exact data ZU is returning?

Thanks in advance

 

ParseZU49Info method in SYS.Database class translates $ZU(49) call into SYS.Database properties.

That's what I'm trying yo do but I can't figure out all the properties I have to use.

$ZU49 is sending 24 values comma separated and after searching for documentation i can find 6 of them. But many others as Field 14 -> "System file number, regardless of whether the file is currently mounted or dismounted." don't know where to find it.

And also there are some others marked as values for iternal reference that I can't figure out what they are.

Thanks for your response.

 

Check where in ParseZU49Info it takes field 14 and what property does it fills with that information.  Check %syDatabase.inc for more information.

#; Pieces of return value from $zu(49)
#define mountpiece 1
#define blksizpiece 2
#define uicpiece 3
#define filsizpiece 4
#define expandpiece 5
#define maxblkpiece 6
#define glodirpiece 7
#define gloptrpiece 8
#define rdirpiece 9
#define rgrpiece 10
#define glogrpiece 11
#define freezepiece 12
#define colpiece 13
#define sfnpiece 14
#define totvolpiece 15
#define formatpiece 16
#define attribpiece 17
#define statuspiece 18
#define exptimepiece 19
#define nojrnpiece 20
#define bigdbpiece 21
#define curblkspiece 22
#define blkspermappiece 23
#define curmapspiece 24
#define resourcepiece 25
#define enckeyidpiece 26

Thanks!!

That is much better!!!

Hope this can help me

I found ParseZU49Info method in Sys.Database but the is empty.

How can I know what's on it?

Method ParseZU49Info(
As %String,
setupMirrorFields As %Boolean) As %Status [ Internal ]
{
}

Sorry, I forgot that SYS.Database is deployed. You'll need to match $zu(49) to properties manually. But the macros usually have the same name. For example field 14 is sfnpiece macro ("piece" part of the name is irrelevant, so just sfn it is) and it corresponds to SFN property in SYS.Database.

 

To test, you can write the following method:

ClassMethod Test( Directory )

{
    Set db=##Class(SYS.Database).%OpenId(Directory)
    Write db.SFN = $p($zu(49),",",$$$sfnpiece) //14th piece
    // More checks
}

 

Sorry for my doubts but I'm a bit confused.

Ok how it works in case of 14 but how about case 12(#define freezepiece 12)

I don't have freeze property

 

12th piece is the FreezeOnError property for a Database and is always set to on (since 2008.1.0.217.0). The corresponding property FreezeOnError was removed from SYS.Database class.