User bio
404 bio not found
Member since Jan 29, 2019
Replies:

I noticed that you're using Cache 2018.1. I'd like to just warn you that as of Cache 2017, this functionality was quite broken and InterSystems recommends you not use it. I don't know if it was fixed in 2018 or a later version, so I don't know for sure if your version is affected, but it's something you may want to be aware of.

If the functionality wasn't fixed in 2018, you can still recover the space in the database but it will have to be offline as no modifications to the database can happen during the process. There's a utility named ^GBLOCKCOPY that can copy all of the global database blocks from your existing database to a new one where the new database will only grow as large as necessary thereby reclaiming the free space.

See my answer to this post: https://community.intersystems.com/post/ensemble-2013-compacttruncate

And, here's more documentation regarding the ^GBLOCKCOPY utility: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GSTU_remote_gblockcopy

Hope this helps!

With more recent versions, yes. The user didn't state what version Ensemble was in use, so I figured offering a solution that would work as far back as Ensemble 2009 wouldn't necessarily be a bad thing. I still have to support Ensemble 2012 and I did test the *-1 functionality there, and in that version this functionality did not yet exist. (Actually, a few sites I support are still using Cache 5.x. It may be geriatric, but it keeps on plugging along... :-) )

The $LENGTH function can give you the number of PIECEs in a string, and the $PIECE function can grab multiple pieces, so for your example:

S DELIM="D"
S STRING="aaDtext1Dtext2"
W $PIECE(STRING,DELIM,1,($LENGTH(STRING,DELIM)-1))

Edit: Links to documentation for the $PIECE and $LENGTH functions:

$PIECE: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_fpiece

$LENGTH: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_flength

Hope this helps!

Certifications & Credly badges:
Roger has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Roger has no followers yet.
Following:
Roger has not followed anybody yet.