Robert Cemper · Jun 6, 2025 go to post

Loading compiled obj code from cache to partition should not have any remarkable impact.
But you are right by principle ! It's some kind of overhead and not for free.

If you place the affected code into a .INC routine you may share that piece
rather easy over multiple instances.
Though mostly not used in that way any Include may also contain executable code.
For a :MAC routine it's  nothing impressive.
For Class code it's a bit tricky but works as well

example ANNA.INC

anna(name) ;
 write !,"Hello ",name,!
 quit ">>>"_name_"<<<"

example Anna.CLS
 

/// demo for Anna
Include ANNA
Class A.Anna {
ClassMethod demo(name As %String) As %String
{
	quit $$anna(name)
}
}

It works:

SAMPLES>write "===",##class(A.Anna).demo("robert")
===
Hello robert
>>>robert<<<
SAMPLES>

So multiple loading is reduced.
You have of course also the option to compose a Custom Command in %ZLANG***.MAC
I just have no experience of how this impacts partition loading.
 

Robert Cemper · Jun 5, 2025 go to post

Studio shows the Error already during typing.

But this works fine as you expected:

BINGO !

composed by nI

Robert Cemper · Jun 5, 2025 go to post

Exactly.!
..#PARAMETER inserts a STRING
But >>>   $NAME() looks for a variable  also by indirection
 

USER>w $name("^rcc(1)")
 
W $NAME("^rcc(1)")
^
<SYNTAX>

USER>w $name(^rcc(1))
^rcc(1)
USER>s x="^rcc(1)"
USER>w $name(x)
x
USER>w $name(@x)
^rcc(1)
USER>
Robert Cemper · Jun 3, 2025 go to post

Hi Jean,

at first glance I'd expect the query plan for #18. and #19. should be quite similar
:SQL offers 3 levels to see the query plan

  • show                  
    • Show the execution plan for the current statement.
  • show pl[an] [v[erbose]]                          
    • Shows the current statement execution plan.                          
    • If the verbose qualifier is used, show all the module                          
    • details for the current statement's execution plan;                          
    • Otherwise, display only the top-level module details                        
    •  by default.
  • show planalt [v[erbose]]                          
    • Shows the current statement alternate execution plans.                          
    • If the verbose qualifier is used, show all the module                          
    • details for the current statement's execution plan and                          
    • all alternate plans; Otherwise, display only the                          
    • top-level module details by default..

This might offer a chance to identify the difference.
There's still an - unlikely - chance that #19  runs on some broken cached query,
that never was updated. so clear cached queries might be a possible solution. Not an explanation 
Best regards, Robert

Robert Cemper · Jun 1, 2025 go to post

Interoperability is not available in all namespaces.

Typically not in %SYS, but in USER
Check in Management Portal. where it is included.
 

Robert Cemper · May 29, 2025 go to post

I'm once more impressed by your contribution.
As often in past you leave the (mostly boring) mainstream,
look over the mental fence and bring tools and solutions 
beyond the usual compositions that I see repeatedly in my reviews.
this is just great! . 👏 👍

Robert Cemper · May 28, 2025 go to post

Hello community;

  • My name is Robert C. Cemper, graduate engineer from Vienna Technical University
  • I'm Austrian, born and still living in Vienna for 77 years. I'm married once and have 3 aged children.
  • Over the years I worked with several big companies in the emerging IT market, like SIEMENS, Olivetti, Digital Equipment, Compaq, ... finally InterSystems. My special story with InterSystems is available in this article 45 Years with Intersystems
  • Actually I'm  "retired but not tired" and follow Developer Community with unbroken interest. Especially because I had a similar proposal 10 years before it finally materialized. My feelings for it are quite similar to a grandfather  
  • My special interests are the core functionalities of the Global Storage, ObjectScript and SQL
  • Working close to the internals is my core competence, but also all network stuff. Actually im focusing on  Docker in the OpenExchange environment. 
  • My top hobby are computers for about 60 years and my whole career was based on it. I started with a console panel with toggle switches for the address and some others for the content. One of my teachers built the first transistor based computer in Europe.  Other hobbies like music, theater, skiing, hiking, biking, travel to other countries changed importance over time. At my retirement I returned to University to catch up with progress in Physics, especially Quantum Physics, Cosmology, Paleology, ... I also added Latin to my set of 4 spoken + 2 written languages.
  • I stopped LinkedIn as I was spammed by unacceptable job offers.
  • Due to health and social limitations I will not attend  READY 2025      
Robert Cemper · May 21, 2025 go to post

Write to a DataBase with no Read is not possible by principle.
Think if indices and other information for structural maintenance.
BUT:
You may create your own WRITE in a method, function, background job, ...
that elevates to RW access and drops it at completion.
details: Privileged Routine Applications

Robert Cemper · Apr 30, 2025 go to post

#1) in %SYS find the sessions by this Stored Procedure:

#2 Next based on the SessionId I can open the Object
 

%SYS>set sess=##class(%CSP.Session).%OpenId("kTkyVXwgxw")
%SYS>set pid=sess.ProcessId
%SYS>if $l(pid) set tSC=$$DeleteSession^%SYS.cspServer(pid)

The last row was found in  
Class %CSP.UI.Portal.CSPSessions
ClassMethod EndSession
Attention. Not every CSP Session has also a pid ! 

Robert Cemper · Apr 18, 2025 go to post

That's a typical case,
where I write my personal ZZanyname  function  into %ZLANGF00.mac
to hide the details

Robert Cemper · Apr 18, 2025 go to post

which version ?

I tried and failed.
CLASS DOES NOT EXIST>%FromOref+8^%Library.DynamicObject.1 *%Library.EntityProjectionUtil
SAMPLES>w $zv
IRIS for Windows (x86-64) 2024.3 (Build 217U) Thu Nov 14 2024 17:59:58 EST

