List out unchecked mapped items classes through terminal?


I would like to list out unchecked mapped items ( classes in management portal )  classes of a particular namespace. Is there any code or terminal command which i can use ?

I am able to list out classes of namespace . But I need to list out unchecked mapped items classes

do ##class(%SYSTEM.OBJ).GetClassList(.result)



If you don't mind working a the global level, here's a way of enumerating the classes that are stored in the default code database of a namespace:

USER>s namespace="%SYS"                                                          
USER>s impliedNamespace="^"_##class(%SYS.Namespace).GetGlobalDest(namespace,"^oddDEF")
USER>w impliedNamespace
USER>s className="" f  s className=$o(^|impliedNamespace|oddDEF(className)) q:className=""  w !,className


The above code is working fine. It is displaying the list of classnames in terminal. 

We would like to insert the result ( class names ) into an array and display it so that we can delete these files.

Is there any code or command to achieve this. 


Arpitha R 


Please explain what you mean by "unchecked".

As for "mapped", the following may give you what you seek.

For classname, e.g. %Library.String, this expression will return true (1) if the class is mapped from a database that is not the default code database for the current namespace:




we want to list out the classes which have been created by me in namespace.

For example : In "%SYS" namespace we have created three classes and i want to list out these three classes in terminal.

please suggest the commands.



There is no command like utility that I know of to do this.

Classes are compiled down to routines and there is a command line utility for listing these...

Do ^%RD

Whilst there is no utility, you can write your own that queries the %Dictionary.CompiledClass, e.g. in SQL you can do...

select * from %Dictionary.CompiledClass

There is also a quick and dirty way to list from that storage class using the following from the command line...

set cn="" for  set cn=$order(^oddCOM(cn)) q:cn=""  if $e(cn,1)'="%",$e(cn,1,3)'="Ens",$e(cn,1,2)'="HS" write !,cn

*Its a one liner but it's wrapping on the comments (cut and paste it into terminal as one line).

Its a bit of a hack, but it should work. I have put a filter in so that it does not list system classes that I can think of, you might want to tinker with this to fit your needs. Remember to honor the spaces (there are two after the for and two after the quit).


You mentioned that you have created three classes in the %SYS namespace.

Be careful doing this as you can lose your code doing an upgrade.

If you want to have common code that is accessible from all of your other namespaces then it is better to create a common namespace and then map that namespace to the others.