go to post Aaron Wassall · Jul 23, 2019 $ZU functions are deprecated and no longer documented, and users are encouraged to replace $ZU functions with methods and properties in InterSystems class libraries that perform the equivalent actions.In this case, $zu(96,14) is replaced by ##class(%Library.Device).GetType()
go to post Aaron Wassall · Jul 23, 2019 Hello,This isn't the question you asked, but since you mentioned $ZU functions, please bear in mind that:$ZU functions are deprecated$ZU functions are no longer documentedUsers are encouraged to replace $ZU functions with methods and properties in InterSystems class libraries that perform the equivalent actionsYour specific example, $ZU(67,15,$j), is replaced by ##class(%SYSTEM.Process).ClientIPAddress($j).Best,Aaron
go to post Aaron Wassall · Jul 19, 2019 Hello Bob,I believe something similar to the following is what others have been suggesting.open file:("WNS"):3if ('$test) { write !,"Failed to open "_file quit }use filedo ALL^%SSclose filequitThis works for me. Is this what you did? Is it not working for you?Note that, unlike my minimal example, your code should of course include proper error trapping/handling.Hope that helps,Aaron
go to post Aaron Wassall · Apr 3, 2019 Here's one that worked for me. Day2(filename) PUBLIC { set input=##class(%Stream.FileCharacter).%New() set input.Filename=filename set doubles=0,triples=0 while 'input.AtEnd { set string=input.ReadLine() kill chars set D=0,T=0 for pos=1:1:$length(string) { set count=$increment(chars($extract(string,pos))) if (count=2) { set D=D+1 } elseif (count=3) { set T=T+1 set D=D-1 } quit:((D>0)&&(T>0)) } set doubles=doubles+(D>0) set triples=triples+(T>0) } write !,"Doubles: "_doubles write !,"Triples: "_triples write !,"Checksum: "_(doubles*triples) quit }
go to post Aaron Wassall · Mar 2, 2018 Hello CJ,I believe you are referring to $ztrap, for which the documentation can be found here:http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_vztrapAre you just curious about how it works? Is this part of a "bigger picture" that you are looking for guidance on?
go to post Aaron Wassall · Jan 25, 2018 Hello Scott,I was playing around with the EnumerateConfigItems query in the Ens.Config.Production class, and it seems like it might do what you're asking. Below is some basic example code to demonstrate, but of course you should test this out yourself and add proper status checking and error handling before putting it to use.If you are interested in other fields returned by this query, you can take a closer look at its class reference documentation.#include EnsembleListBusinessServices() PUBLIC { Set productionName = "Demo.Loan.FindRateProduction" Set tStatement = ##class(%SQL.Statement).%New() Set pStatus = tStatement.%PrepareClassQuery("Ens.Config.Production","EnumerateConfigItems") Set tResult = tStatement.%Execute(productionName,$$$eHostTypeService) While tResult.%Next() { Write !,tResult.%Get("ConfigName") }}
go to post Aaron Wassall · Oct 20, 2017 Hello Nic,One option for running code at Caché startup is the SYSTEM tag in ^%ZSTART. Have you considered this option?http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
go to post Aaron Wassall · Aug 2, 2017 Just for the record, "h" is short-hand for "halt".http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
go to post Aaron Wassall · Jun 26, 2017 $System.Util.InstallDirectory() can be used to obtain the install directory.$System.Version.GetOS() returns the OS for which the product was built. Note that this method essentially just parses this information out of the $ZV string.
go to post Aaron Wassall · Jun 12, 2017 Hello Laura,If you are doing this interactively, then the ^JOBEXAM utility might come in handy:1. Do ^JOBEXAM (in the %SYS namespace of a terminal session)2. Type E and then enter either the Job # or P followed by the pid of the target process (e.g. P7176)3. Type P to view process-private globals4. Enter the name of the process-private global you want to examine. Examples:Process Private Global (?): testing^||testing(1)="64446,44431"^||testing(2)="64446,44770" Process Private Global (?): testing(1)^||testing(1)="64446,44431"Does this help you accomplish what you were trying to do?