SAS to JSL-Do Loops .. ..私は長い間SASユーザーがJSLを学ぶことを余儀なくされています...
SASで簡単だと思ったことは、JSLではとても難しいようです...
誰かが、JSLを使用して次のネストされたdoループテーブルを生成するJSLコードを私と共有することによって、JSLでDoループがどのように機能するかを教えてもらえますか?
データの欲求不満;
temp = 1から10x1を実行します。
= 5〜20 x5を押してください。
時間= 1から1000x 20;
出力;
終わり;
終わり;
終わり;
走る;
これらのタイプのシミュレーションを作成するには、これはかなり簡単なはずですが、私には理解できないようです。
スクリプティングRe:SASからJSL-Do Loops .. ..JSLの学習を支援するための適切な場所に来ました。オンラインドキュメントと同様に、スクリプトインデックスはあなたの友達です。
これがあなたが望むことをするコードスニペットです:
dt = data table("frustration");
for (temp = 1, temp <= 10, temp++,
for (press = 5, press <= 20, press+=5,
for (time = 1, time <= 1000, time+=20,
show(temp, press, time); // output
);
);
);
Re:SASからJSL-Do Loops .. ..これらはすべてスクリプトガイドで説明されています。スクリプトガイドを読むことを強くお勧めします。これは、JMPの[ヘルプ]プルダウンメニューから利用できるJMPドキュメントライブラリで利用できます。
Re:SASからJSL-Do Loops .. ..JSLのC ++プログラマーズガイドいくつかの助けになるかもしれません。 JSL forステートメントが実際にどのように関数であるかを示し、それを知っていると構文を正しく理解するのがはるかに簡単になります。
Re:SASからJSL-Do Loops .. ..ヘルプpmrozをありがとう
Re:SASからJSL-Do Loops .. ..あなたが言っていることを聞きます...ありがとう...しかし、それはキリスト教を理解するために聖書を読むようにあなたに言っているようなものです....私はスクリプトガイドでこれを行う方法を探して約2時間過ごしました簡単な概念...さらに、私は他のスクリプトを書くことに多くの成功を収めてきました...しかし正直なところ、スクリプトガイドはSASライセンスの予算でさらに20kを望んでいます。
私は筋金入りのコーダーではありません... 私はただ物事を早く終わらせようとしているエンジニアです。
Re:SASからJSL-Do Loops .. ..ありがとう...これは役に立ちます。
Re:SASからJSL-Do Loops .. ..例を挙げて学ぶ方が簡単だと思うので、このフォーラムで見つけられる限り多くのコードを見てください。スクリプトインデックスを作成すると、本当に友達になります。
JSLにとってループともしもステートメントは、概念は単純ですが、最初は少し戸惑いました。についての学習曲線を短縮するにはもしも、これは関数であり、コンマはそれから、それ以外の場合とそれ以外。スクリプトウィンドウを開きます( ctrl-T )、ウィンドウを右クリックして、埋め込みログを表示。以下のコードを貼り付けてクリックしますctrl-Rそれを実行します。a、b、cのさまざまな値を試して、何が起こるかを確認してください。
a = 1;
b = 2;
c = 1;
if (a == b,
// then
print("a is equal to b");
,
// else if
a == c,
// then
print("a is equal to c");
,
// else
print("No match found for a");
);
Re:SASからJSL-Do Loops .. ..新しい言語で始めるのがどれほど難しいかを理解する完全な例。 (ヘルプ->スクリプトインデックスとオンラインヘルプは補完的なリソースです。 私は主にhelp-> scripting indexを使用して、それがどのように機能するかを思い出させます。 オンラインヘルプは、始めるのに適しているかもしれません。)私はここに必要以上のものを入れました。 名前の場合のSASルールを忘れてしまいました...
Names Default To Here( 1 );
// what does that mean? JSL has several namespaces; the 'here' namespace is for this
// editor window and means 'press' is really 'here:press' but 'dtFrustration:press' belongs to
// the table's namespace (of column names.) You could also just use different names,
// like 'iPress' for the loop control variable. JMP's variable names are almost never
// case sensitive, the weird exception being column names, which are only sensitive <BR />// if both 'Age' and 'age' are columns...Don't do that!
// an easy way to get this table script is to make a new table with the
// JMP GUI, then use the top-left red triangle to 'Copy Table Script (No Data)'.
// By convention, JSL uses 'dt' in the variable name that holds a handle to a table.
dtFrustration = New Table( "frustration",
New Column( "temp" ), // continuous numeric by default
New Column( "press" ),
New Column( "time" )
);
// because the table might be linked to other reports, there
// is a lot of hidden messaging when the table changes. A lot.
// The messaging can be shut off and later enabled for a nice speedup.
// (to see it take longer, rerun just the loop below.)
// dtFrustration << BeginDataUpdate; // pair with EndDataUpdate, below
For( temp = 1, temp <= 10, temp++,
For( press = 5, press <= 20, press += 5,
For( time = 1, time <= 1000, time += 20,
dtFrustration << addrows( 1 );
dtFrustration:time = time;
dtFrustration:temp = temp;
dtFrustration:press = press;
)
)
);
// dtFrustration << EndDataUpdate;
Re:SASからJSL-Do Loops .. ..SUPER USERPMROZにもう一度感謝します。これは役に立ちます。