Robert Cemper · Apr 17, 2022 go to post

It is rather brute force but matches your decision to skip rollbacks: 

while $TLEVEL { TCOMMIT }

to be sure to catch all cases I'd place it in a  %ZSTOP.mac 
It's the reverse of %ZSTART.    >>  docu

Robert Cemper · Apr 7, 2022 go to post

at first sight, it looks like an issue on variable scoping with embedded SQL
a quite old issue
try %suspendedCount instead of suspendedCount
 

&sql(SELECT count(ID) into :%suspendedCount FROM Ens.MessageHeader where TargetQueueName not like '_S%' and TargetQueueName not like 'ENS%' and Status='Suspended' )
resulting  0 into suspendedCount
Robert Cemper · Apr 3, 2022 go to post

To force it to string you have to append some non numeric character ! 
but this one is then part of the subscript as $c(0) or whatever you append
in addition, you break the numeric sort and change to string sorting.

USER>set s1=111,s2=444,q="."
USER>set a(s2)=1,a(s1)=2,a(s1_q)=3,a(s2_q)=4
 
USER>zw a
a(44)=1
a(111)=2
a("111.")=3
a("44.")=4
Robert Cemper · Apr 2, 2022 go to post
 
USER>set s1=111,s2=444
USER>set a(s2_$c(0),s1_$c(0))=77
USER>set a($c(0)_s1,$c(0)_s2)=99
USER>zwrite
a("111","444")=99
a("444","111")=77
s1=111
s2=444
USER>

"save it from the class " ?  whatever that may mean .... ?

Robert Cemper · Mar 30, 2022 go to post

you may try

USER>write $tr("abcdefghijkl","abcdxefxghxijxkl","2022-03-29T15:10:00+0100")
Robert Cemper · Mar 29, 2022 go to post

SendRequestSync   is an object method that requires an object as the base.
##class(Ens.BusinessService).SendRequestSync(   works for ClassMethods only.
You need an object instance of Ens.BusinessService to call it.
##class(Ens.BusinessService).%New().SendRequestSync( 
might be a dirty workaround

Robert Cemper · Mar 29, 2022 go to post

just checked %Library.Routine
- a sample of many %R* routines
- lots of @ indirections
- DO with . (dot) syntax
- and of course GOTO.
Just to qualify the code inside.

Robert Cemper · Mar 29, 2022 go to post

I guess all you need is to redirect the ouput of %RCMP  to some %Stream of SPOOL:
In addition, you have %RCMP in your installation and just pick out what you need.

Robert Cemper · Mar 28, 2022 go to post

method FindAt(position As %Integer, target As %CacheString, ByRef tmpstr As %CacheString = "", caseinsensitive As %Boolean = 0) as %Integer

Find the first occurrence of target in the stream starting the search at position. It returns the position at this match starting at the beginning of the stream. If it does not find the target string then return -1. If position=-1 then start searching from the current location and just return the offset from the last search, useful for searching through the entire file. If you are doing this you should pass in tmpstr by reference in every call which is used as a temporary location to store information being read so the next call will start where the last one left off. If you pass caseinsensitive=1 then the search will be case insensitive rather than the default case sensitive search.

