InterSystems FAQ rubric
The location of the currently executing code can be obtained using the $STACK function: $STACK($STACK,"PLACE").
Please refer to the following document for sample code.
InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.