Robert Cemper · Apr 14, 2025 go to post

Just to confirm naming in COS 
GlobalName is everything between Caret ^ and left Parenthesis (
GlobalSubscript is everything within left and right Parenthesis  ( ) 

Robert Cemper · Apr 14, 2025 go to post

Did you mean to map this Global ?
 ^DepartmentMasterData("^E2C8.D9IS.*")  ?????

or just ^E2C8.D9IS.*  ? with all subscripts

Robert Cemper · Apr 8, 2025 go to post

OK

To Stream needs 1 line 2 statements
 

ClassMethod personsidGET(messageRequest As dc.Sample.v3rest.requests.personsidGET) As %Stream.Object
{
 set stream=##class(%Stream.TmpCharacter).%New(),sc=##class(dc.Sample.Person).%OpenId(messageRequest.pathid).%JSONExportToStream(.stream)
 return stream
 }

To String is shorter (just 1 statement) as you don't need to initialize %String)

ClassMethod personsidGET(messageRequest As dc.Sample.v3rest.requests.personsidGET) As %String
 do ##class(dc.Sample.Person).%OpenId(messageRequest.pathid).%JSONExportToString(.string)
 return string
{
Robert Cemper · Apr 7, 2025 go to post

not just Sample.Person but also Sample.Address,
or whatever serial class you refer to require %JSON Adaptor.
then

set person=##class(Sample.Person).%OpenId(3)
>set sc=person.%JSONExportToString(.Jperson)
set zjson={}.%FromJSON(Jperson)
ZWRITE
Jperson="{"LIMIT":103,"Name":"O'Rielly,Xavier E.","SSN":"331-77-5308","DOB":"1957-05-26","Home":{"Street":"8757 Elm Place","City":"Miami","State":"FL","Zip":"92027"},"Office":{"Street":"413 First Drive","City":"Miami","State":"NH","Zip":"83830"},"Age":67,"RowVer":0}"
person=<OBJECT REFERENCE>[2@Sample.Person]
sc=1
zjson=<OBJECT REFERENCE>[13@%Library.DynamicObject]

and there is your dynamic object

Robert Cemper · Apr 1, 2025 go to post

there is no description of how to communicate with Butler
at the moment it hangs around like a lazy chap

Robert Cemper · Mar 10, 2025 go to post

Congratulations to the participants and winners.
Special BIG THANKS to the organizers and administrators of this contest. 💐🏵🌷🌻🌹
I'm really proud to see how this community has grown and raised in quality.

Robert Cemper · Mar 3, 2025 go to post

do ^ADMIN  indicates that you run a classic straight ObjectScript program.
while WRITE just has 1 direction to act  READ is bi-directional.
READ can send some text as prompt and waits for reply.
The only bi-directinal device I know of are network connections as TCP, UDP, TRM,FTP,..
The common feature is : they communicate out of your IRIS instance.
Inside IRIS 
you may do a redirection e.g to some TCP port like |TCP|7000
but then this port is blocked. No other process can touch |TCP|7000.
So you need an external port wrapper to some other port. e.g. |TCP|7100

Then you can handle this bi-directional communication either by sequence
or you have a list of prompts and the expected replies or similar. 

The sequence of operation could then be:

  • have a STARTER that runs in background
    • initiate the external wrapper 
    • run do ^ADMIN
  • start the FOREGROUND 
    • connect to external wrapper
    • send prompts to terminal
    • get replies from external file
    • send it back to port
    • which forwards it to  ^ADMIN hanging in background

 The most tricky point is to handle situations where the communication
if it is not just 1 Prompt :=> 1 Answer  but
multiple Prompts or WRITEs  :=>1 Answer or 1 Prompt :=> multiple Answers.
So I'd suggest instead of an IRIS internal solution rather look for an
external Terminal program to consume and apply your answer script.  
 

Robert Cemper · Feb 26, 2025 go to post

check if your lines start with the labels or if you have some leading <blank> or <tab>
if so it is interpreted as function call instead of a label

Robert Cemper · Feb 25, 2025 go to post

slightly shorter using Julian Date

USER>set hours=-3 write $zdt($zdth(hours*3600+$zdt($h,-2),-2))

Sorry, I just couldn't resist

Robert Cemper · Feb 25, 2025 go to post

From Ensemble.inc:
 

#define TRACE(%arg)             $$$catTRACE("user",%arg)
#define sysTRACE(%arg)          $$$catTRACE("system",%arg)
#define catTRACE(%cat,%arg)     Do:$$$DoTrace ##class(Ens.Util.Trace).WriteTrace(%cat,$$$CurrentClass,$$$CurrentMethod,%arg)
#;
#define DoTrace                 $S($D($$$EnsJobLocal("DoTrace")):$$$EnsJobLocal("DoTrace"),1:##class(Ens.Util.Trace).DoTrace())
#;
#define EnsJobLocal         %Ensemble
#;
. . . . 
Class Ens.Util.Trace [ Abstract, ClassType = "", ProcedureBlock, System = 4 ]
{
ClassMethod DoTrace()
{
	Set tJobConfigName=$$$JobConfigName
	Quit $G($$$ConfigTrace(tJobConfigName),0)||(""'=$G($$$JobTraceDevice))||$$$IsTerminalDevice($IO)
}

Robert Cemper · Feb 21, 2025 go to post

Never tried it for long time , but $system.CSP.Shell() might be a starting point
$system.CSP.*  seems to have some more useful methods.

Robert Cemper · Feb 20, 2025 go to post

I followed this rules with (1,1) as base
Starting any other point than (1,1) simply shortens the spiral.
now I reached 259

I really dislike the result as it is composed so unfriendly
just to save same bytes that nobody asked for.