查找

Artigo
· Ago. 13 3min de leitura

$ZF(-100) で指定できる便利なキーワード

これは InterSystems FAQ サイトの記事です。

$ZF(-100) は、OSコマンドまたはプログラムを子プロセスとして実行するのに使われますが、一緒に便利なキーワードを指定することが可能です。

$ZF(-100)でコマンドの実行がうまくできない、という経験をされた方も多いかと思います。

そんな時は、この便利なキーワードを使って原因の調査をしていきましょう。

キーワードには以下のようなものがあります。

/SHELL シェルを使用して program を実行する。既定では、シェルは使用されない。
/STDIN=filename 入出力リダイレクト入力ファイル
/STDOUT=filename 入出力リダイレクト標準データ出力ファイル
/STDERR=filename 入出力リダイレクト標準エラー出力ファイル
/LOGCMD 結果として得られるコマンド行を messages.log に記録する
/NOQUOTE コマンド、コマンド引数、またはファイル名の自動引用を禁止する


使用方法は、以下のようになります。

write $zf(-100,"/SHELL /LOGCMD /STDERR=err.log","command1","command2",...) 


例:ネットワーク共有の設定がうまくいかないので原因を調べたい。
  →STDERR キーワードで、入出力リダイレクト標準エラー出力ファイルを取得してみる

TEST1>write $zf(-100,"/SHELL /stdout=output.log /stderr=err.log","net", "use", "\\172.xxx.xxx.xxx\c$", "/user:Administrator", ^pass)
1
TEST1>!type err.log
システム エラー 86 が発生しました。
指定されたネットワーク パスワードが間違っています。
'5cm' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。

これは、ネットワーク共有にアクセスするパスワードに & などの特殊文字含まれるため、パスワードが途中の 5cm までしか認識しなかった例です。
この場合は、^&でエスケープするか、/NOQUOTE キーワードを指定し、パスワードにクオートをつけて対応します)
※クオートいるなしを、$ZFが勝手に判断するので、本当はいるとき(パスワードに&が含まれるときとか)でも、付けてくれなくてエラーになることがある
そんなときの対応に使える(クオートはあえて付けない=NOQUOTE、いるときは自分でつける)


対応例:

