go to post John Murray · Nov 5, 2018 I suggest the following strategy:Read lineIf $Length(line,"""")#2=1 then you have a complete CSV line (an even number of doublequotes)Otherwise read line2 and append it to line. Repeat this until $Length(line2,"""")#2=1. If you reach the end of the file before this happens, the CSV source is malformed.In the above algorithm you may want to cater for the case where concatenation of consecutive lines would exceed the maximum local string length.
go to post John Murray · Nov 5, 2018 Mack, can you give me an example of the kind of CSV line that you mean here?
go to post John Murray · Nov 2, 2018 My proposal: USER>w csv ABC Company,"123 Main St, Ste 102","Anytown, DC",10001,234-567-8901 USER>s i=0 USER>f s i=$f(csv,",",i) q:'i i $l($e(csv,1,i-2),"""")#2 s $e(csv,i-1)=$c(9) USER>w csv ABC Company "123 Main St, Ste 102" "Anytown, DC" 10001 234-567-8901 USER> Without abbreviations: USER>write csv ABC Company,"123 Main St, Ste 102","Anytown, DC",10001,234-567-8901 USER>set i=0 USER>for set i=$find(csv,",",i) quit:'i if $length($extract(csv,1,i-2),"""")#2 set $extract(csv,i-1)=$char(9) USER>write csv ABC Company "123 Main St, Ste 102" "Anytown, DC" 10001 234-567-8901 USER>
go to post John Murray · Oct 29, 2018 How about this?SAMPLES>s sc=$system.OBJ.Export("/csp/samples/*.csp","c:\s\junk.xml","/recursive=1") Exporting to XML started on 10/29/2018 09:36:31Exporting CSP/CSR or file: /csp/samples/basic.cspExporting CSP/CSR or file: /csp/samples/cinema/Cinema.cspExporting CSP/CSR or file: /csp/samples/cinema/Film.cspExporting CSP/CSR or file: /csp/samples/cinema/LoadData.cspExporting CSP/CSR or file: /csp/samples/cinema/Order.cspExporting CSP/CSR or file: /csp/samples/cinema/Search.cspExporting CSP/CSR or file: /csp/samples/cinema/SearchResults.cspExporting CSP/CSR or file: /csp/samples/cinema/ShowTimes.cspExporting CSP/CSR or file: /csp/samples/cinema/TopPicks.cspExporting CSP/CSR or file: /csp/samples/context.cspExporting CSP/CSR or file: /csp/samples/cookie.cspExporting CSP/CSR or file: /csp/samples/custom.cspExporting CSP/CSR or file: /csp/samples/error.cspExporting CSP/CSR or file: /csp/samples/expires.cspExporting CSP/CSR or file: /csp/samples/form.cspExporting CSP/CSR or file: /csp/samples/formsubmit.cspExporting CSP/CSR or file: /csp/samples/include.cspExporting CSP/CSR or file: /csp/samples/includedpage.cspExporting CSP/CSR or file: /csp/samples/inspector.cspExporting CSP/CSR or file: /csp/samples/iterate.cspExporting CSP/CSR or file: /csp/samples/language.cspExporting CSP/CSR or file: /csp/samples/logerror.cspExporting CSP/CSR or file: /csp/samples/loop.cspExporting CSP/CSR or file: /csp/samples/lottery.cspExporting CSP/CSR or file: /csp/samples/lotteryend.cspExporting CSP/CSR or file: /csp/samples/lotteryhistory.cspExporting CSP/CSR or file: /csp/samples/lotteryjoin.cspExporting CSP/CSR or file: /csp/samples/lotterymain.cspExporting CSP/CSR or file: /csp/samples/lotterymenu.cspExporting CSP/CSR or file: /csp/samples/menu.cspExporting CSP/CSR or file: /csp/samples/object.cspExporting CSP/CSR or file: /csp/samples/popform.cspExporting CSP/CSR or file: /csp/samples/private.cspExporting CSP/CSR or file: /csp/samples/protected.cspExporting CSP/CSR or file: /csp/samples/protectedentry.cspExporting CSP/CSR or file: /csp/samples/query.cspExporting CSP/CSR or file: /csp/samples/redirect.cspExporting CSP/CSR or file: /csp/samples/rulemgr.cspExporting CSP/CSR or file: /csp/samples/serversideredirect.cspExporting CSP/CSR or file: /csp/samples/sessionevents.cspExporting CSP/CSR or file: /csp/samples/showsource.cspExporting CSP/CSR or file: /csp/samples/soapdemo.cspExporting CSP/CSR or file: /csp/samples/staticsql.cspExporting CSP/CSR or file: /csp/samples/streamserve.cspExporting CSP/CSR or file: /csp/samples/submit.cspExporting CSP/CSR or file: /csp/samples/svgdemo.cspExporting CSP/CSR or file: /csp/samples/testerror.cspExporting CSP/CSR or file: /csp/samples/textinclude.cspExporting CSP/CSR or file: /csp/samples/upload.cspExporting CSP/CSR or file: /csp/samples/wapzipcode.cspExporting CSP/CSR or file: /csp/samples/while.cspExporting CSP/CSR or file: /csp/samples/xmlclasses.cspExporting CSP/CSR or file: /csp/samples/xmlclasseserror.cspExporting CSP/CSR or file: /csp/samples/xmlclassesresult.cspExporting CSP/CSR or file: /csp/samples/xmlimport.cspExporting CSP/CSR or file: /csp/samples/xmlquery.cspExporting CSP/CSR or file: /csp/samples/xmlqueryresult.cspExporting CSP/CSR or file: /csp/samples/zipcode.cspExport finished successfully. SAMPLES>
go to post John Murray · Oct 29, 2018 For the record, the $TR abbreviation in my answer stands for $TRANSLATEThere is no $TRIM function in ObjectScript.
go to post John Murray · Oct 26, 2018 No, according to my tests the %qarfunc routine is available in all namespaces. It comes from the CACHELIB / IRISLIB database. But I think it's a remnant of an ancient InterSystems tool called M/SQL, so I wouldn't recommend starting to rely on it in new code you're writing.
go to post John Murray · Oct 25, 2018 My guess is that those absolute paths are being specified by your CSP application, so need to be changed so they become relative.Presumably the CSP app is already working when accessed from a webserver that's on the same computer as your Cache server, right?
go to post John Murray · Oct 25, 2018 AFAIK, freezing and thawing is system-wide. It can't be done on a per-database level.I'm not aware of any REST APIs being available 'out of the box' for Backup.General. But in any case it'd be useful to know what the $ZVERSION string is for the Cache instance(s) you're dealing with.
go to post John Murray · Oct 24, 2018 I've previously logged this issue #1 at https://github.com/intersystems-community/openexchange/issues/1
go to post John Murray · Oct 23, 2018 Here's one way, which uses $JUSTIFY to add leading spaces, then $TRANSLATE to convert these to zeroes: USER>s number=1 USER>w $tr($j(number,4)," ","0") 0001 USER>
go to post John Murray · Oct 19, 2018 I don't hold out much hope of EMS reappearing - see https://community.intersystems.com/post/what-current-status-enterprise-manager
go to post John Murray · Oct 18, 2018 I don't believe it's possible for the CACHESYS database (the one that sits behind the %SYS namespace) to be added to the mirror, because each member of the mirror needs to store instance-specific data there.I've seen sites write their own scripts to export users, roles etc periodically from the master instance into files and import them into the other(s). For example, the Export method of Security.UsersBut it's long puzzled me that InterSystems doesn't seem to have done this job for us all. Or perhaps they have, and I haven't yet heard about it.
go to post John Murray · Oct 17, 2018 Daniel, if your team benefits from working in a shared namespace but you'd still like source control, please consider using Deltanji from George James Software. This is a powerful and mature tool which runs natively within Caché / Ensemble / IRIS environments and integrates with Atelier, Studio and Portal editors. It is extensively used around the world, including at NHS sites.
go to post John Murray · Oct 5, 2018 A couple of years after my original post, we at George James Software got inspired to have another look at Visual Studio Code. And at Global Summit this week we premiered our upcoming extensions.You can watch a video of my flash talk here. https://youtu.be/1146vFuHoI8?t=1263If you want to be notified when it is available please email your request to info@georgejames.com
go to post John Murray · Oct 3, 2018 How about using the Export and Import methods of Security.Applications ?
go to post John Murray · Oct 2, 2018 Answering my own question. It looks like /multicompile=0 does the trick.
go to post John Murray · Oct 2, 2018 When the Terminal shortcut connects to your local Cache instance it does so directly and doesn't use telnet. The presence of TRM in the window title confirms that you're connecting that way, so you're not using the telnet service.Since you're able to use Portal, please go to System Administration > Security > Auditing. If auditing isn't already turned on, do that, then repeat the failed connect. Back in Portal use the audit viewer to see if there are any clues.
go to post John Murray · Oct 2, 2018 In Portal's Security section, check that your %Service_Console service is enabled.What authentication methods does it accept?The fact that your Terminal doesn't prompt for Username makes me think the service doesn't allow Unauthenticated. That's fair enough. But given that you used to be able to connect and now you can't, it looks like something changed on the config or the status of this Cache instance.