go to post Robert Cemper · Nov 10, 2018 from Caché prompt:USER>$uname -aLinux MYSERVER 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
go to post Robert Cemper · Nov 10, 2018 and for Linux:(don't have a Caché installation at hands) but CPIPE should do itrcemper@ubuntu:~$ uname -aLinux anyServer 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linuxrcemper@ubuntu:~$
go to post Robert Cemper · Nov 10, 2018 something fast for WINDOWSUSER>$wmic os list brief BuildNumber Organization RegisteredUser SerialNumber SystemDirectory Version17134 cemper 0 0 C:\WINDOWS\system32 10.0.17134
go to post Robert Cemper · Nov 9, 2018 from terminal and get a long printout.If you just look for a specific line you could run the command using CPIPE and read it line by line until you get your infodetails on CPIPE here: Execute Server Commands from Caché / Ensemble / IRISFor Linux/Unix I don't have that at hands
go to post Robert Cemper · Nov 9, 2018 I oppose:- all text coloring, fonts sizes help to express the importance of text. - text from right to left is only useful for Hebrew or Arabic writing: not my world- special characters help a lot if you don't have them on your keyboard ¿isn't it ? my 2 ¢- what's bad with smileys? I do spell checking with Grammarly. the embedded only confused me.Source could need an improvement to wrap the text in the window. The single line display is cumbersome.
go to post Robert Cemper · Nov 6, 2018 If you want to do the check immedeatly at start of Enseble you can use Routine %ZSTART in Namespace %SYSif it is at start of a production you can use Ens.Director class
go to post Robert Cemper · Nov 5, 2018 To separate physical storage from applications you may do this inside Caché using ECP
go to post Robert Cemper · Nov 5, 2018 As stated in the 2nd paragraph:Unlike the standard .NET binding, the eXTreme APIs do not use TCP/IP to communicate with Caché.Instead, they use a fast in-memory connectionSo by definition, it can't be on a different server. It acts like COS but in the .NET based language of your choice.
go to post Robert Cemper · Nov 4, 2018 Still another approach using your original "solution" in PHP following the idea of a Micro-Service.Instead of a mimic of what PHP might do I use it directly for this purpose.That way more sophisticated functionalities that can be used without recoding.I extended your test to include doubled double quotesUSER>write %dstrABC Company,"123 Main St, Ste 102","Anytown, DC",10001,234-567-8901,"hi ""rcc"" was here"USER>set reply=$$^phpCSV(%dstr) write reply,!! zwrite replyABC Company 123 Main St, Ste 102 Anytown, DC 10001 234-567-8901 hi "rcc" was here reply="ABC Company"_$c(9)_"123 Main St, Ste 102"_$c(9)_"Anytown, DC"_$c(9)_"10001"_$c(9)_"234-567-8901"_$c(9)_"hi ""rcc"" was here"*and here the code: phpCSV(str) { ; use PHP for conversion#define php "............\php.exe " ; add location of php.exe #define pipe "|CPIPE|1" set file="myTest.php" open file:"WN" use file write "<?php " ,!,"$str='"_str_"';" ,!,"$strtotab = implode('\t', str_getcsv($str, ','));" ,!,"print_r($strtotab);" ,!,"?>",! close file open $$$pipe:$$$php_file use $$$pipe read result close $$$pipe use 0 ; write result quit $replace(result,"\t",$c(9)) }
go to post Robert Cemper · Nov 2, 2018 GREAT ! all well-documented code!no (dirty) Harry_Potter_Coding !I was sure you know it
go to post Robert Cemper · Nov 1, 2018 The Unix/Linux world often uses LF := $C(10) as line terminatorwhile in Win (and VMS) world CRLF := $C(C13,10) is a default. So you depend on the source system providing the data.Suggested approach: use LF as the (common) line terminator and just drop $C(13) or 
 from your input record by$replace($translate(record,$c(13)),"
","")Before any other processing.
go to post Robert Cemper · Nov 1, 2018 OK, this handles double quotes. But only INSIDE a quoted string parseCSV(string,newsep,sep=",",quote="""",newquote) { ;adjust for flexible quoting set res="",newsep=$g(newsep,$c(9)),newquote=$g(newquote,quote) for { if $g(string)[sep { if $e(string)=quote { set string=$replace(string,"""""",$c(2)) ; exclude double quotes set part=$P(string,quote,2) ,string=$replace($p(string,part_quote_sep,2,*),$c(2),"""""") ,res=res_newquote_$replace(part,$c(2),"""""")_newquote_newsep } else { set part=$P(string,sep),string=$p(string,sep,2,*) ,res=res_part_newsep } } else { set res=res_$g(string) quit } } quit res}-HTH
go to post Robert Cemper · Nov 1, 2018 you are right. I didn't think on empty parts and doubled double quotes which I never met from CSV.next level exercise
go to post Robert Cemper · Nov 1, 2018 I discourage since years the use of $ZU(...) functions as they aren't documented since 2010. I recently had to dig back to 2009 for just a weak hint what might happen.It is even worse with all the internal stuff around %occ* and similar.No docs. No guaranty of the life cycle. No (external) notice of eventual changes. Mostly as a deployed code.If it is used inside a $system.* or part of a generated code that's OK. The responsibility is not at the user side.Verifying those "specials" with every release change can be a very heavy exercise. (just experiencing this on a system locked down to on an older version unable to migrate)
go to post Robert Cemper · Nov 1, 2018 not being verbose in %occ* world I had this solution also allowing to change quoting parseCSV(string,newsep,sep=",",quote="""",newquote) { ;adjust for flexible quoting set res="",newsep=$g(newsep,$c(9)),newquote=$g(newquote,quote) for { if $g(string)[sep { if $e(string)=quote { set part=$P(string,quote,2),string=$p(string,part_quote_sep,2,*) ,res=res_newquote_part_newquote_newsep } else { set part=$P(string,sep),string=$p(string,sep,2,*) ,res=res_part_newsep } } else { set res=res_$g(string) quit } } quit res}BTW.It's an excellent test exercise for new COS programmersI'll add it to my collection.Thanks
go to post Robert Cemper · Oct 29, 2018 Depending on where your output comes from you may trySPOOL - the forgotten deviceorExecute Server Commands from Caché / Ensemble / IRISto get the output into a local variable or global
go to post Robert Cemper · Oct 29, 2018 Congratulations! In past, we had a similar event in Austria named "Tech Talk" that formed a national user community over time.I wish you a lot of success,Robert
go to post Robert Cemper · Oct 21, 2018 OK. for some reason the most important part of the link was truncated.https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25CSP.BinaryStreamI hope it doesn't hide again.The basic mistake happens here the definition of Request https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25CSP.RequestAnd you are right. %CSP.Stream has no Read method because ContentType tells you the true object . As in the example:It could have been %CSP.CharacterStream as well.Both extend over some steps %GlobalStreamAdaptor which have all the READ, WRITE, ....methodsJust reading docs and not checking inherited methods (e.g. in Studio) is mostly misleading.