USER>write $zf(-100,"/SHELL /NOQUOTE /stdout=output.log /stderr=err.log","net", "use", "\\172.xxx.xxx.xxx\Public", "/user:Administrator",""""_ ^pass_"""")
0
USER>!net use
新しい接続は記憶されます。
 
 
ステータス  ローカル名 リモート名                ネットワーク名
 
-------------------------------------------------------------------------------
OK                     \\172.xxx.xxx.xxx\Public   Microsoft Windows Network
コマンドは正常に終了しました。
 
USER>
Discussão (0)0
Entre ou crie uma conta para continuar
Anúncio
· Ago. 12

[Demo Video] Data Transformation Adventures with InterSystems IRIS

#InterSystems Demo Games entry


⏯️ Data Transformation Adventures with InterSystems IRIS

Navigating interoperability and healthcare can be an exciting adventure. In this demo, we will show you how InterSystems IRIS can be the perfect tool to get data - wherever it may lie, in whatever format, into a format of your choice, including FHIR! Once that is done, analytics is a piece of cake with the FHIR SQL Builder and Deep See Web. Let the questing begin!

Presenters:
🗣 @Kate Lau, Sales Engineer, InterSystems
🗣 @Merlin Wijaya, Sales Engineer, InterSystems
🗣 @Martyn Lee, Sales Engineer, InterSystems
🗣 @Bryan Hoon, Sales Engineer, InterSystems

🗳 If you like this video, don't forget to vote for it in the Demo Games!

Discussão (0)0
Entre ou crie uma conta para continuar
Discussão (0)1
Entre ou crie uma conta para continuar
Pergunta
· Ago. 12

Need help with file upload.csp

I am trying to use upload.csp as a template for choosing a CDV file to process. I am calling it from a zen page using this:
<button caption="Import Client Consultation Extract" 
       controlStyle="width:500px; height:100px; font-size:1.5em;"
         onclick="zenPage.importExtract();"/>

ClientMethod importExtract() [ Language = javascript ]
{
    // Open CSP popup to upload the CSV
    //alert('importExtract called.');
    zenPage.launchPopupWindow(zenLink('Upload.CSP'),'Upload Client Consultation extract',
                              'status,scrollbars,resizable,width=750,height=250');
}

I have increased the size of the text and buttons and I have added code to process the contents of the selected file into a global that will be processed further in the next step. The only problem is, I can't get the code to call back to the parent zen page and close the popup. I also wanted to add an "Exit" button so the user can close the popup without choosing a file if needed for some reason. What I have developed isn't working.

I am hoping someone would take some time to look this over and give me some solutions.

Here is the upload.csp as I have altered it.

<!-- Copyright (c) 2001 InterSystems Inc. ALL RIGHTS RESERVED. -->
<csp:class description="Upload Client Consultations file.">
<html> <head>
<H1>Upload Client Consultation extract file</H1>
</head> <body bgcolor="#CCCCFF"> <!-- HTML Form to submit the file. You must specify the enctype="multipart/form-data" -->
<!-- for this to work -->
<form enctype="multipart/form-data" method="post" action="upload.csp" style="font-size: 20px">
Choose Client Consultation file: <input type=file size=30 name=FileStream style="width: 500px; height: 40px; font-size:18px;">
<style="font-size: 20px;">
<ul>
  <input type="submit" value="Upload file" style="width: 100px; height: 40px; font-size: 18px;">
  <button onclick="exitPopup();" style="width: 100px; height: 40px; font-size: 18px;"> Exit </button>
</ul>
<p>
</form> <!-- As form is submitted to this page look to see if we have the stream in the %request object -->
<csp:if condition='($data(%request.MimeData("FileStream",1)))'>
<ul>
<script language="Cache" runat="server">
&js<alert('Choose file click');>
New bytes,lc
Set bytes=%request.MimeData("FileStream",1).Read()
Set bytes=##class(%CSP.Utils).DecodeData(bytes)
If $Data(^G2W.Import("UploadedCSV")) Kill ^G2W.Import("UploadedCSV")
For lc=1:1:$L(bytes,"_$c(13,10)_") {
Set D=$TR($Piece(bytes,"_$c(13,10)_",lc),$C(187,191,239))
Set ^G2W.Import("UploadedCSV",lc)=$ZCONVERT(D, "I", "HTML")
}
</script>
</ul>
</csp:if>
</body>
<script language = "JavaScript" >
 function exitPopup() {
alert('Made it to exitPopup');
opener.processImport();
window.close();
}
</script>
</html>
 

I do realize this is to choose a file on the client side (my laptop). This is what I want. The file will not be on the server (my desktop).

Thank you for your time.

8 Comments
Discussão (8)2
Entre ou crie uma conta para continuar
Anúncio
· Ago. 12

VS Code release July 2025 (version 1.103)

Visual Studio Code releases new updates every month with new features and bug fixes, and the July 2025 release is now available.

Enhancements include revamped tool picker and expanded tool limits for MCPs, Chat GPT-5 integration and chat checkpoints, and multi-branch Git worktrees plus coding agent session management to improve productivity.

If you need help migrating from InterSystems Studio to VS Code, or want to advance your knowledge of VS Code, take a look at the training courses George James Software offers > georgejames.com/vscode-training/

Updates in version 1.103 include -

MCP:

Chat:

Productivity:

The release also includes contributions from our very own @John Murray through pull requests that address open issues. Find out more about these features in the release notes here > https://code.visualstudio.com/updates/v1_103

For those with VS Code, your environment should auto-update. You can manually check for updates by running Help > Check for Updates on Linux and Windows or running Code > Check for Updates on macOS.

Discussão (0)1
Entre ou crie uma conta para continuar