Copy to String may help but is limited by MAXSTRING size.
There you may use [  (=contains OPERATOR) or $FIND() function
Don't mix up SQL predicate %CONTAINS  with [  (string contains operator)

  •  
Robert Cemper · Mar 25, 2022 go to post

Enfin la communauté dans la langue de
Robert le Magnifique et son fils Guillaume le Conquérant. !
* * * * *  + + +    * * * * *
smileyyes

Robert Cemper · Mar 24, 2022 go to post
  • That raised the level but was no general solution.
    • As I failed in my Docker container I didn't push it to DemoServer not to break it.
  • Neither Embedded nor (external) Python was able to handle it by standard approach.
  • I did my customized solution to handle any size of JSON file.  

my workaround

Robert Cemper · Mar 23, 2022 go to post

sorry, I have no  idea what  X12 204 EDI is structured. or what you talk about

Robert Cemper · Mar 21, 2022 go to post

I have added a new version  for the GLOBALS contest
To take care of large Globals that may break your available memory.
The JSON Object is exported to a file. and there is also the related loader

New Version 0.1.0

USER>write ##class(dc.GblToJSON.EX).export("^dc.MultiD")
File gbl.json created

And the related loader creates the Global

USER>write ##class(dc.GblToJSON.EX).import()
Global ^dc.MultiD loaded

It is of course also available in the Online Demo facility.  
And to see the generated file there is a show() method

USER>write ##class(dc.GblToJSON.EX).show()
{"gbl":[
{"node":"^dc.MultiD","val":5},
{"node":"^dc.MultiD(1)","val":"$lb(\"Braam,Ted Q.\",51353)"},
{"node":"^dc.MultiD(1,\"mJSON\")","val":"{}"},
{"node":"^dc.MultiD(2)","val":"$lb(\"Klingman,Uma C.\",62459)"},
{"node":"^dc.MultiD(2,2,\"Multi\",\"a\")","val":1},
{"node":"^dc.MultiD(2,2,\"Multi\",\"rob\",1)","val":"rcc"},
{"node":"^dc.MultiD(2,2,\"Multi\",\"rob\",2)","val":2222},
{"node":"^dc.MultiD(2,\"Multi\",\"a\")","val":1},
{"node":"^dc.MultiD(2,\"Multi\",\"rob\",1)","val":"rcc"},
{"node":"^dc.MultiD(2,\"Multi\",\"rob\",2)","val":2222},
{"node":"^dc.MultiD(2,\"mJSON\")","val":"{\"A\":\"ahahah\",\"Rob\":\"VIP\",\"Rob2\":1111,\"Rob3\":true}"},
{"node":"^dc.MultiD(3)","val":"$lb(\"Goldman,Kenny H.\",45831)"},
{"node":"^dc.MultiD(3,\"mJSON\")","val":"{}"},
{"node":"^dc.MultiD(4)","val":"$lb(\"\",\"\")"},
{"node":"^dc.MultiD(4,\"mJSON\")","val":"{\"rcc\":122}"},
{"node":"^dc.MultiD(5)","val":"$lb(\"\",\"\")"},
{"node":"^dc.MultiD(5,\"mJSON\")","val":"{}"}
]}
***** gbl.json *****
Robert Cemper · Mar 21, 2022 go to post

I have added a new version  for the GLOBALS contest
To take care of large Globals that may break your available memory.
The JSON Object is exported to a file. and there is also the related loader

New Version 0.1.2

USER>write ##class(dc.GblToJSON.CX).export("^dc.MultiD")
File gbl.json created

And the related loader creates the Global

USER>write ##class(dc.GblToJSON.CX).import()
Global ^dc.MultiD loaded

It is of course also available in the Online Demo facility.
And to see the generated file there is a show() method

USER>write ##class(dc.GblToJSON.CX).show()
{"gbl":[
"^dc.MultiD=5",
"^dc.MultiD(1)=$lb(\"Braam,Ted Q.\",51353)",
"^dc.MultiD(1,\"mJSON\")=\"{}\"",
"^dc.MultiD(2)=$lb(\"Klingman,Uma C.\",62459)",
"^dc.MultiD(2,2,\"Multi\",\"a\")=1",
"^dc.MultiD(2,2,\"Multi\",\"rob\",1)=\"rcc\"",
"^dc.MultiD(2,2,\"Multi\",\"rob\",2)=2222",
"^dc.MultiD(2,\"Multi\",\"a\")=1",
"^dc.MultiD(2,\"Multi\",\"rob\",1)=\"rcc\"",
"^dc.MultiD(2,\"Multi\",\"rob\",2)=2222",
"^dc.MultiD(2,\"mJSON\")=\"{\"\"A\"\":\"\"ahahah\"\",\"\"Rob\"\":\"\"VIP\"\",\"\"Rob2\"\":1111,\"\"Rob3\"\":true}\"",
"^dc.MultiD(3)=$lb(\"Goldman,Kenny H.\",45831)",
"^dc.MultiD(3,\"mJSON\")=\"{}\"",
"^dc.MultiD(4)=$lb(\"\",\"\")",
"^dc.MultiD(4,\"mJSON\")=\"{\"\"rcc\"\":122}\"",
"^dc.MultiD(5)=$lb(\"\",\"\")",
"^dc.MultiD(5,\"mJSON\")=\"{}\""
]}
***** gbl.json *****
USER>
Robert Cemper · Mar 17, 2022 go to post

Hi @Joel Solon ,  I see it that way:
COS  is aged but was not as short as M (even more aged)
but InterSystemsObjectScript  are 24 Character to type ! 
At least 18+ chances for mistyping with my old fingers. laugh
So I have my personal FLA  (4 letter abbreviation)  to write  "new-speak" and get it sorted right.

Robert Cemper · Mar 15, 2022 go to post

LOAD DATA was released with IRIS 2021.2 and was unknown before
Your version is 2020.1  only.
Sorry