Many programming languages use the try-and-catch construct to handle runtime errors gracefully. If the code within the try block encounters an error, it will throw an exception to the catch block, where the error handling occurs.
Outlined below is an example of how to check if a directory exists:
Set directoryName="c:\temp\nosuchdir"
/* Check for existence of a directory - Return Value: 0 - directory does not exist; 1 - directory does exist */
Set directoryExists=##class(%File).DirectoryExists(directoryName)
If ('directoryExists) // do the processing for when a directory does not exist
Outlined below is an example of how to check if a file exists:
The power of the presented tool becomes visible with a large JSON file. The example I have prepared is composed of the daily results of AoC 2023. Anonymization makes it usable for demo purposes.
You can hide the source by exporting/importing only the *.obj that is generated after compiling the source program.
The command execution example specifies EX1Sample.obj and EX2Sample.obj, which are generated by compiling EX1Sample.mac and EX2Sample.mac, as export targets and exports them to the second argument file.
After moving to another namespace, I am using the exported XML file to perform the import.
If you need to migrate your server for some reason, you can reduce the setup work by copying configuration information from the pre-migration environment to the post-migration environment.
The following setting information can be migrated.
Their products can be just as useful as they are complex.
Yet, our pride sometimes prevents us from admitting that we might not understand some concepts or products that InterSystems offers for us.
Today we are beginning a series of articles explaining how some of the intricate InterSystems products work, obviously simply and clearly.
In this essay, I will clarify what Machine Learning is and how to take advantage of it.... because this time, you WILL KNOW for sure what I am talking about.
After reading Stephen Wilson's article "Windows 7 performs shutdown too fast for Cache to close and so it gets forced down" I've recalled another solution that was based on Local Group Policy, which allows to control extra actions that should occur on computer startup or shutdown. How to add a computer shutdown script is well documented in MS Technet article.
If your application is raising <PROTECT> errors and you're finding it hard to work out why, here's a way to get additional information.
First, if auditing is not already enabled, turn it on:
Then use "Configure System Events" (highlighted above) and locate the event named %System/%Security/Protect. In the screenshot below I used the Filter field to do this (type "protect" - highlighted below - and press TAB):
In Studio you could open a class directly via it's name, without having to traverse the package tree with multiple clicks until arriving at the desired class.
You would Ctrl + O or (File -> Open) and be able to simply type in the class name, for example:
The information in this document is current as versions of InterSystems products released through 2024-06-06. This update date covers errors in that discovered up to 2024-08-12, but not changes present in new versions of InterSystems products.
Nevertheless, the details for existing products are not subject to frequent change.
As more people join Developer Community, and with increasing efforts to promote code sharing, I'd like to draw fresh attention to this post I wrote a year ago. It spotlights a feature within the class compiler which is both useful and dangerous. When importing code (e.g. from an XML export of classes received from someone), it's worth considering the risks.
Even if that post doesn't seem relevant to you at the moment you may wish to note it for the future. A handy way of doing this is to click the star icon at the end of it.
I'm looking for some field experiences, lessons learned, or actual deployed solutions to the problem of replicating non-CACHE.DAT data in a mirrored Cache environment.
Here at InterSystems, we often deal with massive datasets of structured data. It’s not uncommon to see customers with tables spanning >100 fields and >1 billion rows, each table totaling hundred of GB of data. Now imagine joining two or three of these tables together, with a schema that wasn’t optimized for this specific use case. Just for fun, let’s say you have 10 years worth of EMR data from 20 different hospitals across your state, and you’ve been tasked with finding….
Every developer has made the mistake of accidentally leaving temporary debug code in place when they meant to remove it after debugging is complete. The great thing about writing in ObjectScript is that there is a way to make temporary code be truly temporary and automatically self-destruct! This can also be done in such a way that the code has no change of making it into your source control stream, which can be helpful as well.
You can set the maximum size of the IRISTemp database at IRIS startup by setting a configuration parameter called MaxIRISTempSizeAtStart.
After setting, the system will truncate IRISTemp to the set value (MB) at the next IRIS startup. If the current size is less than the specified MaxIRISTempSizeAtStart, no truncation will occur. Also, if 0 is specified, truncation will not be performed, so the size will start without changing. (Default) Settings are made from the menu below.
Caché 2015.2 announced support for TLS v1.1 and v1.2. In this version, the SSL/TLS configuration page provides checkboxes for TLS v1.1 and v1.2, which allows the versions to be configured individually. This allows sites to, for example, require TLS v1.2 only.
Additionally, some earlier versions of Caché provide undocumented support for TLS v1.1 and v1.2, specifically Caché 2014.1.3 and above and 2015.1, on Windows, Linux and Unix.
In this post I would like to talk about the syslog table. I will cover what it is, how you look at it, what the entries really are, and why it may be important to you. The syslog table can contain important diagnostic information. If your system is having any problems, it is important to understand how to look at this table and what information is contained there.
In case you've never used the "About" link at the top of Management Portal, here's a screenshot of the kind of information it shows. I've highlighted the link and some of the information I find it handy to get from here.