$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()

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 documented
  • Users are encouraged to replace $ZU functions with methods and properties in InterSystems class libraries that perform the equivalent actions

Your specific example, $ZU(67,15,$j), is replaced by ##class(%SYSTEM.Process).ClientIPAddress($j).

Best,

Aaron

Hello Bob,

I believe something similar to the following is what others have been suggesting.

open file:("WNS"):3
if ('$test) {  write !,"Failed to open "_file  quit  }
use file
do ALL^%SS
close file
quit

This 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

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
}

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 Ensemble

ListBusinessServices() 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")
                }
}

$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.

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 globals

4.  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?