Ignacio Valdes · Nov 14, 2019

Basic question: how to edit?

I want to edit this routine to replace "Cache" with "IRIS" how do I do that in Intersystems Google Cloud environment?  The portal  System > Routines  doesn't seem to show much. 


DIRCR    ;SFISC/GFT-DELETE THIS LINE AND SAVE AS '%RCR'*** ;12:18 PM  20 Apr 1993 [ 04/02/2003   8:23 AM ]

         ;;22.0;VA FileMan;**1001**;APR 1, 2003

         ;;22.0;VA FileMan;;Mar 30, 1999


         ;Per VHA Directive 10-93-142, this routine should not be modified.

%RCR     ;GFT/SF





         I $ZV["Cache" G IHS

         S %D="" F  S %D=$O(%RCR(%D)) Q:%D=""  ZNEW @%D

         S %E=%RCR K %RCR,%X,%Y D @%E Q

IHS      ;

         ;----- END IHS MODIFICATION

         D INIT

O        S %D=$O(%RCR(%D)) G CALL:%D=""

         I $D(@%D)#2 S @(%E_")="_%D) G O:$D(@%D)=1

         S %X=%D_"(" D %XY G O


CALL     S %E=%RCR K %RCR,%X,%Y D @%E

         S %E="^UTILITY(""%RCR"",$J,"_^UTILITY("%RCR",$J)_",%D",^($J)=^($J)-1,%D=0,%X=%E_","

G        S %D=$O(@(%E_")")) I %D="" K %D,%E,%X,%Y,^($J,^UTILITY("%RCR",$J)+1) Q

         I $D(^(%D))#2 S @%D=^(%D) G G:$D(^(%D))=1

         S %Y=%D_"(" D %XY G G



XY(%X,%Y) ;

%XY      ;

         N %A,%B,%Q,%Z

         S %A=$$R(%X),%Q=""""""

         I $P(%A,"(",2)]"",$E(%A,$L(%A))'="," S:$L($P(%A,"(",2),",")>1 %Q=$P(%A,",",$L(%A,",")),$P(%A,",",$L(%A,","

))="" S:%Q="""""" %Q=$P(%A,"(",2),$P(%A,"(",2)=""

         S %Z=%A_%Q_")",%B=$L(%A)+1

         F  S %Z=$Q(@%Z) Q:$P(%Z,%A)]""!(%Z="")  S @(%Y_$E(%Z,%B,255))=@%Z


R(%R)    ;

         N %C,%F,%G,%I,%R1,%R2

         S %R1=$P(%R,"(")_"(" I $E(%R1)="^" S %R2=$P($Q(@(%R1_""""")")),"(")_"(" S:$P(%R2,"(")]"" %R1=%R2

         S %R2=$P($E(%R,1,($L(%R)-($E(%R,$L(%R))=")"))),"(",2,99)

         S %C=$L(%R2,","),%F=1 F %I=1:1:%C S %G=$P(%R2,",",%F,%I) Q:%G=""  I ($L(%G,"(")=$L(%G,")")&($L(%G,"""")#2)

)!(($L(%G,"""")#2)&($E(%G)="""")&($E(%G,$L(%G))="""")) S %G=$$S(%G),$P(%R2,",",%F,%I)=%G,%F=%F+$L(%G,","),%I=%F-1

         Q %R1_%R2

S(%Z)    ;

         I $G(%Z)']"" Q ""

         I $E(%Z)'="""",$L(%Z,"E")=2,+$P(%Z,"E")=$P(%Z,"E"),+$P(%Z,"E",2)=$P(%Z,"E",2) Q +%Z

         I +%Z=%Z Q %Z

         I %Z="""""" Q ""

         I $E(%Z)'?1A,"%$+@"'[$E(%Z) Q %Z

         I "+$"[$E(%Z) X "S %Z="_%Z Q $$Q(%Z)

         I $D(@%Z) Q $$Q(@%Z)

         Q %Z

Q(%Z)    ;

         S %Z(%Z)="",%Z=$Q(%Z("")) Q $E(%Z,4,$L(%Z)-1)


INIT     I $D(^UTILITY("%RCR",$J))[0 S ^UTILITY("%RCR",$J)=0

         S ^($J)=^($J)+1,%D="%Z",%E="^UTILITY(""%RCR"",$J,"_^($J)_",%D",%Y=%E_","

         K ^($J,^($J))


OS       ;

         S $P(^%ZOSF("OS"),"^",2)=DITZS

         K DITZS S ZTREQ="@"


0 19 206 4


Thank you for the response. Studio gives me 'not enabled for WRC login.' I can do vim and many other editors, I just don't know how to get to the actual code or if those are valid editors under these circumstances. I am used to the routines just being on the unix/linux file systems but I am not seeing how to get to the routines with docker, portal, etc.  -- IV

Can you elaborate on the syntax of the command or where I can find a command summary of %RCHANGE?

I have eclipse and Atelier installed and running. I have the ip address in and did a netstat -a to see which port is being listened on. It is choking on login credentials.  I did not setup the default id or password. That is done by google cloud when the instance is provisioned. I am using what I think is the correct id and password but it isn't going for it.  I don't know how to proceed. 

You need to use the IDE to edit routines.

For WRC access/Studio write to your InterSystems contact.

Have you tried installing Atelier or VS Code? They are available without registration.

Thank you, forgive my ignorance but on Atelier do you install java and eclipse on local machine and point it at the google cloud server instance or do you install java and eclipse on the google cloud server instance? 

Install on local workstation and create a connection that points to the cloud server

The latest version of Studio on WRC is 2019.3, while the latest version of IRIS is 2019.4. And Studio does not work version leter then own version.

Are you able to open and login into System Management Portal?


Yes I retrieved the static public IP from the console and put it in, I erased it in the screenshot. ifconfig gives a different IP than the console. I tried both. 

Yes I can get to portal. As you stated, Google sets the credentials when the instance is created. I've tried _SYSTEM/SYS and my Google credentials but it is still saying 'Unauthorized, check user credentials'  I went to System > Security Management > Users>Profile>Edit
 to try to change _SYSTEM password but there is no password field to edit.  -- IV

You managed to get authorized in System Management Portal, so you should know the correct password. You should use the same login and password in VSCode/Atelier. 

Yes I used _SYSTEM/SYS and definitely the correct IP and port which works for portal but that does not work for Atelier login pointed at the same IP and port. 

Got it. Atelier/server does not apparently allow the default password to be used. You have to change it. It is easily changed from the command line using iris password. 

Have you specified Address? Looks empty.

If it's GCP do you have a static public IP address/hostname you can connect to?

Can you open management portal?

If you provisioned IRIS on Google Cloud from marketplace, you should be able to see the same page as on my screenshot. You can press the button Visit the site, which will go you to System Management Portal, where you should be able to login with the default _SYSTEM and SYS, after that it will request you to change the default password. Which you can use in VSCode or Atelier. 

If  you want to q global search and replace you can use the %RCHANGE utility from a terminal session.

Using VSCode-ObjectScript is very easy to connect to a cloud instance with IRIS.

 Just Use IP address and port from site address, login _SYSTEM and password changed after first connect. 

And write it to file, .vscode/settings.json in your project folder

    "objectscript.conn": {
        "active": true,
        "host": "xx.xx.xx.xx",
        "port": 52773,
        "username": "_SYSTEM",
        "password": "123",
        "ns": "USER",