Is there any way that I can check the native type of an object script variable? (similar to the typeof check in javascript)


I see that the DynamicArray class uses the type of the variable for its output, I would like to do something similar when I receive a value as an argument to my method.

USER>s var1 = 123  //No quotes, number type
USER>s var2 = "123" //quotes, string type

0 3 391

Using the following...

//Get PDF stream object previously saved
   Set pdfStreamContainer = ##Class(Ens.StreamContainer).%OpenId(context.StreamContainerID)
   Try {
     Set pdfStreamObj = pdfStreamContainer.StreamGet()
   Catch {
      $$$TRACE("Error opening stream object ID = "_context.StreamContainerID)

Would it be possible to search the pdfStreamObj for certain values like a Medical Record, or Patient Name?



0 1 584


Thanks for your time.

Plain $ZF(-1) and $ZF(-2) calls from Cache Studio or Terminal have stopped launching the OS shell from Win10.

cmd (Windows Command Prompt) should be launched.


Windows 10 Anniversary Update, Ensemble 2016.2.0.585.0 Developer Edition x64

Is this common? I have enabled both %Developer role and a Cache CallOut privilege for all users that operate in this scenario.

In Terminal, W $ZF(-1) prints -1, W $ZF(-2) prints -1

In Studio, W $ZF(-1) hangs the IDE, W $ZF(-2) prints 0

0 2 768

We don't often use SQL within our org, which is mostly due to the performance issue we experience due to the quantity of data we are reviewing.

Aside from the standard performance measures for non-Caché databases, are there any recommended approaches when querying large tables?

The table would have roughly 50M records, but there are not a finite amount of sub-nodes.

0 7 727
Scott Roth · Nov 22, 2016
Cache Syntax - Directory Exists

I am trying to write some code to check to see if a directory exists before creating a new directory.


When I do the following I am not getting a response, but the directory exists..

do ##class(%File).DirectoryExists("/ensemble/")

am I missing something?

0 5 703
Importance and Collection of Exact Version Information ($zv / $zversion)
The explanation of:
- why collecting $zv is important (The WHY),
- what the components of $zv mean (The WHAT),
- and how to collect $zv (The HOW). 
(The Ultimate $zv Guide to the ISC Galaxy in large, friendly letters)
1 4 1,120

A new Health Connect customer has a few experienced Java folks on their interface team. As they get more into Health Connect and learn Caché ObjectScript they thought it would be useful to have a list of common Java statements with an equivalent statement in ObjectScript. They mentioned string manipulation as an example, but would be interested in other areas as well.
This seems like something that is probably already floating around somewhere. Does anyone have something like this or other "COS jumpstart for Java devs" materials?



0 1 322

Environment: Cache for Windows (x86-64) 2015.2.2 (Build 811U) Thu Mar 3 2016 12:55:48 EST [HealthShare Modules:Core:14.01.351 

When try the following to send back SOAP Fault, is the following correct way?

Set fault=##class(%SOAP.Fault).%New()
Set fault.faultcode=$$$FAULTServer
Set fault.faultstring="Processing Error"
Set fault.detail= "Error on server"
Do ..ReturnFault(fault)

0 1 477

Here's an easy one for you; before I spend another hour looking for the answer, how do you convert %ArrayOfDataTypes to an array (that could, say, fit into the %session.Data array, or maybe just some array named info()), and of course back again?

NS>s aodt=##class(%ArrayOfDataTypes).%New()
NS>w aodt.SetAt("lcavanaugh","username")
NS>w aodt.SetAt("organization","coolcompany")
NS>w ##class(%ArrayOfDataTypes).BuildValueArray(aodt,.array)

0 3 658

I try to run the cmd command in the studio terminal, but i am getting the <NOTOPEN> Error.

Even ZF(-1) also not working. Any help, Please!!!


Note: i restart the Cache instance service with full privilege



Set Path="mkdir E:\Sample\New"

Open Path:"QR":10



This command working on my PC, but on server throws error.


Many Thanks

0 3 702
Uri Shmueli · Nov 3, 2016
Simple Arithmetics

Can somebody explain this behaviour of Cache (and many other calculating machine as well) :

WRITE 1/3*12


WRITE 1/3*5


W 1/3*18


W 1/3*21


W 1/3*24


How can we make more occurate caculations in Cache ?

0 2 566

I was recently asked whether we have a function to convert LDAP date time stamps into $HOROLOG format or other formats and the answer is not at the moment, but there is a simple method to do the conversion.

Let us look at the facts and figures involved...

1) Active Directory's (AD) date 0 (zero) is 1601-01-01 00:00:00.000 or January 1st, 1601 at midnight (00:00:00)

2) AD timestamps are calculated as the number of 100 nanosecond intervals from date 0

3) 864000000000 is the number of 100 nanosecond intervals per day

0 0 722

Here you have an easy way to write and execute COS code from your unix scripts. This way one does not need to write routines or even open Studio or Atelier. It can be an option for simple and small actions for instance things like installation tasks or compiling.

See sample bash script ( to compile classes:

0 2 693
Rustam Ibragimov · Sep 9, 2016

Hello, guys. 

I found one interesting moment in Cache Object Script. It doesn't have(or at least I didn't find) trimming function. By trimming I mean if a string has some whitespaces/tabs/carriage returns from very beginning or/and from very right, this function removes them. 

  I have found several workaround ways. 

1. Using Cache Basic

0 6 1,309

Wir suchen für ein Unternehmen unserer Firmengruppe

eine/n ERP System Developer / Programmierer/ Software Entwickler

Unser Partnerunternehmen ist ein international agierendes Handelsunternehmen mit Sitz in der Nähe von Wien.

Der zukunftsorientierte IT Bereich entwickelt intelligente innovative Lösungen für die Vielfalt der Herausforderungen, die sich täglich stellen. Die Fülle der abwechslungsreichen Aufgaben und Projekte, sowie die Art und Weise wie zusammengearbeitet wird, bietet hervorragende Wachstums- und Entwicklungschancen.

0 0 467