Rod Dorman · Jan 14, 2022 go to post

In that case you'll want to use %Net.SSH.Session to connect to the site and once signed in use the OpenSFTP method to open a SFTP session to be able to make %Net.SSH.SFTP calls, in particular the Put or PutStream method
 

Rod Dorman · Aug 13, 2021 go to post

If you want to get rid of spaces the simplest way is use $TRANSLATE

SET NoSpaces=$TRANSLATE(line," ")

Rod Dorman · Oct 27, 2019 go to post

The value we wanted should have been a simple string, and we did not
 know how to convert the output to string
##class(%SYSTEM.Encryption).MD5Hash() does return a string, what do you mean by 'simple'? If you mean 'displayable' that will depend on what you're trying to display on.
Take a look at ##class(%SYSTEM.Encryption).Base64Encode() that will return a string with only non-control ASCII characters.

Rod Dorman · Jul 18, 2019 go to post

Use $ZDATEH() to convert to internal $HOROLOG format, and $ZDATE() to convert to your desired format

WRITE $ZDATE($ZDATEH("14JAN1991",8),8)

Rod Dorman · Feb 25, 2019 go to post

The question was about alternatives to using % which is what I answered.

Rod Dorman · Nov 1, 2018 go to post

Are the %occLibrary entry points documented anywhere as being available for use by applications?

Rod Dorman · Oct 25, 2018 go to post

If its OK for the DB to be off line for a little bit a simple kludge would be to use the SYS.Database DismountDatabase class method to dismount it and then when the copy is done use MountDatabase to mount it.

Rod Dorman · Oct 16, 2018 go to post

type KILL DO ^%IS hit Enter twice WRITE

and look at what IOF and IOST are set to

Rod Dorman · Sep 19, 2018 go to post
    SET $ZT = "CommandErr"
    OPEN Command:"QR"
    FOR {
        USE command
        READ Text
        USE $P
        SET Array($I(Array))=Text
    }
 CommandErr ;
    SET $ZT=""
    SET ZE=$ZE
    USE $P
    CLOSE command
    IF $P(ZE,">")'="<ENDOFFILE" {
        ; some error other than end of file
    }
    ELSE {
        ; parse contents of Array()
    }
Rod Dorman · Jul 16, 2018 go to post

If the command you're using doesn't support redirection to a file use a command pipe e.g. SET $ZT="CommandErr" OPEN Command:"QR" FOR { USE Command READ Text USE $P ; do something with the text } CommandErr ; SET ZE=$ZE SET $ZT="" USE $P CLOSE Command IF $P(ZE,">")="<ENDOFFILE" { ; successful completion } ELSE { ; something happened }

Rod Dorman · Jul 16, 2018 go to post

Figure out how you'd do it at a command prompt and then issue that command with $ZF(-1)

Rod Dorman · Jun 3, 2018 go to post

You could put an entry in /etc/sudoers to allow them to run ccontrol.

Rod Dorman · Apr 12, 2018 go to post

You could try using $QUERY to iterate the global and use $QLENGTH to determine how deep you are and $QSUBSCRIPT to determine what the subscripts are.