データの分割

「データの分割」の編集履歴(バックアップ)一覧に戻る

データの分割 - (2008/10/13 (月) 01:56:00) の編集履歴(バックアップ)


/*testデータ*/
data test ;
    no=1 ; flg=. ; output ;
    no=2 ; flg=1 ; output ;
    no=3 ; flg=. ; output ;
run ;

test
no fig
1 .
2 1
3 .









/*1つのデータセットを2つに分割*/
/*(1)flg^=1の場合はaに出力、flg=1の場合はbに出力する*/ 
  data a b ;
    set test ;
    if     flg^=1 then output a ;
    else if flg=1 then output b ;
  run ;
 
 
/*(2)全てのOBSをaに出力、flg=1の場合はbに出力する*/
 
  data a b ;
    set test ;
    output a ;
    if flg=1 then output b ;
  run ;
 
dataA
no fig
2 1
3 .
dataB
no fig
1 .







ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。