go to post Robert Cemper · Jul 30, 2019 if you can't use the required version of $ZF(-100.....)you still may try CPIPE as described here Execute Server Commands from Caché / Ensemble / IRIS
go to post Robert Cemper · Jul 30, 2019 Your problem is that "pwd" is not a valid command in WINDOWS !!! use instead "echo ^%cd^%"ref: https://stackoverflow.com/questions/921741/windows-equivalent-to-unix-pwdthis works: USER>s a=$zf(-100,"/SHELL","echo %cd%") d:\database\www17\user
go to post Robert Cemper · Jul 21, 2019 I stated:name your config SMP<port> that is SMP57772 or just 57772then the config name reflects the SMP port
go to post Robert Cemper · Jul 20, 2019 on WIN the config name is burned into the registry Computer\HKEY_CURRENT_USER\Software\InterSystems\Cache\Configurations\......UNIX/Linux has some structure simulating Win_Registry. Support experts will know the details.
go to post Robert Cemper · Jul 20, 2019 Your terminal prompt can be configured to display the instance. see TerminalPrompt eg. config>namespace> [Startup] TerminalPrompt="3,2" and you name your config "SMP<portnumber>" which should be valid.eventually only "<portnumber> " might do it as well. On the page System Administration > Configuration > Additional Settings > Startup, in the TerminalPrompt row, select Edit.
go to post Robert Cemper · Jul 20, 2019 Hi Evegeny,I found nothing sophisticated but very straight.just from any namespace or routine / method. USER>w ^%SYS("SSPort") ;;SuperServer 1972 USER>w ^%SYS("WebServer","Port") ;; WebServer 57772 USER>
go to post Robert Cemper · Jul 19, 2019 ENSEMBLE may have some signal mechanic.BUT at Caché level you still have Special Variable $HALT as the last chance handler.all details https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_vhaltMost important: If you have $HALT set and also have code defined for ^%ZSTOP when a HALT is issued, the $HALT is executed first. $HALT can prevent the termination of the process, if its halt trap routine does not contain a HALT command. !!!!
go to post Robert Cemper · Jul 19, 2019 if you test your example from terminal prompt it needs some important change:open file:("WNS"):3if ('$test) { write !,"Failed to open "_file quit }use file do ALL^%SS ;; must be the same lineclose filequit
go to post Robert Cemper · Jul 18, 2019 the popular use of is INTERACTIVE.But there is a BATCH option: SAMPLES>zn "%SYS" %SYS>d BATCH^GBLOCKCOPY 1) Manage Batches 2) Run a Batch 3) Restart a Batch 4) Add Processes to a running Batch 5) Stop a Running batch 6) Monitor Running Batch 7) Batch Report 8) Exit Option? 1 1) Create a Batch 2) Edit a Batch 3) List Batches 4) Delete a Batch 5) Exit Option? I never used it myself. it seems to me you should find it in ^%SYS("GBLOCKCOPY") But the source code is open in %SYS and easy to read: BATCH w ! w !,"1) Manage Batches" w !,"2) Run a Batch" w !,"3) Restart a Batch" w !,"4) Add Processes to a running Batch" w !,"5) Stop a Running batch" w !,"6) Monitor Running Batch" w !,"7) Batch Report" w !,"8) Exit" w ! s Option=$$OPTION("Option? ",8,8) i Option=1 d BATCHMANAGE g BATCH i Option=2 d BATCHRUN g BATCH i Option=3 d BATCHRESTART g BATCH i Option=4 d BATCHADDPROCESSES g BATCH i Option=5 d BATCHSTOP g BATCH i Option=6 d BATCHMONITOR g BATCH i Option=7 d BATCHREPORT g BATCH qBATCHMANAGE w ! w !,"1) Create a Batch" w !,"2) Edit a Batch" w !,"3) List Batches" w !,"4) Delete a Batch" w !,"5) Exit" w ! s Option=$$OPTION("Option? ",5,5) i Option=1 d BATCHCREATE g BATCHMANAGE i Option=2 d BATCHEDIT g BATCHMANAGE i Option=3 d BATCHLIST g BATCHMANAGE i Option=4 d BATCHDELETE g BATCHMANAGE qBATCHCREATE s $zt="BATCHE" s Name=$$GETNAME("Batch name to create? ",0,0) q:POP f w !!,"Adding to batch: "_Name d BATCHSETUP q:POP g BATCHCREATEBATCHEDIT s $zt="BATCHE" s Name=$$GETNAME("Batch name to edit? ",1,0) q:POP s Status=$$GETSTATUS(Name,1) i $p(Status,"~",4)'="Queue" w !,"Batch "_Name_" has been run, please re-enter" g BATCHEDIT i $$YN("Do you want to add to the batch","Y")="Y" f w !!,"Adding to batch: "_Name d BATCHSETUP q:POP i $$YN("Do you want to delete entries from batch "_Name,"N")="N" g BATCHEDITBATCHEDIT1 d SUMMARYREPORT(Name,0) s Option=$$OPTION("Delete which entry? ",0,+$o(^|"^^"_$zu(12)|%SYS("GBLOCKCOPY",Name,""),-1)) i Option=0 g BATCHEDIT . . . . . . . . HTH,
go to post Robert Cemper · Jul 18, 2019 Sorry, this is a description of how to run a program of WINDOWS or LINUX from Caché.What you address here ar Caché Routines or ClassMethods.
go to post Robert Cemper · Jul 18, 2019 are you looking for this ?Execute Server Commands from Caché / Ensemble / IRIS
go to post Robert Cemper · Jul 17, 2019 to count the number of changes you may use this approach Set ^Data("Cambridge") = "1" if $increment(change("Cambridge")) Set ^Data("New York") = "2" if $increment(change("New York")) Set ^Data("Boston") = "3" if $increment(change("Boston")) Set ^Data("London") = "4" if $increment(change("London")) Set ^Data("Athens") = "5" if $increment(change("Athens")) Set ^Data("Athens") = "6" if $increment(change("Athens")) Set ^Data("Athens") = "7" if $increment(change("Athens")) zw change change("Athens")=3 change("Boston")=1 change("Cambridge")=1 change("London")=1 change("New York")=1
go to post Robert Cemper · Jul 13, 2019 "using object methods while running the report"This is a rather generic statement.If you are using CLASS METHODS (as I 'd assume) you can project each class method as Stored SQL Procedure too.By this, you can make them available to be used over JDBC.Could be an eventual workaround.
go to post Robert Cemper · Jul 12, 2019 This is a rather common misunderstanding.The naming GLOBAL was created in the 60ties.Long before any other programming language even had anything named Global or similar.GLOBAL in Caché is a persistent storage component that builds the backbone of (SQL) Tables and Persistent Objects.see this documentation: Using Caché Globals
go to post Robert Cemper · Jul 12, 2019 Excellent & valid comment !I didn't think of this difference before.
go to post Robert Cemper · Jul 11, 2019 OK !They look rather similar.BUT:Process Private Globals are "unlimited". Clear there is a physical limit, but it's far away compared to local variables.PPGs are best suited as Storage location + Index location of temporary tables.Without limit as any ordinary Global. So it depends on your needs.
go to post Robert Cemper · Jul 10, 2019 the data property is a standard HTML page.I'm not aware of some function in Caché that converts HTML to JSON.But asking Google "convert HTML to JSON" shows that this a standard feature in JavaScript. so I see 2 options:- write your own parser (or someone in the community has done this before ???) - call an external tool (eg. node.js) to it for yousee: https://stackoverflow.com/questions/34504050/how-to-convert-selected-html-to-jsonor https://stackoverflow.com/questions/12980648/map-html-to-jsonor https://stackoverflow.com/questions/43469412/convert-html-source-code-to-json-object